Skip to content

fix(docker): restrict development permissions and start the poller - #8453

Merged
TheWitness merged 5 commits into
Cacti:developfrom
somethingwithproof:fix/docker-dev-environment
Oct 23, 2026
Merged

TheWitness merged 5 commits into
Cacti:developfrom
somethingwithproof:fix/docker-dev-environment

Conversation

@somethingwithproof

@somethingwithproof somethingwithproof commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

This change makes the Docker development stack less exposed and restores its scheduled poller. It binds the web port locally, protects private files and directories, corrects configuration permissions, and launches polling with the proper executable and account. Test helpers also preserve existing configuration and propagate failures, making the stack safer and more useful for development.

Implementation details

Dev-environment hardening for docker-compose.yml and the Docker test scripts.

  • Publish the web port on 127.0.0.1, matching the database, and drop fixed container names so per-run project names do not collide.
  • Deny cache/, rra/, log/ and the other directories that ship .htaccess denies, plus dotfiles, in apache.conf. The named volumes hid those .htaccess files, and the bind mount put .env and .git in the web root.
  • Write the generated config.php as root:www-data 0640; log when an existing config makes DB_* inert.
  • Run the poller cron job with an absolute php path, starting as root and dropping to www-data with runuser. Before, cron could not find php and www-data could not open PID 1's output, so the poller never ran.
  • Test harnesses restore config.php instead of deleting it, keep polling under pipefail, bound the MariaDB wait and fix the BSD mktemp template.

Verified locally: log/cacti.log, .env, rra files and dotfiles now return 403 while index.php and assets still return 200; cron ran the poller and its output reached docker logs; tests/tools/check_docker.sh passes 29/29 and leaves an existing config.php unchanged.

The CI follow-up includes the three-line Deepness pointer stabilization from #8458 and pulls the integration database from Cacti's authenticated GHCR mirror. The MariaDB digest is unchanged; only the integration job receives packages: read. This avoids the ECR download-limit failure before tests start.

Revision and checks

Verified 2026-10-23 06:07 UTC at 48fcb8d28; target develop, 17 changed files.

GitHub reports 43 passed, 4 skipped, 1 neutral, with no failed or pending checks. Skipped and neutral checks are not counted as passed. Earlier local measurements above retain their stated environments and revisions. Independent approval is still required before merge.

The web port bound to every interface, named volumes hid the shipped .htaccess denies, and the cron job could neither find php nor write to PID 1's output, so the poller never ran.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
…ig.php

check_docker.sh deleted an existing include/config.php on exit, health polling aborted under pipefail before the container reported, the MariaDB wait had no bound, and the BSD mktemp template left its Xs literal.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@somethingwithproof
somethingwithproof requested a review from a team as a code owner October 22, 2026 21:41
@somethingwithproof
somethingwithproof requested review from cigamit and removed request for a team October 22, 2026 21:41
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Deepness sets a zero body margin, so the unhovered #ms-button sits at the viewport origin and headless Chromium on Linux intermittently applies :hover to it.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@somethingwithproof somethingwithproof changed the title hardening: restrict the Docker dev stack and make its poller run fix(docker): restrict development permissions and start the poller Oct 23, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@somethingwithproof somethingwithproof added bug Undesired behaviour docker Dependabot docker updates github_actions Pull requests that update GitHub Actions code develop Bug in the development branch labels Oct 23, 2026
@sonarqubecloud

Copy link
Copy Markdown

@TheWitness
TheWitness merged commit 4178027 into Cacti:develop Oct 23, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Undesired behaviour develop Bug in the development branch docker Dependabot docker updates github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants