3375 Commits

Author SHA1 Message Date
20ee2dcbfd fix(matomo): use localhost for installer connectivity in tests
Use 127.0.0.1 instead of DOCKER_BIND_HOST for HTTP reachability
checks and matomo-bootstrap base URL to avoid invalid connections
to 0.0.0.0 during local and CI test runs.

https://chatgpt.com/share/694a8f17-2d90-800f-b0d4-dea982083592
2025-12-23 14:05:49 +01:00
b08e0c7b25 feat(matomo): use nix-based matomo-bootstrap for headless installation
- Drop php console core:install flow
- Drive official Matomo web installer via Playwright
- Use Nix flake (matomo-bootstrap + playwright installer)
- Keep auth token stable via MATOMO_BOOTSTRAP_TOKEN_AUTH
- Improve robustness with HTTP readiness checks

https://chatgpt.com/share/694a8f17-2d90-800f-b0d4-dea982083592
2025-12-23 13:46:03 +01:00
164d22d1ee sys-svc-docker: install Docker or Podman depending on distribution
Switch container engine installation to be distro-aware:
- Arch: docker + docker-compose
- Debian/Ubuntu: docker.io + docker-compose-plugin
- Fedora/CentOS: podman + podman-compose

Keep existing Docker handler for now; Podman notification handling
will be addressed in a follow-up refactor.

https://chatgpt.com/share/694a89c0-c6b4-800f-a873-60f59b9573ef
2025-12-23 13:23:21 +01:00
45aed86479 fix(mariadb): use env-based root password in healthcheck
Replace inline root password in docker-compose healthcheck with
MARIADB_ROOT_PASSWORD environment variable to avoid leaking secrets
into rendered compose files and improve security.

https://chatgpt.com/share/694a8866-79fc-800f-a7c5-b199a52f8d2c
2025-12-23 13:17:34 +01:00
db49fd610d Retry pkgmgr nix run on transient failures
Add retries with delay to pkgmgr update via nix run to handle transient
GitHub/API timeouts. Ensure proper changed/failed conditions and only
fail after all retry attempts unless a tolerated state is detected.

https://chatgpt.com/share/694988e3-d698-800f-a018-ea892c6553a8
2025-12-22 19:07:24 +01:00
a6c98a0aba feat(web-app-matomo): add non-interactive CLI install and split config patches
- add Matomo CLI-based installation using core:install
- wait for container readiness before installation
- split database and trusted hosts configuration into dedicated tasks
- move trusted_hosts patch into separate task file
- add site_name support via role configuration
- introduce users definition for Matomo administrator
- clean up formatting and minor config inconsistencies

https://chatgpt.com/share/6949818b-ad30-800f-95ba-c9c54ccd1ce8
2025-12-22 18:36:07 +01:00
d0a244ef3a Corrected variable name 2025-12-22 17:49:13 +01:00
2b5ff60a6f infra(docker): drop host networking and normalize port binding logic
This change removes --network=host usage, introduces DOCKER_IN_CONTAINER
for reliable environment detection, and replaces hardcoded localhost
bindings with an explicit DOCKER_BIND_HOST abstraction to avoid nftables
issues in CI/DiD environments.

https://chatgpt.com/share/69497616-7b00-800f-8fa3-ddc6eb9c5e98
2025-12-22 17:46:08 +01:00
a3cc693fc2 fix(mariadb): guard recovery wait against missing rc in docker exec result
Use defaulted rc lookup in until condition to avoid failures when
docker_container_exec returns incomplete results during retries.

https://chatgpt.com/share/69497127-fc88-800f-8182-a2e53ea9615c
2025-12-22 17:26:07 +01:00
5da5086fa6 Set docker_compose_flush_handlers: true for Matomo 2025-12-22 16:39:20 +01:00
2bfd9de1f2 Reimplemented false deleted package_notify 2025-12-22 16:20:05 +01:00
246530bc2f fix(svc-db-mariadb): remove bash quoting bugs and add optional root password recovery
- Run mariadb CLI exec without bash -lc to avoid escaping/linebreak issues
- Fix DB/user init in CI (no published ports) using stable -e SQL strings
- Add guarded recovery flow to reset root password via --skip-grant-tables container
- Introduce MARIADB_ALLOW_RESET_WITHOUT_PREVIOUS toggle (enabled by default for now)

https://chatgpt.com/share/69495c45-0f8c-800f-8433-be0c2be82346
https://chatgpt.com/share/69495c5b-1a80-800f-bdb9-cb41c33e080f
2025-12-22 15:56:48 +01:00
9251c2ad8a svc-prx-openresty: simplify handler and move validation to assert tasks
- Simplify OpenResty restart handler to only perform pre-flight config check
  and container restart
- Move runtime validation (wait + post-flight check) into dedicated assert tasks
- Prepare assert workflow for unconditional log output and clearer diagnostics
- Remove complex block/rescue logic from handler context

https://chatgpt.com/share/6949582b-28a8-800f-9f7c-2949a8258c7a
2025-12-22 15:39:24 +01:00
be2e221287 fix(mariadb): repair healthcheck command and env_file format
- Fix broken Docker healthcheck caused by multiline CMD-SHELL rendering
- Ensure healthcheck runs as a single shell command
- Properly quote root password in healthcheck
- Fix env_file format to KEY=VALUE for Docker Compose compatibility

This resolves MariaDB containers getting stuck in 'unhealthy' state.

https://chatgpt.com/share/694942a1-936c-800f-95aa-f22a0d4de5e5
2025-12-22 14:07:37 +01:00
79caa29ace Removed redundancy in pkgmgr instally 2025-12-22 14:01:53 +01:00
b14d3e8584 fix(openresty): add docker ps debug output on handler failure
Print all containers in the OpenResty restart handler rescue block
to diagnose CI-only failures where the container does not exist,
is renamed, or is not running.

https://chatgpt.com/share/69493b9f-e770-800f-8442-1ecf7777e85a
2025-12-22 13:37:32 +01:00
cf3d763d75 fix(svc-db-mariadb): make MySQL Python client install distro-aware and PEP668-safe
- Replace hardcoded python-mysqlclient with distro-aware package selection
- Remove pip-based PyMySQL install to avoid PEP 668 failures on Arch
- Install MySQL client libs only when MARIADB_EXPOSE_LOCAL is enabled
- Keep CI/container path free of host-side Python DB dependencies

https://chatgpt.com/share/694935a3-3e10-800f-9043-acf34d3e2c8a
2025-12-22 13:12:10 +01:00
079e0a9de3 fix(mariadb): avoid port publishing in CI and init via container exec
- Disable localhost port exposure in container/CI environments
- Keep host behavior unchanged
- Skip mysql localhost checks when not exposed
- Initialize database and user via docker exec in CI/act
- Prevent Docker iptables/nft failures during compose up

https://chatgpt.com/share/69493076-207c-800f-a8c6-719d3cc3fe35
2025-12-22 12:49:57 +01:00
9118b47654 test(integration): allow regex_findall as builtin Jinja2 filter
Add regex_findall to BUILTIN_FILTERS to reflect Jinja2-provided filters
available in Ansible templates and avoid false positives in filter
definition checks.

https://chatgpt.com/share/694929e5-e960-800f-9649-47b21d2c7fc0
2025-12-22 12:22:07 +01:00
d9485bcdd1 test(integration): restrict handler discovery to handlers/main.yml
Only handlers defined in handlers/main.yml/main.yaml are considered.
Task files included via include_tasks/import_tasks under handlers/ are
regular tasks and must not be treated as standalone handlers.

This prevents false positives where internal handler sub-steps were
incorrectly reported as missing notify targets.

https://chatgpt.com/share/6949290a-a694-800f-bb29-60cd96321f62
2025-12-22 12:18:32 +01:00
fa4ab3835c refactor(keycloak): streamline LDAP assert/update flow
* Run LDAP assertions only when MODE_ASSERT is enabled (guarded at include level)
* Remove redundant MODE_ASSERT conditions inside assert/05_ldap.yml
* Simplify mapper-id refresh logic by relying on the surrounding block condition

https://chatgpt.com/share/694927e3-2794-800f-9bc7-749c1e32a541
2025-12-22 12:13:29 +01:00
5ee48dfb63 fix(sys-service): run container service scripts synchronously to avoid async rc errors
- Remove async/poll from container handler
- Ensure rc/stderr are available for changed/failed conditions
- Keep systemctl-related errors non-fatal in containers

https://chatgpt.com/share/6949249b-62b0-800f-99c3-62b50a49a63b
2025-12-22 11:59:26 +01:00
46baaacba9 Enabled svc-db- credentials for servers 2025-12-22 11:57:53 +01:00
afc209633b feat(sys-service): ignore systemctl-related failures when running in containers
- Execute service scripts in containers with async/poll support
- Treat missing systemd/systemctl as non-fatal in container context
- Preserve failure handling for genuine script execution errors

https://chatgpt.com/share/69491f89-468c-800f-998f-1eb5424a2cf9
2025-12-22 11:48:24 +01:00
8b21b864f1 feat(sys-service): support async execution of service scripts in containers
- Enable async/poll for container-based service script execution
- Align container handler behavior with systemd handlers
- Preserve linear sync and suppression logic via existing variables

https://chatgpt.com/share/69491f89-468c-800f-998f-1eb5424a2cf9
2025-12-22 11:41:55 +01:00
2f51d88f21 feat(sys-service): execute service script on refresh when running in container
- Add container-specific handler listening on refresh systemctl service
- Execute service script directly when IS_CONTAINER is true
- Trigger only for restarted state and non-suppressed flushes
- Keep native systemd handling unchanged for non-container environments

https://chatgpt.com/share/69491f89-468c-800f-998f-1eb5424a2cf9
2025-12-22 11:37:53 +01:00
ffd071c64e ci(openresty): share gh-action runtime and scope nginx/www volumes per CI run
- Mount /tmp/gh-action into the CI container so Docker can access run-scoped paths
- Scope OpenResty www and nginx volumes to GITHUB_RUN_ID when running in container
- Avoid leaking host /etc/nginx and /var/www into CI runs
- Remove redundant preflight

https://chatgpt.com/share/694918d0-53b4-800f-93a7-ec82946f3e24
2025-12-22 11:09:12 +01:00
f28e173d23 fix(ci): restore CI push trigger for normal branch commits
- Explicitly trigger CI (push) on all branches
- Continue to ignore version, stable and other release tags
- Prevent missing CI runs on regular commits while avoiding tag-based duplicates

https://chatgpt.com/share/6948fa05-1970-800f-a010-59c8c3588713
2025-12-22 09:55:40 +01:00
c82d1f6ca3 fix(ci): eliminate duplicate workflow runs by separating branch and tag triggers
- Run CI (push) only on branch pushes and ignore version/stable/latest tags
- Run versioning workflow exclusively on v* tag pushes
- Remove overlapping branch triggers to prevent double executions

https://chatgpt.com/share/6948fa05-1970-800f-a010-59c8c3588713
2025-12-22 09:53:23 +01:00
fc7ba32db0 fix(ci): prevent duplicate runs by ignoring tag pushes in CI (push)
Limit CI (push) to main/master branches and ignore version and stable tags
to avoid duplicate workflow executions.

https://chatgpt.com/share/694905df-e06c-800f-8876-9f6682e22943
2025-12-22 09:48:25 +01:00
1fdf5ae169 fix(openresty): make restart handler safe with include_tasks and assertions
- Move OpenResty restart logic into included handler tasks
- Use block/rescue to dump container logs on failure
- Tolerate restarting state during pre-flight validation
- Wait up to 2 minutes for container to reach running state
- Add explicit change detection for docker restart
- Enable assert mode in container deploy CLI

https://chatgpt.com/share/6948fa05-1970-800f-a010-59c8c3588713
2025-12-22 09:40:08 +01:00
83b3c6651a feat(openresty): make restart handler robust with wait, validation and log dump
- Replace separate handlers with atomic block/rescue handler
- Add pre- and post-flight OpenResty config validation
- Wait for container to reach running state before post-check
- Dump container logs automatically on failure for easier CI debugging
- Skip Let’s Encrypt tasks when SSL is disabled

https://chatgpt.com/share/6948fa05-1970-800f-a010-59c8c3588713
2025-12-22 08:57:51 +01:00
f51b53a615 feat(keycloak-ldap): enforce canonical ldap-roles mapper and add read-only asserts
- Resolve LDAP UserStorageProvider via client-side filtering (avoid unreliable kcadm --query)
- Enforce exactly one canonical 'ldap-roles' LDAP mapper per LDAP component
- Deterministically deduplicate existing ldap-roles mappers (lexicographic id order)
- Safely parse created mapper id and fallback to authoritative refresh
- Add read-only assert tasks to validate LDAP, mapper uniqueness, groups.path and top-level group
- Wire LDAP asserts into role execution when MODE_ASSERT is enabled
- Improve idempotency, robustness and CI failure diagnostics

https://chatgpt.com/share/69487ed5-3b58-800f-8ac6-bbb1bbe3688a
2025-12-22 00:12:11 +01:00
d9824bb506 test(deploy): mock backup authorized_keys in CI inventory
Create a dummy authorized_keys file inside the CI container inventory
after inventory generation and before ansible-playbook execution.

This prevents sys-bkp-provider-user from failing on missing file lookups
while keeping the role logic unchanged and the deploy tests deterministic.
2025-12-21 23:39:20 +01:00
c61db9f9e0 feat(ci): silence INSTALL_LOCAL_BUILD output during invokable discovery
* Refactor docker entrypoint to run local build via a single helper function
* Add INSTALL_LOCAL_BUILD_SILENCE flag to fully suppress DEV build output
* Enable INSTALL_LOCAL_BUILD for invokable resolution without noisy logs
* Keep behavior deterministic and non-redundant while preserving failure semantics

https://chatgpt.com/share/694874d7-508c-800f-aa89-d9cef71128dc
2025-12-21 23:29:39 +01:00
d85da02db1 Disabled INSTALL_LOCAL_BUILD due to noise 2025-12-21 23:14:48 +01:00
5dcd8059eb fix(pkgmgr): enforce non-interactive updates and abort on prompts
- Remove interactive pkgmgr update during install
- Run pkgmgr updates via venv binary in non-interactive mode
- Disable git prompts and SSH interactivity
- Close stdin and enforce timeout to prevent hanging updates
- Ensure deterministic behavior in Ansible, CI, and Docker contexts

https://chatgpt.com/share/69485536-28c8-800f-9a6b-fb25f433e367
2025-12-21 21:14:40 +01:00
8d2d2ad5fa fix(openresty/nginx): replace deprecated listen ... http2 with http2 on
- Remove deprecated `http2` parameter from listen directives
- Enable HTTP/2 explicitly via `http2 on;`
- Ensure compatibility with modern nginx and OpenResty versions
- Reduce configuration validation warnings

https://chatgpt.com/share/69484ec2-4fa0-800f-99f8-39ff98b87361
2025-12-21 20:47:03 +01:00
d2e88b6a8c feat(cli): eliminate runpy warnings for inventory + container entrypoints
* Remove legacy **main** re-export wrappers to avoid `runpy` "already in sys.modules" warnings
* Introduce `cli.deploy.container.command` as the stable implementation module
* Reduce `cli.deploy.container.__main__` to a minimal entrypoint delegating to `command.main`
* Re-export container helpers from package `__init__` without importing `__main__`
* Update unit tests to import/patch the new command module and keep CLI dispatch stable

https://chatgpt.com/share/69484a22-60dc-800f-a23d-068d7c45fe37
2025-12-21 20:27:26 +01:00
396d5f5ba6 fix(pkgmgr): remove unused config.yaml generation and use explicit venv pkgmgr binary
- Drop config.yaml creation and related variable as it is no longer used
- Avoid PATH-related issues by calling pkgmgr via its venv binary
- Make pkgmgr path resolution deterministic in web-app roles

https://chatgpt.com/share/69484645-afcc-800f-8ef0-a7cbe2d9b52e
2025-12-21 20:10:55 +01:00
ac4fda6717 Deactivated sshd restart during docker in docker execution 2025-12-21 19:55:49 +01:00
f15835236f Release version 0.3.5 latest v0.3.5 2025-12-21 19:47:20 +01:00
b48c26ef80 refactor(user-root): move OpenSSH client install to role and modularize root SSH key setup
- Remove openssh-client from Dockerfile to avoid hard dependency
- Add user-root SSH variable definitions for private/public key paths
- Split root SSH key generation into dedicated task file
- Ensure idempotent key creation and output handling
- Improve maintainability by decoupling container build from user provisioning

https://chatgpt.com/share/6948403b-7440-800f-bb45-72456827a6c5
2025-12-21 19:45:11 +01:00
2387f12f1a build(make): enable strict bash execution with oneshell
- Run each recipe in a single Bash shell
- Enable -euo pipefail for deterministic failure handling
- Ensure make aborts immediately on errors (e.g. permission issues)
- Use /bin/bash explicitly to avoid env resolution problems

https://chatgpt.com/share/69481ec8-8a3c-800f-9de8-256e1c10896a
2025-12-21 17:22:29 +01:00
b9cb69be8b fix(shellcheck): resolve SC2206 by safe array population
* Replace unquoted array expansion with mapfile-based parsing
* Prevent word splitting and globbing in compute_exclude_csv
* Keep behavior identical while satisfying ShellCheck

https://chatgpt.com/share/69481b6b-02f8-800f-91c8-bbc6592f97b4
2025-12-21 17:07:48 +01:00
63f6b0b0ba Release version 0.3.4 v0.3.4 2025-12-21 17:03:36 +01:00
6726f36799 feat(sys-util-git-pull): introduce reusable shallow git pull role with tag pinning
- Add new role sys-util-git-pull as a generic system utility
- Implement robust shallow clone/update logic in Python helper
- Support detached-safe branch updates and optional tag pinning
- Handle annotated vs lightweight tags and heal local tag conflicts
- Provide deterministic Ansible change detection via machine-readable output
- Add verbose logging to stderr for debuggability
- Integrate sys-util-git-pull into pkgmgr role to replace inline git logic
- Add comprehensive unit tests (option A: file-based import) for helper script
- Add role README and meta information with platform-agnostic support
- Ensure role conforms to existing test expectations (meta/main.yml present)

https://chatgpt.com/share/69481902-a98c-800f-9b3f-9ee13e8e50b7
2025-12-21 16:57:45 +01:00
38c8b59fe0 test(integration): ignore **pycache** directories in role validation tests
https://chatgpt.com/share/69481867-784c-800f-ab60-50ce3b241dd4
2025-12-21 16:55:06 +01:00
30d557ef0d chore(format): add formatter target and apply shfmt/ruff formatting
- Add `make format` target running shfmt + ruff format + ruff check --fix
- Reformat shell scripts with shfmt
- Apply ruff formatting and autofixes across Python code

https://chatgpt.com/share/69480c5a-b0bc-800f-9a2b-770d98c1b6ff
2025-12-21 16:03:48 +01:00
f406db2869 Merge pull request #42 from kevinveenbirkenbach/alert-autofix-125
Potential fix for code scanning alert no. 125: Use of the return value of a procedure
2025-12-21 15:51:48 +01:00