Docker Image CI / build (pull_request) Waiting to run
Задание 15: MEDIA_CACHE_DIR (резолвится один раз при импорте) + media_cache_path(
channel, post_id, fid=None) -> <root>/<channel>/<post_id>[/<fid>] как единый
источник истины формата пути. Заменены все ручные сборки os.path.abspath('./data/
cache')+join (7 мест); строки путей дословно идентичны (drop-in). remove_old_
cached_files_sync/download_new_files сохраняют параметр cache_dir (тестируемость).
Задание 16: in-memory _mime_types (bound _MIME_CACHE_MAX=50000, clear() при
переполнении) перед SQLite в prepare_file_response. Порядок: dict -> SQLite ->
python-magic; SQLite-хит и magic-детект наполняют dict. MIME по file_unique_id
иммутабелен -> повторный /media-хит не открывает SQLite-соединение (ни на чтение
MIME, ни на запись access-time — она уже в аккумуляторе). Кэшируются только
реальные типы.
closes#26
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Docker Image CI / build (pull_request) Has been cancelled
Issue #13: data["html"]["title"] was embedded into the debug HTML of
/post/html without escaping; title never passes through bleach, so a post
whose generated title carries markup (e.g. a poll question) was a reflected
XSS under ?debug=true. Escape it with html.escape, same as raw_message.
Add a regression test with a <script> payload in a poll question.
Issue #17: a bare 'pytest' from the repo root failed 22 tests because the
config in tests/pytest.ini was not picked up (asyncio_mode lost, .venv
collected) and every test module polluted sys.modules['config'] at import
time. Move the config to a root pytest.ini with testpaths=tests, and
centralize the sys.path bootstrap + config mock in tests/conftest.py, which
pytest imports before any test module. Drop the per-module preambles.
Closes#13, closes#17
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>