b08d76a986
Security: - S1 (backup.ts): require explicit confirmation before enabling custom-command templates from a backup file; import templates in a disabled state if declined - S2 (cookies.ts): deny non-http/https popups in cookie login window, matching the main window's setWindowOpenHandler defence - S3 (download.ts): main-process concurrency cap — startDownload now rejects spawns when active.size >= maxConcurrent (defence-in-depth; renderer already enforces this but should not be the only gate) - S4 (settings.ts, validation.ts): reject filenameTemplate values containing path traversal (.. segments or absolute paths); validate outputDir is absolute - S5 (history.ts, errorlog.ts, templates.ts, validation.ts): per-field validation on JSON reads — invalid entries dropped rather than blindly trusted Performance: - P1 (settings.ts): getSettings() now only writes to disk when sanitization actually changed a value; removes synchronous file I/O on every hot-path read - P2 (ipc.ts, download.ts, downloads.ts): renderer forwards its pre-probed metadata (title/channel/duration) via StartDownloadOptions.meta; main uses it directly instead of spawning a redundant second yt-dlp probe Maintainability: - M1 (log.ts, download.ts, probe.ts): extract duplicated cleanError() to src/main/log.ts; both callers import from the shared module - M2 (buildArgs.ts): document parseExtraArgs escape-sequence limitations - M3 (electron-builder.yml): clarify icon TODO as a pre-release action - P3 (downloads.ts): document that lowering maxConcurrent mid-flight does not pause active downloads (intended behaviour, now written down) Tests: - Add test/validation.test.ts covering isSafeFilenameTemplate, isSafeOutputDir, isValidHistoryEntry, isValidErrorLogEntry, isTemplateLike (76 tests pass) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
62 lines
2.2 KiB
YAML
62 lines
2.2 KiB
YAML
appId: com.aerofetch.app
|
||
productName: AeroFetch
|
||
copyright: yt-dlp frontend
|
||
|
||
# Lets a browser/another app hand AeroFetch a link via aerofetch://download?url=<encoded>
|
||
# (src/main/deeplink.ts) — the closest Windows analog to Android's share-to-app intent.
|
||
# The NSIS installer registers this at install time; main/index.ts's
|
||
# app.setAsDefaultProtocolClient call additionally covers the portable build and dev.
|
||
protocols:
|
||
- name: AeroFetch
|
||
schemes:
|
||
- aerofetch
|
||
|
||
directories:
|
||
buildResources: build
|
||
output: dist
|
||
|
||
files:
|
||
- '!**/.vscode/*'
|
||
- '!src/*'
|
||
- '!electron.vite.config.{js,ts,mjs,cjs}'
|
||
- '!{.eslintignore,.eslintrc.cjs,.eslintrc.js,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
|
||
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml,package-lock.json}'
|
||
- '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json,tsconfig.tsbuildinfo}'
|
||
|
||
# yt-dlp.exe + ffmpeg.exe ship outside the asar archive so they can be spawned
|
||
# directly. They land in <install>/resources/bin, reachable via process.resourcesPath.
|
||
extraResources:
|
||
- from: resources/bin
|
||
to: bin
|
||
filter:
|
||
- '**/*'
|
||
|
||
win:
|
||
# Two artifacts:
|
||
# - nsis → regular installer (Start-menu shortcut + uninstaller). Per-user
|
||
# (installs to %LOCALAPPDATA%), so it needs NO admin rights.
|
||
# - portable → single self-contained .exe. No install, no admin; runs from a
|
||
# USB stick / Downloads folder on a locked-down public PC.
|
||
target:
|
||
- nsis
|
||
- portable
|
||
# Never request admin elevation.
|
||
requestedExecutionLevel: asInvoker
|
||
# TODO(release, audit M3): drop a 256×256 (multi-size) build/icon.ico in place
|
||
# and uncomment the next line before cutting v1.0. Until then electron-builder
|
||
# falls back to its default Electron icon, which is fine for dev/test builds.
|
||
# icon: build/icon.ico
|
||
|
||
portable:
|
||
artifactName: ${productName}-${version}-portable.${ext}
|
||
# Fixed extraction dir name so repeated launches reuse it instead of re-extracting.
|
||
unpackDirName: AeroFetch
|
||
requestExecutionLevel: user
|
||
|
||
nsis:
|
||
oneClick: false
|
||
perMachine: false
|
||
allowToChangeInstallationDirectory: true
|
||
deleteAppDataOnUninstall: false
|
||
# Flip perMachine to true for an all-users install to Program Files (requires admin).
|