Skip to content

Harden the app, make String it reachable and undoable, cut dead code - #253

Merged
rouges78 merged 3 commits into
mainfrom
audit-fixes
Nov 25, 2026
Merged

rouges78 merged 3 commits into
mainfrom
audit-fixes

Conversation

@rouges78

@rouges78 rouges78 commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to an audit of the whole project. It covers the security and reliability fixes, makes the one-click String it flow reachable and undoable, and removes dead pages, modules and dependencies.

#252 is merged into main; this PR now contains only the audit commit 224c5354.

Security and reliability

  • Community sign-in: each profile now has a random secret, stored in the encrypted secure store. It replaces the deterministic gs_community_<id>_!Str1ng3r password. Existing accounts sign in once with the old password, rotate to the new secret, and never use the old one again. Limit: a profile used on two PCs keeps working only on the first one that rotates.

  • RLS: supabase/migrations/20261125120000_tighten_update_policies.sql restricts every remaining UPDATE … USING (true) policy to the row owner. The base schema files are updated to match. It is not applied to the live project yet.

  • path_guard.rs: save_binary_file, write_text_file, ensure_directory, save_file_with_backup, secure_delete_file and launch_game_direct reject:

    • system and autostart folders;
    • script and shortcut types;
    • relative paths and ..;
    • anything that is not an .exe (launch only).

    secure_delete_directory is no longer registered.

  • CSP: 'unsafe-eval' is replaced by 'wasm-unsafe-eval'. The old policy is kept as devCsp. JS plugins (new Function) are now refused with an explicit message. They used to run with full Tauri access.

  • Logs: in release builds both the Rust log and frontend warnings now go to %LOCALAPPDATA%\GameStringer\logs\gamestringer.log, rotated at 5 MB. Before, both were lost: println! with no console, and POSTs to a missing /api/logs.

  • Profiles: the path is absolute instead of "profiles" relative to the working directory, and the existing data location is reused.

  • Downloads: BepInEx, XUnity, IPA, TMP fonts, repak, retoc and UABEA are verified against pinned SHA-256 hashes or GitHub digest values. OllamaSetup.exe must carry a valid Ollama Authenticode signature. UABEA extraction uses enclosed_name() (zip-slip).

String it

  • Restore: new string_it_restore / string_it_restore_probe commands undo every method from its own backups: Unreal, Unity static, Ren'Py, RPG Maker, Visionaire, Tyrano, Danganronpa, Hendrix, GameMaker and the generic workflow. XUnity is reported as manual, because nothing marks BepInEx as ours.
  • Library: String it is always visible and keyboard reachable. It starts the run once the plan is ready; before, it only highlighted the button.
  • Home: lists the installed games, each with String it, instead of the RSS feed.
  • Game detail:
    • the chain presets, backend pickers and index button sit behind "Advanced options";
    • the button uses .glass-red with translated labels;
    • a persistent result panel records the run's messages and holds the restore button.
  • Routing: engine routing rules moved to lib/string-it/route.ts, with tests. The handler's duplicated list is gone.
  • docs/BANCO-STRING-IT.md: a per-game outcome log of what was seen on screen.

Cleanup

  • Pages and files removed:
    • pages: /translation-wizard, /batch, /batch-translation, /ai-pipeline, /unity-ink-translator;
    • all app/api stubs, middleware.ts and Prisma (schema, scripts, postinstall).
  • Dead code: 114 modules that production code never imported, and 891 i18n keys only they read, removed in all 12 locales.
  • Dependencies dropped: recharts, webpack, archiver, winreg, steam-locate, vdf-parser, @prisma/client, prisma, anyhow, interprocess. The deploy-only packages moved to devDependencies.
  • Untracked: the 1.4.0 .msi/.zip, native/build/, the debug .exe/.pdb, reports, and patches/decarnation/dialogues-original-backup.txt (original game text). .gitignore is updated.
  • Copy:
    • the tray reads the real version (it said 1.9.1);
    • superlatives are gone;
    • the README download table is updated to 1.17.0, and Windows-only features are stated.
  • Sidebar: six core entries (Home, Library, Projects, Editor, Settings, Guide); advanced tools, engine patchers and resources sit in collapsed groups.

Checks

  • npm run typecheck: clean.
  • Vitest: 120 files, 1144 passed.
  • cargo check: 0 errors.
  • New Rust tests pass: path_guard, download_verify, string_it_restore.
  • Guard scripts pass: dead:check, i18n:check, deps:check, tauri:check-cmds, a11y:check. Their baselines are updated because the counts went down.

For the reviewer

  • Not run in the app. The new home, library button, Advanced section, result panel and restore button were not checked in tauri:dev or on a real game.
  • Owner action: apply the SQL migration to the live Supabase project.
  • Upstream releases: when repak or UABEA publish a new release, the /latest download is rejected until the pinned hash is updated. Both fall back to the pinned version.
  • Not in this PR:
    • merging /auto-translate into String it (it still backs "Resume" for background jobs and Projects);
    • about 400 Rust commands that are never invoked;
    • the notifications subsystem;
    • a user-facing changelog.

🤖 Generated with Claude Code

rouges78 and others added 3 commits November 25, 2026 20:34
Security and reliability
- Community sign-in uses a random per-profile secret kept in the secure
  store; existing accounts rotate off the deterministic password on first
  sync. New migration tightens UPDATE policies to row owners (not yet
  applied to the live project).
- path_guard: file write/delete and game launch commands refuse system
  and autostart folders, script/shortcut types, relative and ".." paths.
  secure_delete_directory is no longer exposed to the webview.
- CSP drops 'unsafe-eval' (kept in devCsp); JS plugins now fail with a
  clear message instead of running with full Tauri access.
- Release logs go to %LOCALAPPDATA%\GameStringer\logs (Rust and frontend
  warnings); before, both were lost in the packaged app.
- Profile storage uses an absolute path instead of one relative to the
  working directory, keeping data written by the old path.
- Third-party downloads are checked against pinned SHA-256 or GitHub
  digests; OllamaSetup.exe must carry a valid Ollama signature. UABEA
  extraction rejects zip-slip entries.

String it
- New string_it_restore / string_it_restore_probe commands undo what each
  method wrote, using its own backups; XUnity is reported as manual.
- Library: String it is always visible, keyboard reachable, and starts the
  run once the plan is ready. Home lists installed games instead of news.
- Game detail: technical pickers behind "Advanced options", a persistent
  result panel with the restore button, translated labels.
- Engine routing rules moved to lib/string-it/route.ts with tests.
- docs/BANCO-STRING-IT.md tracks per-game outcomes seen on screen.

Cleanup
- Remove /translation-wizard, /batch, /batch-translation, /ai-pipeline,
  /unity-ink-translator, the app/api stubs, middleware.ts and Prisma.
- Remove 114 unreachable modules and the i18n keys only they used.
- Drop unused dependencies (recharts, webpack, archiver, winreg,
  steam-locate, vdf-parser, anyhow, interprocess); deploy-only packages
  move to devDependencies.
- Untrack build outputs, old installers, debug binaries and a dump of
  original game dialogue.
- Tray shows the real app version; README download table updated and
  Windows-only features stated; sidebar reduced to six core entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Layers and Workflow in the command palette and FolderTree in the tools
registry only served the /batch, /batch-translation and /ai-pipeline
entries removed in the previous commit; ESLint failed CI on them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rouges78
rouges78 enabled auto-merge (squash) November 25, 2026 19:44
@rouges78
rouges78 merged commit 679baaa into main Nov 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant