Repository navigation
Production readiness: crash logging, startup resilience, proxy hardening, release gates - #8
Merged
Merged
Conversation
- Log uncaught errors to ~/Library/Logs/dbscope/dbscope.log and show a placeholder instead of a grey box for a widget that throws in release. - Skip unreadable saved tabs and profiles instead of failing startup; write unreadable profiles back unchanged. - Cap each quit step at 3 s so a dead socket can't hang Quit. - pg proxy: survive malformed messages and failed upgrades, reject WebSocket upgrades from foreign Origins by default, compare the shared secret in constant time, ping idle sockets, validate --port. - PG Proxy connections enforce read-only mode in the database. - New remote connections default to SSL mode require. - Connection link export needs a 10+ character passphrase. - Self-update verifies the Developer ID team and times out stalled downloads. - Security headers on Firebase Hosting. - Release and web deploy run analyze + tests; release input passed via env. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EqzDdXBJbvRKgCoHNEN8vG
robertsolves
changed the base branch from
claude/project-thread-sroiel
to
main
November 3, 2026 09:25
- dbscope_pg_proxy: --allow-db-host limits which databases a client may open; --max-rows (default 100000) caps each result and flags it truncated. - File > Show crash log opens the folder holding dbscope.log (desktop). - Note why the proxy shared secret stays in the profile, not the keychain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EqzDdXBJbvRKgCoHNEN8vG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Robert · project thread
What & why
This PR targets
mainand includes #5 and #6, which are already merged. It doesn't conflict with #7 (welcome dialog) or #9 (orange theme): the crash-log menu item goes under File through a menu contribution, so it can't collide with #7's new Help menu.I audited the app for things that would hurt real users: security, crash paths, validation, error handling, packaging and CI. Areas the earlier bug sweeps already covered, like the SQL fencing and the AI write-keyword scan, were checked and left alone.
Findings, all fixed here
FlutterError.onErrororPlatformDispatcher.onError, so a release build left nothing behind, and a widget that threw while building painted a grey box.installErrorHandlers(lib/util/error_reporting.dart) runs in every isolate. Errors go to the console and to~/Library/Logs/dbscope/dbscope.log, which rotates at 1 MB. Release builds show a short placeholder that names the log. File ▸ Show crash log opens the log's folder.restorePersistedTabsruns beforerunApp, and a hardas String?cast on a malformed entry threw.ProfileStore.loadthrew, the picker came up empty, and the next save would have dropped the entry.disconnectAllwith no bound, so a dead socket meant the app never quit.{"type":"open","port":"x"}) threw inside an unawaited session, which killed the proxy for every client. A failed upgrade did the same.--allow-origin(the default), any web page the user opened could reachws://127.0.0.1:8765and from there any Postgres on their network.--allow-originis now repeatable and replaces the defaults.--allow-any-originis an explicit opt-out. Checked live: a foreign Origin gets a 403.SELECT *could exhaust memory.--allow-db-host host[:port](repeatable) pins which databases a client may open.--max-rows(default 100000) caps each result, and a capped reply carries"truncated": true. Checked live.!=, dead peers were never dropped, and a bad--portcrashed with a raw stack trace.--portis validated.setReadOnlywas a no-op, so a profile marked read-only still accepted writes.SET default_transaction_read_only, the same as a direct connection. Checked live through the proxy:CREATE TABLEfails with 25006.disableeven for remote hosts.suggestSslMode:disablefor localhost andrequirefor anything else. The default follows the host field until the user picks a mode. Tested..dbscopeconnfile contains the database password but could be exported with a 1-character passphrase.codesign --verify --deep --strictand be signed by the same Developer ID team. Downloads time out after 30 s for metadata and 10 min for the zip.X-Frame-Options/frame-ancestors 'none',nosniff, HSTS,Referrer-PolicyandPermissions-Policy.v*tag and every web deploy built and shipped without running analyze or tests.release.ymlandweb.ymlnow runflutter analyzeandflutter teston the exact commit they ship.${{ inputs.version }}was spliced straight into a shell script inrelease.yml.Decided against
profile_dialog.dart.Still open (in
TODO.md)disable-library-validationinRelease.entitlementsis still needed. That needs a signed build and a Mac.How it was tested
fvm flutter analyzeis clean, andfvm flutter testpasses 309 tests. The newtest/production_readiness_test.dartcovers the SSL default and tab restore; I checked that the restore test fails against the old code.actionlintwasn't run either, because it couldn't be installed here.Checklist
fvm flutter analyzeis cleanfvm flutter testpassesCLAUDE.mdstill hold (quoted identifiers, parameterised values).dbscopeconnfiles in the diff🤖 Generated with Claude Code
https://claude.ai/code/session_01EqzDdXBJbvRKgCoHNEN8vG