Понятно, где лежат настройки

Правки в app/config.py не действуют и теряются при обновлении: это код,
а настройки читаются из config.toml. Теперь при старте печатается путь
к нему и что фактически применилось - задан ли токен и сколько адресов
разрешено. В самом модуле - предупреждение вверху файла.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vladimir Bryzgalov
2026-08-15 22:08:28 +05:00
co-authored by Claude Opus 5
parent c704fb5068
commit 13cccb18d1
4 changed files with 28 additions and 2 deletions
+16
View File
@@ -148,3 +148,19 @@ class TestHealthDiagnostics:
"""Список разрешённых адресов - не для посторонних глаз."""
body = client.get("/health").json()
assert "allow_ips" not in body and "allowlist" not in body
class TestConfigFileIsNotCode:
"""Настройки правятся в config.toml; app/config.py - код и обновляется."""
def test_update_archive_never_carries_user_config(self):
from app.updater import USER_FILES
assert "config.toml" in USER_FILES
def test_config_module_warns_it_is_not_settings(self):
from pathlib import Path
src = Path(__file__).resolve().parent.parent / "app" / "config.py"
text = src.read_text(encoding="utf-8")
assert "ЭТО КОД, А НЕ НАСТРОЙКИ" in text