13 Commits

Author SHA1 Message Date
a6a4ffdf7c Merge pull request 'Fix startup crashes and harden crypto' (#12) from improve/v1 into main
Some checks are pending
CI / lint (push) Waiting to run
CI / test (push) Waiting to run
CI / docker-build (push) Waiting to run
CI / security (push) Waiting to run
CI / build-result (push) Blocked by required conditions
Reviewed-on: https://git.example.com/jarianc/PinVault/pulls/12
2026-08-20 18:07:06 -05:00
cc401011f7 Add .dockerignore to slim build context 2026-08-20 23:04:28 +00:00
a69c40bc84 Fix startup crashes and harden crypto
- Define missing dict_factory (orphaned fragment left app unable to
  return DB rows; every endpoint crashed on first query)
- Skip backup when PINVAULT_NAS_BACKUP_DIR is empty (os.makedirs('')
  raised in bootstrap and killed gunicorn at import; compose default)
- Generate PINs with secrets.randbelow instead of random.randint
- Per-row random HMAC salts for PINs and recovery codes (single shared
  hardcoded salt defeated the precomputation protection); constant-time
  comparisons; legacy rows keep the historic salt
- Atomic backup restore (temp file + os.replace) to avoid torn DB
- Validate lock_days type, guard backup loop, move re import to module
  level
- Replace weak unittest stubs with 34-test pytest suite (sqlcipher
  shimmed with sqlite3 so tests run without the native lib)
- Add README, LICENSE, pyproject, .env.example; ruff clean
2026-08-20 22:52:28 +00:00
133f5b3c70 Merge pull request 'Fix PBKDF2 key derivation (#5), HMAC recovery codes (#4), HSTS (#8)' (#11) from fix/security-hardening into main 2026-07-04 23:28:27 -05:00
7e85cb1acd fix: PBKDF2 key derivation (#5), HMAC salted recovery codes (#4), HSTS (#8)
- SQLCipher key: SHA256 -> PBKDF2-HMAC-SHA256 with 100k iterations
- Recovery code hashing: SHA256 -> HMAC-SHA256 with salt
- Add Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, CSP headers
2026-07-05 04:28:15 +00:00
453c1bba18 Merge pull request 'CI: remove --no-cache for docker layer caching' (#10) from ci-fix-nocache into main
Reviewed-on: https://git.example.com/jarianc/PinVault/pulls/10
2026-07-04 22:24:03 -05:00
d07fc91b95 CI: remove --no-cache for docker layer caching 2026-07-05 03:14:22 +00:00
c5b4b0d1ad CI: add generalized workflow 2026-07-05 02:46:37 +00:00
606b7c71c2 fix: add API key auth, PIN rate limiting, configurable NAS, bootstrap fix (#1,#3,#6,#7)
Require Bearer token on all API endpoints (PINVAULT_API_KEY env).
Rate limit PIN access to 5 attempts per 15min lockout per PIN.
Make NAS_BACKUP_DIR configurable via PINVAULT_NAS_BACKUP_DIR.
Replace bootstrap() sys.exit(1) with graceful False return.
Add tests for rate limiting and auth.
2026-07-04 04:54:33 +00:00
8fdfc4fc46 update local changes 2026-07-03 01:14:04 +00:00
17e7c06b59 prevent paste in recovery code input 2026-06-30 15:06:49 +00:00
10baf2dfaa add pinvault app 2026-06-30 15:02:15 +00:00
740d31ce7f first commit 2026-06-30 15:02:12 +00:00