4 Commits
Author SHA1 Message Date
Thomas Vincent e2a5f32ee9 fix(ci): [develop] harden dependency installs and Docker build boundaries (#8294)
* security(ci): constrain dependency installs and container build boundaries

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

* fix(docker): retain shipped runtime libraries in build context

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

* fix(tooling): quote gettext paths and honor Docker base selection

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

* test(auth): use certificate expiry truth in rendering assertions

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

* fix(tooling): finish Docker layer and regex scan findings

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

* fix(ci): preserve documentation badge anchors without alternation

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

* test(ci): preserve contributor badges and enforce Python coverage

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

* ci: share changed-code coverage contracts and enforce shell policy

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

* fix(ci): enforce private review files and run path regressions

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

* test: measure changed gettext shell coverage

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

* test: pin coverage to the reviewed PR revision

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

---------

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
2026-10-14 22:52:37 -04:00
Thomas VincentandTheWitness 5d90e579e2 fix(docker): scope build context to docker/ so it builds standalone (#7513)
COPY docker/apache.conf and docker/entrypoint.sh only resolve when the
build context is the repo root. Building directly from docker/ (docker
build .) fails because those paths don't exist relative to that
context. Neither COPY step needs anything outside docker/, so narrow
the context instead of requiring root.

Fixes #7512

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Co-authored-by: TheWitness <thewitness@cacti.net>
2026-08-05 10:21:03 -04:00
242751e41b fix: harden Docker dev environment (#6621)
* fix: harden Docker dev environment and add smoke tests

Address Copilot review feedback from #6618: input validation on DB
env vars in entrypoint, scoped AllowOverride, localhost-only DB port
binding, security headers (Referrer-Policy, Permissions-Policy,
X-Permitted-Cross-Domain-Policies), reduced php-fpm worker count,
expose_php disabled, and .env excluded from git.

Adds tests/tools/check_docker.sh — 29-point smoke test covering
build, health, PHP extensions, config generation, cron, HTTP,
security headers, and DB connectivity.

* Update docker/entrypoint.sh

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: address Copilot and TheWitness review feedback

tests/tools/check_docker.sh:
- shebang: #!/bin/bash -> #!/usr/bin/env bash (consistent with repo)
- add GPL copyright header (2004-2026)
- fix grep pattern: single-quoted '^${ext}$' never expanded variable;
  use double quotes so extension name is actually matched
- add opcache to REQUIRED_EXTS (TheWitness)

docker/entrypoint.sh:
- shebang: #!/bin/bash -> #!/usr/bin/env bash

docker/Dockerfile:
- rrdtool comment: clarify that 1.9+ enables graph tooltip output via
  graphv, not merely "hover tooltips" (TheWitness)

docker/apache.conf:
- X-XSS-Protection: add TODO comment noting it is deprecated and that
  Cacti sets its own headers at the application layer (TheWitness)

---------

Co-authored-by: TheWitness <thewitness@cacti.net>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-17 22:46:45 -05:00
Thomas Vincent 016fbe9b1b feat: add Docker-based development environment (#6618)
PHP 8.4-fpm with Apache, MariaDB 11.8, rrdtool.
Configurable via .env (ports, credentials, DB tuning).
Schema auto-imported from cacti.sql on first startup.

Closes #6617
2026-02-14 11:33:49 -05:00