Data and tmp standardization#1279
Merged
jokob-sk merged 10 commits intonetalertx:next_releasefrom Nov 9, 2025
Merged
Conversation
Currently translated at 100.0% (762 of 762 strings) Translation: NetAlertX/core Translate-URL: https://hosted.weblate.org/projects/pialert/core/ru/
Currently translated at 8.2% (63 of 762 strings) Translation: NetAlertX/core Translate-URL: https://hosted.weblate.org/projects/pialert/core/cs/
Assuming this was a typo
Fix typo in Baseline Docker Compose - DOCKER_COMPOSE.md
Currently translated at 81.4% (621 of 762 strings) Translation: NetAlertX/core Translate-URL: https://hosted.weblate.org/projects/pialert/core/de/
Removed unnecessary blank lines in the nginx configuration template.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request implements a major simplification of the NetAlertX Docker filesystem, consolidating all persistent data into a single
/datavolume and all ephemeral runtime data into a single/tmptmpfsmount.🧐 Why is this necessary?
The previous mount structure was complex, requiring users to manage two separate persistent volumes (
netalertx_config,netalertx_db) and a list of up to fivetmpfsmounts. This created a high barrier to entry and was prone to misconfiguration.This new structure aligns with best practices and simplifies the user experience for all use cases, from a simple
docker compose upat home to complex, air-gapped enterprise deployments.🛠️ Summary of Changes
This PR touches nearly every layer of the container to achieve this simplification, from the
Dockerfileto the application-level PHP code.1. Filesystem & Mounts
docker-compose.yml:netalertx_configandnetalertx_dbvolumes.datamounted to/data.tmpfsmounts (e.g.,/tmp/log,/tmp/api,/tmp/run).tmpfsmount for/tmp, which now contains all runtime/ephemeral subdirectories.Dockerfile:/dataand/tmpbase directories with correct20211:20211/700permissions.NETALERTX_CONFIG_DIR,NETALERTX_DB_DIR,NETALERTX_LOG_DIR, etc.) have been updated to point to the new paths (e.g.,/data/config,/data/db,/tmp/log).2. Path Abstraction & Code Updates
server/config_paths.py) instead of hard-coded paths like/app/config,/app/db, or/app/api.front/php/server/util.phpwas still referencing/app/api/table_settings.json, causing PHP-FPM to hang on startup. It now correctly uses the abstracted path.3. Entrypoint & Migration Logic
entrypoint.d/01-data-migration.sh(New):entrypoint.d/25-mandatory-folders.sh(New):/dataand/tmp(e.g.,/data/config,/data/db,/tmp/log,/tmp/api,/tmp/run,/tmp/nginx/active-config). This ensures the container functions correctly whether the user mounts the root/dataand/tmpor individual sub-mounts.entrypoint.sh(Updated):entrypoint.dscript exits with status1(indicating a critical, system-breaking error), the container will print a standardized error message with a troubleshooting link and exit.chowncommands per review feedback.🗺️ Migration Path for Existing Users
This change includes an assisted migration to move data from old volumes.
/datavolume to theirdocker-compose.ymlwhile keeping their oldnetalertx_configandnetalertx_dbvolumes.01-data-migration.shwill detect this hybrid state./app/configand/app/dbinto the new/data/configand/data/dbdirectories..migrationfiles in the old volumes and print a persistent warning on every startup, instructing the user to shut down, remove the oldnetalertx_configandnetalertx_dbvolume definitions, and restart.docker-compose.ymlis updated to only use the/datavolume, the warnings will cease.✅ Testing & Validation
test/docker_tests/configurations/were updated to reflect the new mount structure.test_mount_diagnosticswas updated to parse the new warning tables and assert their contents directly.test_missing_host_network_warningis now passing.-v /tmp/log:/tmp/log) and root mounts (-v data:/data) functions correctly anddevices.phpis available.New Features
Some additional items were added to reduce development complexity.
.devcontainer/NetAlertX.code-workspaceWorkspace was added which allows quick access to logs and other out-of-source inspections during normal operation💬 Addressed Code Review Feedback
1inentrypoint.sh. which reduced complexity in implementationFuture enhancements