#514 began validating `background` as an http(s) URL against the *merged*
config, so a value stored by an older release (a relative path, or one
containing a space/parenthesis — all legal before) made every subsequent
settings save return 400, including saves that never touched `background`.
Existing deployments could not change any setting at all.
Validate only values that actually change: an untouched legacy value is
kept as-is (it is still html-escaped on render), while any edit must pass
validation. Regression tests cover both directions and fail without this
change.
Also treat OverflowError from hashlib.scrypt as a non-matching hash so a
hand-crafted n/r/p cannot disturb the login path on runtimes that raise it.
- new hashes use scrypt (n=2^14, r=8, p=1); sha256 and plaintext formats
keep verifying unchanged, so existing deployments are unaffected
- on successful login a legacy-stored admin password is rehashed to scrypt
in the settings KeyValue row
- add password_needs_rehash() and extend scheme detection; stdlib only, no
new dependency
Apply the useful security fixes from PR #494 with review corrections:
validate expire_style through a shared helper, accept previous download
token window, detect SQL dialect via Tortoise capabilities, close remote
download sessions on client abort, and disable invalid CORS credentials.
Upgrade aiohttp and related packages, harden local file and storage path checks, tighten password/JWT comparisons, and default Docker forwarded IP trust to empty.
- Add "workers" configuration option to DEFAULT_CONFIG with default value of 1
- Add "host" configuration option to DEFAULT_CONFIG with default value of "::"
- Update uvicorn.run() to use settings.host and settings.workers instead of hardcoded values
- Reorganize imports in main.py for better readability and consistency
- Add blank line after time import in core/utils.py for PEP 8 compliance
- Allow dynamic configuration of server workers and binding host address