mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-11-20 23:51:47 +01:00
fix(import): stop hardcoding the Docker image's paths
Import uploads were always written to /usr/src/app/temp, presets were read from /usr/src/app/import_presets and the caches lived in /var/tmp, so WYGIWYH only worked from the Docker image's layout. Running it as a systemd service with a strict sandbox, or on an immutable distro like NixOS, needs these folders to follow the app or be configurable. - Presets are read from IMPORT_PRESETS_ROOT, the import_presets folder next to the app. - Uploads wait in IMPORT_TEMP_ROOT, the temp folder next to the app by default, and movable with the IMPORT_TEMP_ROOT env var. The web views, the API and the import service all use it. - The file-based caches live under CACHE_ROOT, /var/tmp by default, and movable with the CACHE_ROOT env var. In the Docker image the app sits in /usr/src/app, so every default resolves to the same folder as before. The import service checked that a file was inside the temp folder with a plain string prefix, which also accepted sibling folders such as /usr/src/app/temp-other. It now compares paths. CI no longer needs to create /usr/src/app before running the tests. Fixes #472
This commit is contained in:
1 parent
c05bdcf2bf
commit
6cf8cbf786
10 files changed
+180
-23
No files matched your search
@@ -60,12 +60,6 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: uv sync --frozen
|
||||
|
||||
# Import code reads/writes the Docker image's paths directly
|
||||
- name: Create container paths used by the app
|
||||
run: |
|
||||
sudo mkdir -p /usr/src/app/temp /usr/src/app/import_presets
|
||||
sudo chown -R "$(id -u):$(id -g)" /usr/src/app
|
||||
|
||||
- name: Check for missing migrations
|
||||
working-directory: app
|
||||
run: uv run python manage.py makemigrations --check --dry-run
|
||||
|
||||
Reference in new issue
Block a user