chore: remove duplicate copies of the site, download center and installers (WS-C)
The landing page, download pages, invite page, assetlinks and installers existed in two or three places; only site/ and the Forgejo feed are served. - apps/api-server/wwwroot: delete the stale site build, download/invite pages, .well-known copy, legacy static admin and 1.0.0 binaries. The API no longer serves static files (UseStaticFiles/fallbacks and the apk/zip blocker removed); the Next admin is the only admin UI. - Delete 19 tracked installers/packages (~568 MiB) under site/public/releases, apps/web/public/releases and wwwroot/releases; .gitignore blocks them. - apps/web: delete the download/releases pages, desktop-release.ts, the download.html and assetlinks copies, and the accept-invite page (invites are only issued to the site's /accept-invite/). e2e specs call the /app base path and check the /download redirect instead. - scripts: delete the retired release/NAS site scripts, drop the web target from sync-version, and check assetlinks in site/public only. - Delete the unused Dockerfile.admin (apps/admin/Dockerfile is used). Policy: docs/REFACTOR_POLICY.md Wave 3, W3-5 and W3-6.
This commit is contained in:
parent
b6fe588a7c
commit
cd9d199dbf
53 changed files with 43 additions and 3278 deletions
|
|
@ -1,92 +0,0 @@
|
|||
// scripts/ci/sync-and-publish-forgejo-release.mjs
|
||||
// Desktop-only legacy sync. Android production artifacts are intentionally
|
||||
// excluded: they may be published only by .github/workflows/release.yml after
|
||||
// signed release evidence is verified in an isolated create-only directory.
|
||||
|
||||
import { copyFileSync, mkdirSync, existsSync } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import credentialHelpers from '../lib/credentials.cjs';
|
||||
|
||||
const { forgejoAuthorization } = credentialHelpers;
|
||||
|
||||
const RELEASE_DIR = 'apps/desktop/release/1.0.0';
|
||||
const SITE_PUBLIC_RELEASES = 'site/public/releases/1.0.0';
|
||||
const SITE_PUBLIC_ROOT = 'site/public/releases';
|
||||
const SITE_DIST_RELEASES = 'site/dist/releases/1.0.0';
|
||||
const SITE_DIST_ROOT = 'site/dist/releases';
|
||||
|
||||
console.log('--- 1. Syncing binary files to site static distribution directories ---');
|
||||
|
||||
mkdirSync(SITE_PUBLIC_RELEASES, { recursive: true });
|
||||
mkdirSync(SITE_DIST_RELEASES, { recursive: true });
|
||||
|
||||
const filesToSync = [
|
||||
'D3RO-Voice-Setup-1.0.0-x64.exe',
|
||||
'D3RO-Voice-Setup-1.0.0-x64.exe.blockmap',
|
||||
'latest.yml'
|
||||
];
|
||||
|
||||
for (const file of filesToSync) {
|
||||
const src = path.join(RELEASE_DIR, file);
|
||||
if (existsSync(src)) {
|
||||
// Copy to releases/1.0.0/
|
||||
copyFileSync(src, path.join(SITE_PUBLIC_RELEASES, file));
|
||||
copyFileSync(src, path.join(SITE_DIST_RELEASES, file));
|
||||
|
||||
// Also copy latest.yml to releases/ root
|
||||
if (file === 'latest.yml') {
|
||||
copyFileSync(src, path.join(SITE_PUBLIC_ROOT, file));
|
||||
copyFileSync(src, path.join(SITE_DIST_ROOT, file));
|
||||
}
|
||||
console.log(`✓ Copied ${file} to public distribution paths`);
|
||||
} else {
|
||||
console.warn(`! Source file not found: ${src}`);
|
||||
}
|
||||
}
|
||||
|
||||
console.log('\n--- 2. Publishing Official Release v1.0.0 on Forgejo git.chanpaca.net ---');
|
||||
|
||||
const authorization = forgejoAuthorization();
|
||||
const releasePayload = {
|
||||
tag_name: 'v1.0.0',
|
||||
target_commitish: 'main',
|
||||
name: 'D3RO Voice AI Production Release v1.0.0',
|
||||
body: `## D3RO Voice AI v1.0.0 Official Release
|
||||
|
||||
### 🚀 Major Highlights
|
||||
- **10+ Global Ad Mediation Engine**: Header bidding waterfall with EthicalAds, Carbon Ads, Google Ad Manager, Playwire, AppLovin, and Unity Ads.
|
||||
- **Free Tier Rewarded Token Refills**: Watch 15s sponsored video to gain +50 Cloud AI tokens.
|
||||
- **100% Local Whisper Large-v3-Turbo**: Complete offline speech-to-text transcription with hardware acceleration.
|
||||
|
||||
### 📦 Binary Checksums (SHA-256)
|
||||
- \`D3RO-Voice-Setup-1.0.0-x64.exe\`: \`b0ac051443151a2e34e8192f1fcf795586bbafca6eb21f01a79170c079a53ba2\` (102 MB)
|
||||
- \`D3RO-Voice-Setup-1.0.0-x64.exe.blockmap\`: \`795b7230bec047284785f480026d51b9247d8618e083d88cfda786d1894ca367\`
|
||||
`,
|
||||
draft: false,
|
||||
prerelease: false
|
||||
};
|
||||
|
||||
async function publishRelease() {
|
||||
try {
|
||||
const res = await fetch('https://git.chanpaca.net/api/v1/repos/yunchan/d3ro-voice/releases', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Authorization': authorization,
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(releasePayload)
|
||||
});
|
||||
|
||||
console.log('Forgejo Release Create HTTP Status:', res.status);
|
||||
const data = await res.json();
|
||||
if (res.status === 201 || res.status === 200) {
|
||||
console.log('🎉 Forgejo Release v1.0.0 created successfully:', data.html_url);
|
||||
} else {
|
||||
console.log('Response:', data);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to create release on Forgejo:', err);
|
||||
}
|
||||
}
|
||||
|
||||
publishRelease();
|
||||
|
|
@ -180,13 +180,10 @@ updateText('apps/web/src/components/layout/sidebar.tsx', (text) =>
|
|||
),
|
||||
)
|
||||
|
||||
// Download centers build the installer filename from these constants. They drifted
|
||||
// to 1.2.0 while the feed served newer versions, so the download button pointed at
|
||||
// an installer that does not exist. Keep both surfaces on the version SSOT.
|
||||
for (const releaseContractPath of [
|
||||
'apps/web/src/lib/desktop-release.ts',
|
||||
'site/src/release.ts',
|
||||
]) {
|
||||
// The download section (site/ only) builds the installer filename from these
|
||||
// constants. They once drifted to 1.2.0 while the feed served newer versions, so the
|
||||
// download button pointed at an installer that does not exist. Keep it on the SSOT.
|
||||
for (const releaseContractPath of ['site/src/release.ts']) {
|
||||
updateText(releaseContractPath, (text) =>
|
||||
replaceExactlyOnce(
|
||||
replaceExactlyOnce(
|
||||
|
|
|
|||
|
|
@ -1,44 +0,0 @@
|
|||
// scripts/ci/upload-asset-to-forgejo-release.mjs
|
||||
// Uploads D3RO-Voice-Setup-1.0.0-x64.exe directly to Forgejo Release v1.0.0
|
||||
|
||||
import { readFileSync, existsSync } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import credentialHelpers from '../lib/credentials.cjs';
|
||||
|
||||
const { forgejoAuthorization } = credentialHelpers;
|
||||
const authorization = forgejoAuthorization();
|
||||
const EXE_PATH = 'apps/desktop/release/1.0.0/D3RO-Voice-Setup-1.0.0-x64.exe';
|
||||
|
||||
async function uploadAsset() {
|
||||
console.log('--- Fetching release ID for v1.0.0 ---');
|
||||
const relRes = await fetch('https://git.chanpaca.net/api/v1/repos/yunchan/d3ro-voice/releases/tags/v1.0.0', {
|
||||
headers: { 'Authorization': authorization }
|
||||
});
|
||||
const relData = await relRes.json();
|
||||
console.log('Release ID:', relData.id, relData.name);
|
||||
|
||||
if (!relData.id) {
|
||||
console.error('Release not found');
|
||||
return;
|
||||
}
|
||||
|
||||
const fileBuffer = readFileSync(EXE_PATH);
|
||||
console.log(`Uploading ${EXE_PATH} (${(fileBuffer.length / (1024*1024)).toFixed(1)} MB)...`);
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('attachment', new Blob([fileBuffer]), 'D3RO-Voice-Setup-1.0.0-x64.exe');
|
||||
|
||||
const uploadRes = await fetch(`https://git.chanpaca.net/api/v1/repos/yunchan/d3ro-voice/releases/${relData.id}/assets?name=D3RO-Voice-Setup-1.0.0-x64.exe`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Authorization': authorization,
|
||||
},
|
||||
body: formData
|
||||
});
|
||||
|
||||
console.log('Upload HTTP Status:', uploadRes.status);
|
||||
const uploadData = await uploadRes.json();
|
||||
console.log('Upload Result:', uploadData);
|
||||
}
|
||||
|
||||
uploadAsset().catch(console.error);
|
||||
|
|
@ -5,11 +5,8 @@ const PACKAGE_NAME = 'com.d3ro.voice'
|
|||
const REQUIRED_RELATION = 'delegate_permission/common.handle_all_urls'
|
||||
const LIVE_URL = 'https://d3ro.chanpaca.net/.well-known/assetlinks.json'
|
||||
const COMPROMISED_SIGNER_SHA256 = '06eec757722ee7cd3dfbc53202d974aaf0417a7d397f9ef1e5611088ebb2e481'
|
||||
const SOURCE_PATHS = [
|
||||
'site/public/.well-known/assetlinks.json',
|
||||
'apps/web/public/.well-known/assetlinks.json',
|
||||
'apps/api-server/wwwroot/.well-known/assetlinks.json',
|
||||
]
|
||||
// The landing site (site/, Cloudflare Pages) is the only origin that serves assetlinks.
|
||||
const SOURCE_PATH = 'site/public/.well-known/assetlinks.json'
|
||||
const releaseIdentity = JSON.parse(
|
||||
await readFile(resolve('release/android-release-identity.json'), 'utf8'),
|
||||
)
|
||||
|
|
@ -242,19 +239,9 @@ if (expectedFingerprint && expectedFingerprint === forbiddenUploadFingerprint) {
|
|||
fail('play_and_upload_certificates_must_differ')
|
||||
}
|
||||
|
||||
const sourceEvidence = []
|
||||
for (const path of SOURCE_PATHS) {
|
||||
const document = JSON.parse(await readFile(resolve(path), 'utf8'))
|
||||
const fingerprints = fingerprintsFromDocument(document, path)
|
||||
rejectUploadCertificateAssociation(fingerprints, forbiddenUploadFingerprint, path)
|
||||
sourceEvidence.push({ path, fingerprints })
|
||||
}
|
||||
const canonicalFingerprints = sourceEvidence[0].fingerprints
|
||||
for (const evidence of sourceEvidence.slice(1)) {
|
||||
if (JSON.stringify(evidence.fingerprints) !== JSON.stringify(canonicalFingerprints)) {
|
||||
fail(`source_fingerprint_drift_${evidence.path}`)
|
||||
}
|
||||
}
|
||||
const sourceDocument = JSON.parse(await readFile(resolve(SOURCE_PATH), 'utf8'))
|
||||
const canonicalFingerprints = fingerprintsFromDocument(sourceDocument, SOURCE_PATH)
|
||||
rejectUploadCertificateAssociation(canonicalFingerprints, forbiddenUploadFingerprint, SOURCE_PATH)
|
||||
if (expectedFingerprint && !canonicalFingerprints.includes(expectedFingerprint)) {
|
||||
fail('release_certificate_missing_from_source_assetlinks')
|
||||
}
|
||||
|
|
@ -291,5 +278,5 @@ console.log(JSON.stringify({
|
|||
playConsoleAppId: releaseIdentity.playConsoleAppId,
|
||||
expectedPlayAppSigningCertificateVerified: true,
|
||||
uploadCertificateExcluded: true,
|
||||
sourcePaths: SOURCE_PATHS,
|
||||
sourcePath: SOURCE_PATH,
|
||||
}, null, 2))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue