config: fix media path at /var/thoughtsync (no env knob)
The media/data location is no longer configurable — DATA_DIR is a fixed constant (/var/thoughtsync) and THOUGHTSYNC_MEDIA_ROOT is removed, so a mutable path can't drift from where the volume is mounted. media_root() = DATA_DIR/media. Both compose files drop THOUGHTSYNC_DATA_DIR and mount the data volume at /var/thoughtsync (was the contradictory /data). conftest drops the stale MEDIA_ROOT monkeypatch (create_app never reads DATA_DIR). Net env surface: THOUGHTSYNC_DATABASE_URL (required) + THOUGHTSYNC_SECRET_KEY (optional break-glass). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRgehjoz7Yv8LkUfADxACm
This commit is contained in:
+4
-5
@@ -5,9 +5,8 @@ from thoughtsync.config import Config
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _isolated_data_dir(tmp_path, monkeypatch):
|
||||
"""Point DATA_DIR at a writable temp dir so create_app() can generate its
|
||||
signing key without needing /var/thoughtsync to exist (DB-free unit tests)."""
|
||||
data_dir = tmp_path / "data"
|
||||
monkeypatch.setattr(Config, "DATA_DIR", str(data_dir))
|
||||
monkeypatch.setattr(Config, "MEDIA_ROOT", str(data_dir / "media"))
|
||||
"""Keep any media writes on an isolated temp dir rather than the fixed
|
||||
/var/thoughtsync. DB-free unit tests never actually hit it (create_app takes its
|
||||
signing key from env-or-random, not a file), but this stays defensive."""
|
||||
monkeypatch.setattr(Config, "DATA_DIR", str(tmp_path / "data"))
|
||||
yield
|
||||
|
||||
Reference in New Issue
Block a user