Extract all magic numbers into share.config

Unified config file with [server] (user-facing: port, dir, ttl, lang,
etc.) and [internal] (constants: timeouts, buffer sizes, cert params,
UI timings). Replaces both DEFAULTS dict and hardcoded constants.
JS constants (toast_ms, progress_hide_ms) passed through CFG injection.
Old share.conf no longer used.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-10 20:52:57 +04:00
co-authored by Claude Opus 4.6
parent 082a80a6c5
commit 9cc4693f39
3 changed files with 60 additions and 26 deletions
+19
View File
@@ -0,0 +1,19 @@
[server]
port = 3001
dir = ~/Downloads/shared
ttl = 7
san =
lang = ru
refresh = 5
per_page = 10,25,50,100
[internal]
secs_per_day = 86400
cleanup_interval = 3600
ssl_handshake_timeout = 5
sniff_size = 8192
chunk_size = 65536
cert_days = 3650
cert_key_bits = 2048
toast_ms = 2500
progress_hide_ms = 1200