Commit Graph
664 Commits
Author SHA1 Message Date
kevinveenbirkenbach db8107a933 Removed deprecated test_deprecated_version_key 2026-02-02 20:12:05 +01:00
kevinveenbirkenbach 5e5a960bd8 test(integration): validate docker.services image/version syntax in role configs
Add a unittest-based integration test that scans all roles/*/config/main.yml
and validates docker.services.*.image and *.version only when present.
Ensures allowed Docker image name and tag characters without enforcing
image/version coupling.

https://chatgpt.com/share/6980cd2d-0644-800f-9e1f-0c8daa98e85c
2026-02-02 17:13:18 +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 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 06b9ccdc8e test(integration): require image tag for buildable docker-compose templates
Adds an integration test that fails when a service defines `build:` without an `image:` on the same indentation level. This enforces stable image names for tooling like CA-injection and makes compose behavior more predictable.

https://chatgpt.com/share/697bb4af-0d58-800f-8edd-aaef4c224319
2026-01-29 20:27:32 +01:00
kevinveenbirkenbach 4a5736615f Solved falsy file paths 2026-01-29 17:43:22 +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 3b1032895a feat(security): introduce sed_escape filter and enforce safe sed replacements
- add sed_escape Jinja filter for sed replacement safety
  - escapes \, &, and the active sed delimiter
  - designed explicitly for sed s/// replacement context

- patch all sed-based config updates across roles
  - espocrm, friendica, gitea, matomo, moodle, wordpress
  - ensure every Jinja value in sed replacements uses sed_escape
  - use correct delimiter-specific escaping (/, |, #)

- add robust integration test to enforce sed_escape usage
  - scans all roles/*/tasks/**/*.yml
  - detects sed substitutions with Jinja in replacement part
  - ignores delimiters inside {{ ... }} blocks
  - fails CI if sed_escape is missing

- harden repository against sed injection, delimiter breakage,
  and credential corruption in config patching tasks

https://chatgpt.com/share/6974fb45-1ee8-800f-80bd-c71122e4ac02
2026-01-24 18:02:37 +01:00
kevinveenbirkenbach 8b1ae03e77 fix(env): prevent dotenv_quote double-quoting in env.j2 templates
- Replace `"{{ ... | dotenv_quote }}"` with `{{ ... | dotenv_quote }}` across roles
- Update integration test to enforce pure Jinja + dotenv_quote and forbid wrapped quotes

https://chatgpt.com/share/6974e6c6-51b8-800f-80a1-a76f885cf57e
2026-01-24 16:35:27 +01:00
kevinveenbirkenbach d4ecd331a5 test(integration): fail on double-quoted | quote in shell password expressions
Extend password-quoting integration test to:
- fail when password variables in shell tasks miss the `| quote` filter
- fail when `| quote` is used but the Jinja expression is wrapped in quotes
  (double-quoting)

This ensures shell-safe password handling and prevents quoted secrets
from being passed literally to CLI tools.

https://chatgpt.com/share/6974dd33-9470-800f-b469-d31fabcd59e1
2026-01-24 16:03:09 +01:00
kevinveenbirkenbach dcb33e089d test(integration): enforce password quoting rules for definitions and shell tasks
- add integration test to ensure password variable definitions never use '| quote'
- add integration test to ensure password usage in shell tasks always uses '| quote'
- scope checks to roles/**.yml using regex-based best-effort parsing

https://chatgpt.com/share/6974da97-e6dc-800f-8acc-43aa45e6cf8f
2026-01-24 15:43:29 +01:00
kevinveenbirkenbach aa7d0c642c feat(dotenv): add dotenv_quote filter and enforce quoted password vars in env.j2
https://chatgpt.com/share/6974cbac-023c-800f-8198-fd85df2aa7bc
2026-01-24 15:22:19 +01:00
kevinveenbirkenbach bac0393a3e test(integration): fix false positives for applications.<attr>() and add exact error location
- Skip Python attribute matches that are used as method calls (e.g. applications.setdefault(...))
- Add line and column information to assertion errors
- Print the exact source line for faster debugging of invalid application references

https://chatgpt.com/share/697215ce-df3c-800f-b81f-641c75939e7f
2026-01-22 13:19:19 +01:00
kevinveenbirkenbach bdaac5cc90 ci(deploy): split per-app deploy into server/workstation/rest workflows (env-only defaults)
- Remove _deploy-per-app.yml (inputs-based indirection)
- Add dedicated workflows:
  - test-deploy-server.yml
  - test-deploy-workstation.yml
  - test-deploy-universal.yml (rest)
- Configure via env defaults only (KISS / SRP / SPOT)
- Update Makefile to target the new workflows and pass overrides via env
- Ensure deploy-one-app.sh is executable
- Keep failure debug (last 200 chars) and upload logs only outside act
2026-01-13 05:23:47 +01:00
kevinveenbirkenbach 8a85f7e6b1 test(filters): exclude .github directory from filter usage scan
Exclude the .github directory from template/YAML scanning to avoid
false positives from GitHub Actions expressions. Directory exclusion
is now centralized via EXCLUDE_DIRS and respects EXCLUDE_TESTS.

https://chatgpt.com/share/6965b7a8-8084-800f-a8b5-446f265d5bf2
2026-01-13 04:10:25 +01:00
kevinveenbirkenbach 48b0bbb85e test(run_once): allow per-condition opt-out via inline pass marker
Add support for ignoring individual run_once_* when-conditions if the same
line contains the marker comment:

  # pass test_run_once_suffix_matches_role

This allows intentional cross-role run_once usage (e.g. shared provider
roles) without weakening the global schema enforcement.

Also document the exception behavior directly in the test.

https://chatgpt.com/share/69653e36-c058-800f-921d-b4af9014df04

fix(openldap): make memberof/refint provisioning idempotent and robust

Refactor OpenLDAP cn=config provisioning:
- load memberof and refint modules via ldapmodify
- add overlays via ldapadd with proper error handling
- make handlers idempotent (ignore duplicate/value-exists errors)
- dynamically resolve module DN and data backend DN (mdb/hdb)
- clean up legacy LDIF definitions

This fixes rc=80 handler failures and allows safe re-runs.

https://chatgpt.com/share/69653e42-e020-800f-a6c3-9c37ec5e8028
2026-01-12 19:32:14 +01:00
kevinveenbirkenbach c9a3c811c6 feat(config): migrate docker.service flags to docker.services
* Switch feature flag paths from docker.service.<name>.enabled to docker.services.<name>.enabled
* Update CSP builder and smart-default toggles and unit tests
* Update desktop cards iframe flag and desktop domain validation
* Update logout domain filter and tests
* Update recaptcha enable flags in Keycloak and EspoCRM
* Fix sys-ctl-cln-docker meta description formatting
* Follow-up: reorder imports in web_health_expectations so module_utils path injection runs before importing get_app_conf

https://chatgpt.com/share/6963f484-4cb4-800f-a9f4-8d70a66e4d32
2026-01-11 22:27:36 +01:00
kevinveenbirkenbach 1250e94b93 fix(web-svc-html): handle missing index.html and normalize yaml formatting
- Add default status codes (403, 200) for web-svc-html to reflect missing index.html on init
- Normalize YAML formatting and ensure trailing newlines
- Fix integration test formatting for config generation
- Align vars indentation with project style

https://chatgpt.com/share/6963a552-9580-800f-b6f2-2547959d9dc8
2026-01-11 14:27:21 +01:00
kevinveenbirkenbach 66d50e2dde feat(inventory): resolve shared providers transitively and support schema-less roles
- Allow credentials generator to run for roles without schema/main.yml so
  transitive config-based generation still works.
- Make InventoryManager resilient to missing YAML by defaulting to {} and
  only loading schema when schema/main.yml exists.
- Add recursive shared-provider include resolution based on docker.services
  config and apply provider schemas/special rules transitively.
- Require database_password injection only when database.enabled=true and shared=true.
- Update unit/integration tests to create required files for .exists() checks and
  validate transitive provider role credential generation.

https://chatgpt.com/share/69639d93-4c10-800f-bc6c-8e5b9fb75088
2026-01-11 13:54:37 +01:00
kevinveenbirkenbach e4baa6d7ab Ruff 2026-01-11 01:01:44 +01:00
kevinveenbirkenbach 64cab86be3 refactor(inventory): extract secret generation into ValueGenerator and add integration test
- Move generate_value/generate_secure_alphanumeric out of InventoryManager into new ValueGenerator
- Wire InventoryManager to use self.value_generator for all secret generation
- Tighten schema include logic for shared databases: require enabled=true and shared=true
- Update unit tests to patch ValueGenerator.generate_value instead of InventoryManager.generate_value
- Add end-to-end integration test for InventoryManager using real files and a fake VaultHandler
- Remove redundant legacy unit test file and add dedicated ValueGenerator unit tests

https://chatgpt.com/share/6962d2e6-7fdc-800f-ba83-9e150b19a5f0
2026-01-11 00:56:18 +01:00
kevinveenbirkenbach 04c9490745 Solved unit and integration tests 2026-01-10 13:07:12 +01:00
kevinveenbirkenbach 0f7add0f1a Unify Mailu token handling via users[*].tokens and clean up inventory validation
- Migrate Mailu credentials from legacy mailu_token to tokens['web-app-mailu']
- Update all affected application templates to use the new token structure
- Adjust inventory validation to no longer special-case mailu_token
- Minor typing and formatting cleanups in inventory creation and tests

https://chatgpt.com/share/69554915-87c8-800f-afd5-12118dbb1107
2025-12-31 17:02:20 +01:00
kevinveenbirkenbach e4c41add54 test(integration): allow run-once flag anywhere inside run-once blocks
Relax run-once inclusion validation to accept utils/once/flag.yml
at any position within a run-once block instead of enforcing it
as the final task.

https://chatgpt.com/share/6954eba2-05c0-800f-baad-a7546d434627
2025-12-31 10:23:42 +01:00
kevinveenbirkenbach 244e56fed9 Optimized ruff 2025-12-30 19:33:00 +01:00
kevinveenbirkenbach 1a81ac69f3 Ignored diff ansible_service_mgr in tests -> Official ansible variable 2025-12-30 19:17:59 +01:00
kevinveenbirkenbach 5a74f80e85 Executed ruff 2025-12-28 15:23:07 +01:00
kevinveenbirkenbach 160642fe43 Removed unnecessary warnings 2025-12-28 11:06:21 +01:00
kevinveenbirkenbach fc1388a8e4 tests: recognize ansible.builtin.set_fact in run_once validation
The run_once integration test only detected short-form `set_fact`
and failed to recognize fully qualified module usage
(`ansible.builtin.set_fact`).

This caused false negatives for roles correctly using FQCN-compliant
Ansible syntax.

Fix:
- Accept both `set_fact` and `ansible.builtin.set_fact` when collecting
  global run_once_<suffix> definitions
- Accept both forms when detecting per-role run_once definitions
- Remove redundant prefilter token, as structural detection is sufficient

No production logic is affected.

https://chatgpt.com/share/6950fe2c-4b24-800f-9f40-85b2fed3bfba
2025-12-28 10:53:36 +01:00
kevinveenbirkenbach dcd0bed303 refactor(sys-ctl-bkp-docker-2-loc): move databases.csv permission handling to core
- Move databases.csv permission task from seed phase to core tasks
- Ensure root-only permissions are enforced early and unconditionally
- Remove custom run-once logic and related state tracking
- Simplify role logic and improve determinism
- Update run-once integration test documentation and expectations
- Add TODO to verify Docker-in-Docker behavior
2025-12-28 10:41:42 +01:00
kevinveenbirkenbach 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
kevinveenbirkenbach 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
kevinveenbirkenbach 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
kevinveenbirkenbach 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
kevinveenbirkenbach fd54faff65 refactor(ansible): replace pacman installs with package
Migrate most roles from community.general.pacman to the generic package module for better portability. Keep pacman where it is required (system upgrades and Arch-specific tasks). Split VirtualBox setup into an Arch-only task file and add a warning when skipped on non-Arch systems. Update integration test examples accordingly.

https://chatgpt.com/share/6947ce9f-3228-800f-8365-2253b5ed9451
2025-12-21 11:40:10 +01:00
kevinveenbirkenbach a354992f27 refactor(create-inventory): modularize CLI, stabilize path handling, add unit tests
- Split create-inventory logic into focused modules (cli, project, filters, host_vars, credentials, etc.)
- Replace fragile path construction with python -m module execution
- Add robust project root detection
- Centralize password generation
- Improve test coverage with per-module unit tests
- Preserve existing inventory and host_vars behavior

https://chatgpt.com/share/69471157-79c0-800f-8dec-25c0f8e38f03
2025-12-20 22:12:44 +01:00
kevinveenbirkenbach 3da6e3a23e refactor(cli): modularize dispatcher and improve command discovery
https://chatgpt.com/share/6947052d-76fc-800f-9db3-98de6894ceb0
2025-12-20 21:20:47 +01:00
kevinveenbirkenbach 7c0c1321d5 Fix Hadolint code scanning identity and apply formatting cleanups
https://chatgpt.com/share/694420ac-5d70-800f-94b8-71549893936e
2025-12-18 16:41:25 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI fda08ede8d Potential fix for code scanning alert no. 72: Empty except
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-18 16:26:43 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI b085421b14 Potential fix for code scanning alert no. 71: Empty except
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-18 16:24:50 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI f904b20f63 Potential fix for code scanning alert no. 76: Empty except
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-18 16:23:42 +01:00
kevinveenbirkenbach f7809c266e Optimized ruff 2025-12-18 14:33:54 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI 796f9961db Potential fix for code scanning alert no. 73: Empty except
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-18 14:12:44 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI 99babcd7a4 Potential fix for code scanning alert no. 74: Empty except
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-18 14:12:26 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI b8de616d4d Potential fix for code scanning alert no. 77: Empty except
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-18 14:11:43 +01:00
kevinveenbirkenbach a38f36837f style: reformat code for readability and lint compliance 2025-12-18 14:08:01 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI 4e8346ae3c Potential fix for code scanning alert no. 45: Implicit string concatenation in a list
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-18 13:49:55 +01:00
kevinveenbirkenbach 318fd8552e Merge branch 'master' of github.com:kevinveenbirkenbach/infinito-nexus 2025-12-18 13:23:19 +01:00
kevinveenbirkenbach fa08a2c245 test(integration): ensure roles including sys-service define system_service_id
https://chatgpt.com/share/6943f225-b244-800f-ab1b-8061a091750e
2025-12-18 13:22:41 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI 6fa6984c72 Potential fix for code scanning alert no. 56: Explicit returns mixed with implicit (fall through) returns
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-18 13:14:33 +01:00