Commit Graph
1953 Commits
Author SHA1 Message Date
kevinveenbirkenbach 3f08b77aa5 refactor(lookup): build compose_f_args paths via get_docker_paths, drop docker_compose var
- compose_f_args no longer reads variables['docker_compose']
- always derives compose file paths from PATH_DOCKER_COMPOSE_INSTANCES via get_docker_paths
- remove YAML coercion and related code paths
- update unit tests to stub get_docker_paths and assert new failure modes

https://chatgpt.com/share/6984dbd9-ce9c-800f-a2c9-72138193f383
2026-02-05 19:05:09 +01:00
kevinveenbirkenbach 26a5b159e0 refactor(docker-lookup): replace want= syntax with path-based access
- Replace lookup('docker', ..., want='...') with lookup('docker', ..., 'path')
- Allow both top-level keys (directories/files) and dotted paths
- Simplify docker lookup API and reduce lazy dict propagation
- Update unit tests to reflect new lookup semantics

https://chatgpt.com/share/6984ccea-8290-800f-a6d7-ec0e94df95a0
2026-02-05 18:45:43 +01:00
kevinveenbirkenbach 25f7aab975 lookup(docker): slim API to dotted-path access only + adjust tests
- Simplify docker lookup to accept only application_id and optional dotted path
- Remove env fallback and explicit base path arguments
- Enforce dotted notation for sub-value access (e.g. directories.instance)
- Fail fast on missing PATH_DOCKER_COMPOSE_INSTANCES
- Update unit tests to reflect strict dotted-path behavior

https://chatgpt.com/share/6984ccea-8290-800f-a6d7-ec0e94df95a0
2026-02-05 18:38:25 +01:00
kevinveenbirkenbach 56aea31667 refactor(docker): replace docker_compose vars with docker lookup across roles
Remove implicit docker_compose variable usage and resolve all docker paths
(files, directories, env) via lookup('docker', application_id).
This prevents scope leakage, centralizes path resolution, and makes docker
context deterministic across roles and handlers.

https://chatgpt.com/share/6984ccea-8290-800f-a6d7-ec0e94df95a0
2026-02-05 18:15:10 +01:00
kevinveenbirkenbach 5fb188ad9c lookup(docker): add docker paths lookup with env fallback and unit tests
- Introduce lookup plugin `docker` to resolve docker-compose paths
  from application_id with PATH_DOCKER_COMPOSE_INSTANCES fallback
  (Ansible vars preferred, environment as fallback)
- Validate and strip inputs for deterministic behavior
- Return resolved paths as a single-item wantlist for safe templating
- Add comprehensive unittest coverage for precedence, validation,
  and fallback logic

https://chatgpt.com/share/6984ccea-8290-800f-a6d7-ec0e94df95a0
2026-02-05 18:01:21 +01:00
kevinveenbirkenbach b82eb632b2 docker-compose: remove compose_run wrapper and call compose.py directly
- Drop compose_run.py and its unit tests
- Call compose.py directly from handlers for `up`
- Restore explicit --force-recreate and --remove-orphans semantics
- Reduce wrapper indirection and hidden behavior
- Make docker compose execution transparent and deterministic

https://chatgpt.com/share/698496f7-7da0-800f-b030-5a90f741a9a6
2026-02-05 14:11:10 +01:00
kevinveenbirkenbach e194981535 refactor(backup): make database seeding strict and explicit
- enforce explicit database parameters for baudolo seeding
- replace implicit checks with assert-based fail-fast logic
- update rdbms, matrix and bigbluebutton roles to pass all db fields
- keep backup behavior unchanged while hardening configuration

https://chatgpt.com/share/6983c9e4-860c-800f-b0f7-28462c08e249
2026-02-04 23:36:08 +01:00
kevinveenbirkenbach 4b7200b451 lookup(database): add stable db role id and switch consumers to use it
- Extend database lookup with `id` (e.g. svc-db-postgres, svc-db-mariadb)
- Return empty id when no database type is configured
- Replace dynamic 'svc-db-{{ type }}' constructions with lookup-provided id
- Update docker network templates to rely on lookup database id
- Adjust sys-svc-rdbms to load DB role via lookup id
- Extend unit tests to assert correct id behavior for all cases

This makes DB role resolution explicit, safer, and less error-prone.

https://chatgpt.com/share/6983c6de-c5f8-800f-a5e3-786f90e0ebc1
2026-02-04 23:23:03 +01:00
kevinveenbirkenbach bd3f838188 lookup(database): add enabled/shared flags and extend unit tests
Expose database.enabled and database.shared via the database lookup plugin.
Use shared flag consistently to determine central DB behavior and surface both
flags even when no database type is configured. Update unit tests to cover the
new fields and verify behavior for dedicated vs. shared databases.

https://chatgpt.com/share/6983bcf6-85bc-800f-a0fc-5684b9078469
2026-02-04 22:40:54 +01:00
kevinveenbirkenbach 24616b2d35 refactor: extract get_docker_paths to module_utils and fix affected tests
- Move get_docker_paths() implementation from filter_plugins to module_utils
  to make it reusable by filters and lookup plugins (single source of truth)
- Adapt filter_plugins/get_docker_paths.py to re-export the shared util
- Add new lookup plugin "database" resolving DB settings from applications config
- Fix unit test patching: patch module_utils.docker_paths_utils.get_entity_name
  instead of filter module, because imports are now bound at util level
- Add comprehensive unit tests for database lookup covering all helper-variable cases

https://chatgpt.com/share/6983b526-00dc-800f-b3a0-b71e4104d0fc
2026-02-04 22:07:42 +01:00
kevinveenbirkenbach 8a81630391 Added newline at file and POSIX compatible 2026-02-04 19:49:56 +01:00
kevinveenbirkenbach f1b5d2b764 Ruff 2026-02-03 20:21:58 +01:00
kevinveenbirkenbach 9a84fafec5 feat(inventory): add mirror_policy to control mirror image overrides
- Default policy (if_missing): manual image/version win, mirror fills blanks only
- Add mirror_policy=force to always overwrite image/version
- Add mirror_policy=skip to ignore mirror completely
- Treat empty/whitespace values as missing
- Preserve non-image/version service keys
- Extend unit tests to cover all mirror policy scenarios

https://chatgpt.com/share/6981036a-7e40-800f-b43e-13c66cc55fac
2026-02-02 21:04:53 +01:00
kevinveenbirkenbach a70a033864 feat(inventory): add --mirror support to override docker images from mirrors file
- add --mirror flag to inventory creator
- resolve mirrors.yml automatically or via explicit path
- apply mirror overrides to applications.*.docker.services.* (image/version only)
- keep existing host_vars keys untouched
- add unit tests for mirror override behavior

https://chatgpt.com/share/6980cdb1-1e5c-800f-b25f-a1af757e4239
2026-02-02 17:15:30 +01:00
kevinveenbirkenbach 76c614541f refactor(funkwhale): drop get_docker_image filter and switch to service-based image config
- Remove deprecated get_docker_image filter plugin and its unit tests
- Restructure Funkwhale docker config to use docker.services.<name>.image/version
- Introduce explicit FUNKWHALE_*_IMAGE and *_VERSION vars for clarity
- Update docker-compose template to use explicit image:version variables
- Align Funkwhale role with unified service-based Docker config model
2026-02-02 00:58:43 +01:00
kevinveenbirkenbach 6953e502ee fix(docker-compose-ca): escape $ vars in generated override commands
Prevent host-side Docker Compose interpolation from turning `$VAR` into an empty string by replacing `$` with `$$` in injected command argv, avoiding `exec ""` crashes; add unit tests for escaping behavior.

https://chatgpt.com/share/697f5e84-dea8-800f-b09e-58b3496250f3
2026-02-01 15:08:53 +01:00
kevinveenbirkenbach 7eb33408f3 fix(docker-compose-ca): support distroless images in CA override generator
https://chatgpt.com/share/697f2b57-7768-800f-a135-b9b7ee3ba474
2026-02-01 11:30:40 +01:00
kevinveenbirkenbach 18c971b7b0 fix(docker-compose-ca): build shared local images when referenced by non-build services
https://chatgpt.com/share/697e9aaf-f894-800f-b3c9-bdbdf2ea0d87
2026-02-01 01:13:25 +01:00
kevinveenbirkenbach 7fc125ecd5 test(compose): enforce image or merge key when build template is used
- Add integration test ensuring docker-compose.yml.j2 services that include build.yml.j2
  also define an image tag or YAML merge (<<:) at the same level
- Fix false positives by allowing image inheritance via anchors
- Add explicit custom image variables for littlejs and roulette-wheel services
- Minor formatting cleanup

https://chatgpt.com/share/697e8c69-0298-800f-ab25-2f650d6e7df9
2026-02-01 00:12:33 +01:00
kevinveenbirkenbach 5748fd30eb fix(sys-svc-docker): pull missing images before entrypoint inspect
https://chatgpt.com/share/697e893f-ab5c-800f-94de-52392369033e
2026-01-31 23:59:03 +01:00
kevinveenbirkenbach b3e8626632 docker-compose: make --chdir/--project optional; add wrapper unit tests
- Default --chdir to cwd when omitted
- Default --project to basename of chdir when omitted
- Resolve chdir path for stable behavior
- Add unit tests covering defaults, overrides, and passthrough "--" handling
- Rename test file to test_compose.py

https://chatgpt.com/share/697e35a5-14c8-800f-a00a-24c9d22a68a7
2026-01-31 18:02:19 +01:00
kevinveenbirkenbach 76d09dbc3f refactor: centralize docker wrappers, CA injection paths, and update tests
Unify compose/run wrappers under PATH_* variables, wire CA trust injection
consistently, extend with NSS/Chromium support, and adapt unit tests to the
new run-based execution model.

https://chatgpt.com/share/697e1f92-bc5c-800f-968d-ad43c50afaea
2026-01-31 17:06:09 +01:00
kevinveenbirkenbach aef99bf64e test(nginx_paths): mock tls_resolve lookup for protocol resolution
https://chatgpt.com/share/697ddc45-893c-800f-9c6d-ee899e4851cc
2026-01-31 11:40:21 +01:00
kevinveenbirkenbach ea8fbbdd71 fix(tls): resolve domains via app canonicals/aliases
- add module_utils/domain_mapper to map domains (canonical/aliases) -> application_id
  supporting str/list/dict and nested structures
- extend tls_common.resolve_term to optionally resolve alias domains via applications
  while keeping legacy lookup via global domains mapping intact
- pass applications into tls_resolve and cert_plan
- add unit tests for domain_mapper

https://chatgpt.com/share/697d500f-b884-800f-ba5b-088a2340f9d6
2026-01-31 01:42:43 +01:00
kevinveenbirkenbach c24b1044ae fix(domains): respect AUTO_BUILD_ALIASES when generating redirect mappings
- Do not auto-generate default alias (<entity>.<primary>) when AUTO_BUILD_ALIASES is false
- Only use explicitly defined aliases unless auto-build is enabled
- Treat empty server.domains as opt-out when auto-build is disabled
- Update unit tests to reflect strict alias semantics
- Clarify behavior with inline documentation and comments

https://chatgpt.com/share/697d4994-7690-800f-8987-296ce7215559
2026-01-31 01:15:11 +01:00
kevinveenbirkenbach 82e2cde747 refactor(nginx): replace NGINX vars with nginx_paths lookup and add http/https support
- Drop legacy NGINX path definitions from group_vars
- Add nginx_paths lookup plugin (paths + ensure dirs + http_includes)
- Update roles/templates to use nginx_paths for config/data/cache/user paths
- Add per-domain HTTP->HTTPS redirect + ACME challenge include
- Add unit tests for nginx_paths lookup
- Clean up obsolete sys-svc-letsencrypt role files

https://chatgpt.com/share/697d4466-af54-800f-a243-b28367638c85
2026-01-31 00:52:42 +01:00
kevinveenbirkenbach 3921306f11 fix(docker-compose): only pass --env-file to CA inject when file exists
The compose_ca_inject_cmd lookup previously appended --env-file
whenever docker_compose.files.env was set, even if the file did not
exist. This caused compose_ca_inject.py to fail hard.

Changes:
- Add existence check for env file using pathlib.Path.is_file()
- Resolve relative env paths against the compose instance directory
- Mirror existing handler behavior for --env-file handling
- Extend unit tests to cover both present and missing env-file cases
- Keep existing test coverage intact while adapting expectations

This aligns CA injection behavior with all other docker-compose handlers.

https://chatgpt.com/share/697d22a2-53c4-800f-9663-19a04f0587f6
2026-01-30 22:28:53 +01:00
kevinveenbirkenbach 2e7e31ba05 refactor: rename infinito-compose to compose-base and fix wrapper usage in cert deploy
- Rename infinito-compose wrapper to compose-base across roles and tests
- Introduce DOCKER_CMD_BASE as global base command configuration
- Update sys-ctl-mtn-cert-deploy to use compose_cmd consistently
- Fix compose wrapper argument parsing by enforcing "--" passthrough
- Harden project name resolution for trailing-slash instance paths
- Align docker restart helper scripts with compose-base naming
- Update unit tests to reflect renamed wrapper and new paths

https://chatgpt.com/share/697cf057-bd04-800f-9117-c007088f7fb8
2026-01-30 18:54:22 +01:00
kevinveenbirkenbach 2678090934 feat(ca-trust): unify trust injection + strict templating
Move `with-ca-trust.sh` to `sys-ca-selfsigned` as the single source of truth, add `CA_TRUST_NAME`/`trust_name`, and pass it through `compose_ca_inject.py` + `compose_ca_inject_cmd`. Introduce `module_utils/templating.py` for strict multi-pass rendering with fallback env lookup, update TLS self-signed regen logic, purge script, and extend unit tests accordingly.

https://chatgpt.com/share/697c876d-7140-800f-9981-762dfeeafdfe
2026-01-30 11:26:46 +01:00
kevinveenbirkenbach aedce7a9cd feat(tls): make global self-signed SANs strictly driven by CURRENT_PLAY_DOMAINS_ALL
cert_plan now requires CURRENT_PLAY_DOMAINS_ALL to be a non-empty list of strings when TLS_SELFSIGNED_SCOPE=global and uses it directly for SAN generation. Update unit tests to cover the strict contract and validation errors.

https://chatgpt.com/share/697bc866-0558-800f-8f2c-08ec84190a68
2026-01-29 21:51:23 +01:00
kevinveenbirkenbach fb53387384 feat(docker-compose-ca): inject CA trust for all compose services incl. profile-only ones
compose_ca_inject now discovers profiles from compose files, merges services from default + each profile config, and ensures missing images are built/pulled before inspecting entrypoint/cmd. Tests were updated to cover entrypoint normalization and the new profile-scan behavior.
2026-01-29 20:37:18 +01:00
kevinveenbirkenbach e9a6a952c5 refactor(compose): move compose_f_args lookup to top-level and update usages
- Relocate compose_f_args lookup plugin to lookup_plugins/
- Update docker compose commands to use canonical -f argument resolver
- Fix unit test import path after lookup relocation

https://chatgpt.com/share/697ba25e-b038-800f-9419-84cd575c8c0a
2026-01-29 19:09:23 +01:00
kevinveenbirkenbach b97cbef03f refactor(compose): derive project from application_id and unify compose -f resolution
Remove project kwarg from compose_ca_inject_cmd, derive entity name internally,
and reuse compose_f_args with include_ca=false for bootstrap consistency.
Add include_ca flag to compose_f_args and update unit tests accordingly.

https://chatgpt.com/share/697b9d97-0cf0-800f-805d-7e8308b6f832
2026-01-29 18:48:53 +01:00
kevinveenbirkenbach 4a5736615f Solved falsy file paths 2026-01-29 17:43:22 +01:00
kevinveenbirkenbach 8bff1b984d refactor(jinja): add strict recursive renderer and use in tls/compose lookups
Introduce module_utils/jinja_strict.py to render nested Jinja-in-vars with hard-fail semantics. Refactor cert_plan, compose_f_args, and compose_ca_inject_cmd to use render_strict so no "{{ ... }}" leaks into generated paths/commands, and add unit tests.

https://chatgpt.com/share/697b8e1b-54fc-800f-b895-7161f00ebd51
2026-01-29 17:42:28 +01:00
kevinveenbirkenbach b2fb72d112 feat(tls): split TLS settings to 02_tls and add self-signed root CA role
Move TLS/ACME/CA vars out of 00_general into group_vars/all/02_tls.yml and renumber subsequent group_vars files. Add sys-ca-selfsigned to generate /etc/<software>/ca/root-ca.crt and make docker-compose-ca depend on it. Update setup script, templates, and tests to use the new applications/users file numbering.

https://chatgpt.com/share/697b8150-22ac-800f-98b1-e063a659b684
2026-01-29 16:48:03 +01:00
kevinveenbirkenbach a354578844 feat(tls): expand Jinja paths inside cert_plan lookup
cert_plan now strictly renders Jinja-containing path variables (e.g. TLS_SELFSIGNED_BASE_PATH / LETSENCRYPT_LIVE_PATH) using hostvars context and fails fast if markers remain. Add unit tests covering successful expansion, hostvars precedence, and hard-fail behavior when variables are missing or Jinja leaks through. Include SOFTWARE_NAME in constructor debug output for easier runtime inspection.

https://chatgpt.com/share/697b73c6-f5f8-800f-96cc-e360a137e7a7
2026-01-29 15:50:32 +01:00
kevinveenbirkenbach 5ca6ecd3d7 fix(dotenv): escape $ for docker compose env interpolation
Ensure dotenv_quote escapes `$` as `$$` so secrets are not
expanded by docker compose when rendered into .env files.

Add unit tests covering $, quotes, backslashes, unicode and
edge cases to prevent regressions.

https://chatgpt.com/share/6977825f-d8f8-800f-bafb-aae3b3704945
2026-01-26 16:03:36 +01:00
kevinveenbirkenbach 7a590a3ae5 set hunspell to pre-alpha 2026-01-25 14:51:27 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI 5e2b697fe1 Potential fix for code scanning alert no. 174: Jinja2 templating with autoescape=False
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-01-25 14:41:18 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI 620ec7e1c0 Potential fix for code scanning alert no. 136: Empty except
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-01-25 11:28:43 +01:00
kevinveenbirkenbach 84397d01c3 feat(sys-ctl-hlth-csp)!: build URL targets from nginx listen directives
Switch CSP health crawler to URL-only mode by deriving http/https from each
nginx .conf (listen 80/443/ssl) and passing full URLs to csp-checker.
Update unit tests accordingly.

BREAKING CHANGE: sys-ctl-hlth-csp now passes full URLs instead of domains.

https://chatgpt.com/share/69756136-e658-800f-9e52-7d9c4a79d026
2026-01-25 01:42:44 +01:00
kevinveenbirkenbach 33a4b2a430 **feat(web-app-keycloak): add kcadm noisy-JSON helper and remove jq/--query usage**
Introduces role-local `kcadm_json` filter + `module_utils/kcadm_json.py` to reliably parse kcadm output with JVM noise, and reuses it in `keycloak_kcadm_update` and LDAP/RBAC/recaptcha tasks to eliminate jq/`--query`. Also refactors LDAP groups.path handling via `include_tasks` to avoid repeated `when` conditions and adds unit tests for filter/module utils/library behavior.

https://chatgpt.com/share/69743d89-b1c0-800f-b571-90f64605dfe4
2026-01-24 04:33:14 +01:00
kevinveenbirkenbach 35c1d29a88 fix(docker-compose): remove has_domain filter dependency from compose_f_args
Make has_domain filter self-contained (no module_utils/sys.path hacks) and let compose_f_args detect domains internally to avoid missing-filter failures. Adjust unit tests accordingly and increase Mailu user creation retry delay.

https://chatgpt.com/share/6973e02e-f22c-800f-aae3-1f57637a746c
2026-01-23 21:54:55 +01:00
kevinveenbirkenbach d971fd0fd6 fix(docker-compose): make compose_f_args role-aware for override + domain-aware for TLS
https://chatgpt.com/share/6973d900-93f4-800f-8d54-08c21f4a8f58
2026-01-23 21:24:27 +01:00
kevinveenbirkenbach 204c028d6a feat(domains): add has_domain filter and guard self-signed CA handling
- introduce has_domain filter reusing get_domain logic
- prevent self-signed CA role execution if no domain is defined
- add unit tests for has_domain filter

https://chatgpt.com/share/6973cdf7-f7fc-800f-901b-4de186a3637c
2026-01-23 20:37:22 +01:00
kevinveenbirkenbach 8e68dd5c1b feat(docker-compose): add infinito-compose wrapper and switch repair scripts to it
Deploy /usr/local/bin/infinito-compose to auto-detect .env and compose override files.
Refactor sys-ctl-rpr-docker-{hard,soft} to use the wrapper consistently.
Update unit tests to match wrapper-based command building.

https://chatgpt.com/share/6973c64c-b560-800f-8915-cbb786c51714
2026-01-23 20:04:38 +01:00
kevinveenbirkenbach 4dbbcec106 feat(docker-compose): add dynamic CA trust injection for self-signed TLS
Introduce docker-compose-ca role with CA wrapper and inject script, add CA-aware compose override handling, and refactor compose pull/run logic to support multi-file projects. Update handlers, lookups, paths, and unit tests to consistently resolve TLS-driven CA injection without implicit defaults.

https://chatgpt.com/share/6973c00c-139c-800f-8ddb-e7d0cf5043fc
2026-01-23 19:36:55 +01:00
kevinveenbirkenbach c3c54ce043 refactor(tls): split resolution and certificate planning, add global self-signed SAN support
- Extract shared TLS logic into module_utils/tls_common
- Introduce cert_plan lookup for certificate paths and SAN computation
- Simplify tls_resolve to strict protocol/port/domain resolution only
- Add global self-signed certificate scope covering all domains
- Mount self-signed cert base into OpenResty container
- Update Nginx templates to use cert_plan for ssl_certificate paths
- Add comprehensive unit tests for tls_common, tls_resolve, and cert_plan

https://chatgpt.com/share/6972c568-9e8c-800f-b89a-a0061966f9a8
2026-01-23 01:48:31 +01:00
kevinveenbirkenbach 5e25e5859c refactor(web-app-desktop): derive card URLs via tls_resolve instead of WEB_PROTOCOL
- Remove legacy WEB_PROTOCOL dependency from docker_cards lookup
- Build application URLs using strict tls_resolve lookup
- Align desktop card URL generation with new TLS layer
- Update unit tests to stub tls_resolve and validate TLS-based behavior
- Drop WEB_PROTOCOL-related test cases

https://chatgpt.com/share/6972b832-8284-800f-8b86-f1a32061c09f
2026-01-23 00:52:14 +01:00