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:
Yun Chan 2026-09-26 15:48:52 +09:00
parent b6fe588a7c
commit cd9d199dbf
53 changed files with 43 additions and 3278 deletions

View file

@ -1,61 +0,0 @@
// scripts/capture-download-and-release-hub.js
const { chromium } = require('@playwright/test');
const path = require('path');
const fs = require('fs');
const http = require('http');
const OUTPUT_DIR = 'C:/Users/encep/.gemini/antigravity-cli/brain/3ab7ae82-5634-41d5-93a7-3c12c22503e2/screenshots/download_center';
function serveStatic(dir) {
return new Promise((resolve) => {
const server = http.createServer((req, res) => {
let reqPath = req.url.split('?')[0];
if (reqPath === '/' || reqPath === '') reqPath = '/download.html';
const filePath = path.join(dir, reqPath);
if (fs.existsSync(filePath) && fs.statSync(filePath).isFile()) {
const ext = path.extname(filePath).toLowerCase();
const mime = { '.html': 'text/html', '.js': 'application/javascript', '.css': 'text/css', '.svg': 'image/svg+xml' };
res.writeHead(200, { 'Content-Type': mime[ext] || 'application/octet-stream' });
fs.createReadStream(filePath).pipe(res);
} else {
res.writeHead(404);
res.end('Not Found');
}
});
server.listen(0, '127.0.0.1', () => {
const port = server.address().port;
resolve({ server, port });
});
});
}
async function capture() {
if (!fs.existsSync(OUTPUT_DIR)) fs.mkdirSync(OUTPUT_DIR, { recursive: true });
const sitePublicDir = path.resolve(__dirname, '../site/public');
const { server, port } = await serveStatic(sitePublicDir);
const browser = await chromium.launch({ channel: 'msedge', headless: true });
const context = await browser.newContext({
viewport: { width: 1440, height: 960 },
deviceScaleFactor: 2,
});
const page = await context.newPage();
console.log(`Navigating to http://127.0.0.1:${port}/download.html...`);
await page.goto(`http://127.0.0.1:${port}/download.html`, { waitUntil: 'networkidle' });
await page.waitForTimeout(1500);
const shot1 = path.join(OUTPUT_DIR, '01_download_center_hero_desktop.png');
await page.screenshot({ path: shot1, fullPage: false });
console.log('Saved:', shot1);
const shotFull = path.join(OUTPUT_DIR, '02_download_center_full_page.png');
await page.screenshot({ path: shotFull, fullPage: true });
console.log('Saved:', shotFull);
await browser.close();
server.close();
}
capture().catch(console.error);

View file

@ -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();

View file

@ -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(

View file

@ -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);

View file

@ -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))

View file

@ -1,88 +0,0 @@
// scripts/deploy-site-to-nas.js
const { spawnSync } = require('child_process');
const path = require('path');
const fs = require('fs');
const MOBILE_RELEASE_PATTERN = /(?:\.apk|\.aab|android[^/\\]*\.zip|signed[^/\\]*\.zip)$/i;
const MOBILE_DOWNLOAD_REFERENCE = /(?:d3ro-voice[^"']*\.apk|git\.chanpaca\.net\/attachments\/(?:0b015367-dd8b-488c-8cc0-4db413b51792|d2e1b123-5678-496a-bf74-bc188938c999))/i;
function assertNoMobileArtifacts(root) {
if (!fs.existsSync(root)) return;
const pending = [root];
while (pending.length > 0) {
const current = pending.pop();
for (const entry of fs.readdirSync(current, { withFileTypes: true })) {
const candidate = path.join(current, entry.name);
if (entry.isSymbolicLink()) throw new Error(`Refusing symlink in deploy tree: ${candidate}`);
if (entry.isDirectory()) pending.push(candidate);
if (entry.isFile() && MOBILE_RELEASE_PATTERN.test(entry.name)) {
throw new Error(`Unsealed mobile artifact blocked from NAS deploy: ${candidate}`);
}
if (entry.isFile() && /\.(?:html|js|json)$/i.test(entry.name)) {
const source = fs.readFileSync(candidate, 'utf8');
if (MOBILE_DOWNLOAD_REFERENCE.test(source)) {
throw new Error(`Legacy mobile download link blocked from NAS deploy: ${candidate}`);
}
}
}
}
}
async function deploy() {
assertNoMobileArtifacts(path.resolve(__dirname, '../site/dist'));
console.log('=== 1. Building Site ===');
const build = spawnSync('npm', ['run', 'build', '--prefix', 'site'], { stdio: 'inherit', shell: true });
if (build.status !== 0) throw new Error('Site build failed');
assertNoMobileArtifacts(path.resolve(__dirname, '../site/dist'));
console.log('=== 2. Creating tar archive of site/dist ===');
const tarPath = path.resolve(__dirname, '../out/site-dist.tar');
if (!fs.existsSync(path.dirname(tarPath))) fs.mkdirSync(path.dirname(tarPath), { recursive: true });
// Use tar to create archive
const tarRes = spawnSync('tar', ['-cf', tarPath, '-C', 'site/dist', '.'], { stdio: 'inherit', shell: true });
if (tarRes.status !== 0) throw new Error('Tar creation failed');
console.log(`Created archive: ${tarPath} (${(fs.statSync(tarPath).size / 1024 / 1024).toFixed(2)} MB)`);
console.log('=== 3. Uploading archive to Synology NAS via SCP ===');
const scpRes = spawnSync('scp', [
'-o', 'StrictHostKeyChecking=no',
tarPath,
'yunchan@192.168.0.39:/volume1/docker/d3ro/site-dist.tar'
], { stdio: 'inherit', shell: true });
if (scpRes.status !== 0) throw new Error('SCP upload failed');
console.log('=== 4. Extracting on NAS and applying to d3ro_voice_api container ===');
const sshCmd = `
mkdir -p /volume1/docker/d3ro/wwwroot &&
tar -xf /volume1/docker/d3ro/site-dist.tar -C /volume1/docker/d3ro/wwwroot &&
docker cp /volume1/docker/d3ro/wwwroot/. d3ro_voice_api:/app/wwwroot/ &&
docker exec d3ro_voice_api ls -la /app/wwwroot &&
docker exec d3ro_voice_api find /app/wwwroot -type f \( -name '*.apk' -o -name '*.aab' \) -print -quit | grep -q . && exit 1 || true
`;
const sshRes = spawnSync('ssh', [
'-o', 'StrictHostKeyChecking=no',
'yunchan@192.168.0.39',
sshCmd
], { stdio: 'inherit', shell: true });
if (sshRes.status !== 0) throw new Error('SSH extract failed');
console.log('=== 5. Updating docker-compose.yml on NAS for persistent mount ===');
const updateComposeCmd = `
sed -i 's|- /volume1/docker/d3ro/data:/app/data|- /volume1/docker/d3ro/data:/app/data\\n - /volume1/docker/d3ro/wwwroot:/app/wwwroot|g' /volume1/docker/d3ro/docker-compose.yml || true
`;
spawnSync('ssh', ['-o', 'StrictHostKeyChecking=no', 'yunchan@192.168.0.39', updateComposeCmd], { stdio: 'inherit', shell: true });
console.log('✓ Successfully deployed site and releases to NAS!');
}
module.exports = { assertNoMobileArtifacts };
if (require.main === module) {
deploy().catch((error) => {
console.error(error);
process.exitCode = 1;
});
}

View file

@ -1,234 +0,0 @@
// scripts/verify-e2e-downloads-and-releases.js
// Comprehensive End-to-End Test for D3RO Voice Download Center, Binary Delivery, and Release Hub
const { chromium } = require('@playwright/test');
const path = require('path');
const fs = require('fs');
const http = require('http');
const crypto = require('crypto');
const {
forgejoAuthorization,
forgejoLogin,
} = require('./lib/credentials.cjs');
const OUTPUT_DIR = 'C:/Users/encep/.gemini/antigravity-cli/brain/3ab7ae82-5634-41d5-93a7-3c12c22503e2/screenshots/e2e_verification';
const EXPECTED_HASH = 'b0ac051443151a2e34e8192f1fcf795586bbafca6eb21f01a79170c079a53ba2';
function serveStatic(dir) {
return new Promise((resolve) => {
const server = http.createServer((req, res) => {
let reqPath = req.url.split('?')[0];
if (reqPath === '/' || reqPath === '') reqPath = '/index.html';
const filePath = path.join(dir, reqPath);
if (fs.existsSync(filePath) && fs.statSync(filePath).isFile()) {
const ext = path.extname(filePath).toLowerCase();
const mime = {
'.html': 'text/html',
'.js': 'application/javascript',
'.css': 'text/css',
'.svg': 'image/svg+xml',
'.exe': 'application/vnd.microsoft.portable-executable',
'.blockmap': 'application/octet-stream',
'.yml': 'text/yaml'
};
const stat = fs.statSync(filePath);
res.writeHead(200, {
'Content-Type': mime[ext] || 'application/octet-stream',
'Content-Length': stat.size
});
fs.createReadStream(filePath).pipe(res);
} else {
res.writeHead(404);
res.end('Not Found: ' + reqPath);
}
});
server.listen(0, '127.0.0.1', () => {
const port = server.address().port;
resolve({ server, port });
});
});
}
async function runE2E() {
const { username, password } = forgejoLogin();
if (!fs.existsSync(OUTPUT_DIR)) fs.mkdirSync(OUTPUT_DIR, { recursive: true });
const testResults = {
landingPageButtons: false,
downloadPageLoaded: false,
directBinaryDownload200: false,
sha256HashMatch: false,
forgejoReleaseVerified: false,
clientSideVerifierWorks: false,
evidenceScreenshots: []
};
console.log('========================================================');
console.log('🚀 STARTING RIGOROUS E2E VERIFICATION FOR D3RO VOICE');
console.log('========================================================\n');
// 1. Start static server serving site/dist (with public releases synced)
const siteDistDir = path.resolve(__dirname, '../site/dist');
const { server, port } = await serveStatic(siteDistDir);
const baseUrl = `http://127.0.0.1:${port}`;
console.log(`[TEST 1] Static Web Server started on ${baseUrl}`);
const browser = await chromium.launch({ channel: 'msedge', headless: true });
const context = await browser.newContext({
viewport: { width: 1440, height: 960 },
deviceScaleFactor: 2,
acceptDownloads: true
});
const page = await context.newPage();
// Test 1: Landing Page Download Buttons
console.log('\n[TEST 2] Verifying Landing Page Download CTA buttons...');
await page.goto(baseUrl, { waitUntil: 'networkidle' });
await page.waitForTimeout(1000);
const heroBtnHref = await page.getAttribute('a.glow-btn', 'href');
console.log(' -> Hero download button href:', heroBtnHref);
if (heroBtnHref === '/download.html' || heroBtnHref.includes('download')) {
testResults.landingPageButtons = true;
console.log(' ✓ PASS: Landing page button correctly targets /download.html (no github 404 placeholder)');
} else {
console.error(' ❌ FAIL: Invalid href:', heroBtnHref);
}
const landingShot = path.join(OUTPUT_DIR, '01_landing_page_verified.png');
await page.screenshot({ path: landingShot });
testResults.evidenceScreenshots.push(landingShot);
// Test 2: Navigate to Download Page & Inspect Auto-OS Detection
console.log('\n[TEST 3] Loading Download Center Page (/download.html)...');
await page.goto(`${baseUrl}/download.html`, { waitUntil: 'networkidle' });
await page.waitForTimeout(1500);
const osTitle = await page.textContent('#detectedOsTitle');
const downloadBtnText = await page.textContent('#downloadBtnText');
console.log(' -> Detected OS Title:', osTitle);
console.log(' -> Primary Action Button:', downloadBtnText);
if (osTitle.includes('Windows') && downloadBtnText.includes('Windows')) {
testResults.downloadPageLoaded = true;
console.log(' ✓ PASS: Auto-OS detection correctly identified Windows environment and rendered verified button');
}
const dlCenterShot = path.join(OUTPUT_DIR, '02_download_center_verified.png');
await page.screenshot({ path: dlCenterShot });
testResults.evidenceScreenshots.push(dlCenterShot);
// Test 3: Trigger real binary download & calculate byte-level SHA-256
console.log('\n[TEST 4] Triggering live binary download for D3RO-Voice-Setup-1.0.0-x64.exe...');
const [download] = await Promise.all([
page.waitForEvent('download'),
page.click('#primaryDownloadBtn')
]);
const downloadPath = path.join(OUTPUT_DIR, 'downloaded_installer_test.exe');
await download.saveAs(downloadPath);
const downloadedStat = fs.statSync(downloadPath);
const downloadedSizeMb = (downloadedStat.size / (1024 * 1024)).toFixed(2);
console.log(` -> Downloaded binary size: ${downloadedStat.size} bytes (${downloadedSizeMb} MB)`);
if (downloadedStat.size > 100 * 1024 * 1024) {
testResults.directBinaryDownload200 = true;
console.log(' ✓ PASS: Binary downloaded successfully via HTTP 200 (>100MB complete installer payload)');
} else {
console.error(' ❌ FAIL: Download size unexpectedly small:', downloadedStat.size);
}
// Verify SHA-256 hash of downloaded file
const fileBuffer = fs.readFileSync(downloadPath);
const calculatedHash = crypto.createHash('sha256').update(fileBuffer).digest('hex');
console.log(' -> Calculated SHA-256:', calculatedHash);
console.log(' -> Expected SHA-256: ', EXPECTED_HASH);
if (calculatedHash === EXPECTED_HASH) {
testResults.sha256HashMatch = true;
console.log(' ✓ PASS: Binary integrity 100% MATCH! Zero corruption or tampering.');
} else {
console.error(' ❌ FAIL: Hash mismatch!');
}
// Test 4: Live Client-Side Hash Verifier Simulation on the page
console.log('\n[TEST 5] Testing Client-Side WebCrypto Drag & Drop Verifier Widget...');
await page.setInputFiles('#fileVerifierInput', downloadPath);
await page.waitForTimeout(3000); // Allow WebCrypto subtle digest to compute
const verifyBadgeText = await page.textContent('#verifyBadge');
console.log(' -> Verifier Badge Output:', verifyBadgeText);
if (verifyBadgeText.includes('정상') || verifyBadgeText.includes('OFFICIAL MATCH')) {
testResults.clientSideVerifierWorks = true;
console.log(' ✓ PASS: Client-side UI verified binary with green check badge!');
}
const verifierShot = path.join(OUTPUT_DIR, '03_client_verifier_passed.png');
await page.screenshot({ path: verifierShot });
testResults.evidenceScreenshots.push(verifierShot);
// Test 5: Verify Remote Forgejo Git Server (https://git.chanpaca.net/yunchan/d3ro-voice/releases)
console.log('\n[TEST 6] Verifying Live Remote Forgejo Git Server (git.chanpaca.net)...');
try {
const authorization = forgejoAuthorization();
const apiRes = await fetch('https://git.chanpaca.net/api/v1/repos/yunchan/d3ro-voice/releases/tags/v1.0.0', {
headers: { 'Authorization': authorization }
});
console.log(' -> Forgejo Release API Status:', apiRes.status);
if (apiRes.status === 200) {
const rel = await apiRes.json();
console.log(` -> Release Name: "${rel.name}", Tag: "${rel.tag_name}"`);
console.log(` -> Total Assets Attached: ${rel.assets.length}`);
if (rel.assets.length > 0) {
console.log(` -> Asset: ${rel.assets[0].name} (${(rel.assets[0].size / (1024*1024)).toFixed(1)} MB)`);
console.log(` -> Asset Download URL: ${rel.assets[0].browser_download_url}`);
testResults.forgejoReleaseVerified = true;
console.log(' ✓ PASS: Forgejo remote server release v1.0.0 is live with downloadable installer attached!');
}
}
} catch (err) {
console.error('Remote check error:', err);
}
// Capture Forgejo Release Page
console.log('\n[TEST 7] Capturing Live Forgejo Release UI...');
try {
await page.goto('https://git.chanpaca.net/user/login', { waitUntil: 'networkidle', timeout: 20000 });
await page.fill('input[name="user_name"]', username);
await page.fill('input[name="password"]', password);
await page.click('button[type="submit"]');
await page.waitForTimeout(3000);
await page.goto('https://git.chanpaca.net/yunchan/d3ro-voice/releases', { waitUntil: 'networkidle', timeout: 20000 });
await page.waitForTimeout(2000);
const forgejoShot = path.join(OUTPUT_DIR, '04_forgejo_releases_verified.png');
await page.screenshot({ path: forgejoShot, fullPage: true });
testResults.evidenceScreenshots.push(forgejoShot);
console.log(' ✓ Saved Forgejo Releases Screenshot:', forgejoShot);
} catch (e) {
console.warn('Forgejo UI capture warning:', e.message);
}
// Cleanup
fs.unlinkSync(downloadPath);
await browser.close();
server.close();
console.log('\n========================================================');
console.log('📊 FINAL E2E AUDIT SCORECARD:');
console.log('========================================================');
console.log('1. Landing Page Download Links: ', testResults.landingPageButtons ? '✅ 100% PASSED' : '❌ FAILED');
console.log('2. Download Center Rendering: ', testResults.downloadPageLoaded ? '✅ 100% PASSED' : '❌ FAILED');
console.log('3. Direct 102MB Binary Download: ', testResults.directBinaryDownload200 ? '✅ 100% PASSED' : '❌ FAILED');
console.log('4. SHA-256 Hash Integrity Match: ', testResults.sha256HashMatch ? '✅ 100% PASSED' : '❌ FAILED');
console.log('5. Client WebCrypto Verifier: ', testResults.clientSideVerifierWorks ? '✅ 100% PASSED' : '❌ FAILED');
console.log('6. Remote Forgejo Git v1.0.0 Asset:', testResults.forgejoReleaseVerified ? '✅ 100% PASSED' : '❌ FAILED');
console.log('========================================================\n');
fs.writeFileSync(path.join(OUTPUT_DIR, 'e2e_results.json'), JSON.stringify(testResults, null, 2));
}
runE2E().catch(console.error);