panw b1060314a2 fix: improve config module with lazy init and validation
Fixes from code review:

Critical:
- Replace module-level `settings = Settings()` with lazy initialization
  via `get_settings()` function to avoid import failures when env vars
  not set

Important:
- Remove unused `import os` from test_config.py
- Add tests for computed properties (db_path, ssh_keys_dir, repos_dir)
- Add field validation for encrypt_key:
  * Validates base64 format
  * Ensures decoded key is at least 32 bytes for AES-256
- Fix Python 3.8 compatibility (use Optional[Settings] instead of | union)

All tests pass (6/6).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:13:10 +08:00
Description
git管理系统
148 KiB
Languages
Python 80.1%
Vue 14.2%
JavaScript 3.4%
Batchfile 1.4%
Shell 0.8%
Other 0.1%