Implement improvements for graceful shutdown, error handling, and session limits#22
Merged
Implement improvements for graceful shutdown, error handling, and session limits#22
Conversation
- Add graceful shutdown with signal handling in main.go - Add structured APIError type in srv/errors.go - Add database indexes for query performance (migration 004) - Add CloseDB method to Server for clean shutdown - Add jsonAPIErr helper for typed error responses
- Add aria-label to password/notes toggle buttons for accessibility - Add aria-label to OTP display toggle button - Add srv/errors_test.go for APIError type unit tests - Update IMPROVEMENT.md progress
- Add login_time and last_activity columns to users table - Hard limit: 30 min (configurable via SESSION_DURATION_MINUTES) - Soft limit: 5 min (browser close detection) - Session limits checked on each authenticated request - Updated config display to show hard/soft limits
- Add SESSION_SOFTLIMIT_MINUTES env var (default: 5, range: 1-60) - Rename SESSION_DURATION_MINUTES to SESSION_HARDLIMIT_MINUTES - Rename internal variable sessionDuration to hardLimit - Update all documentation to reflect new env var names
Store .gpg-id in users.gpg_id (single source of truth): - Add gpg_id column to users table via migration 006-users-gpg-id.sql - Auto-initialize gpg_id to fingerprint on account creation - Push: write .gpg-id from users.gpg_id (fallback to fingerprint) - Pull: update users.gpg_id from remote .gpg-id if present - Backfill existing accounts with fingerprint as default Also add frontend unit tests: - crypto.test.ts: 26 tests for PGP key ops, AES-GCM, base64, PAT encrypt - storage.test.ts: 20 tests for IndexedDB CRUD, AES encrypt/decrypt - Fix api.test.ts: add explicit vitest imports and document mock Install fake-indexeddb dev dependency for IndexedDB testing in jsdom.
- Switch vitest environment from jsdom to node to fix openpgp.js concatUint8Array error caused by cross-realm Uint8Array in jsdom - Remove unused jsonAPIErr function to fix golangci-lint unused error
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.
Description
Related Issue
Fixes # (issue)
Motivation and Context
How Has This Been Tested?
go test ./...cd frontend && npm testmake lintScreenshots (if appropriate):
Types of changes
Checklist