Commit Graph
414 Commits
Author SHA1 Message Date
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 117b132556 fix(mailu): make user creation idempotent and harden password handling
- rename mailu_password to mailu_user_password for clarity
- switch to shell execution to support proper argument quoting
- define correct changed_when/failed_when based on Mailu CLI behavior
- tolerate duplicate-user errors without failing the run

https://chatgpt.com/share/6974adda-1808-800f-8204-40d94a908bd0
2026-01-24 12:32:28 +01:00
kevinveenbirkenbach 54c75725ed fix(mailu): remove retries/until from user and password management tasks
The Mailu CLI commands are synchronous and deterministic.
Removing retries/until prevents failures caused by skipped tasks
without rc/stderr fields.

https://chatgpt.com/share/6974403a-8624-800f-b423-4656539b7fef
2026-01-24 04:44:51 +01:00
kevinveenbirkenbach edd7660fc9 **fix(mailu): pass passwords starting with “-” safely to CLI**
* Add `--` end-of-options marker to Mailu `flask mailu user/password` commands so passwords like `-C...` aren’t parsed as flags.
* Update `inventory.sample.yml` example password accordingly.

https://chatgpt.com/share/69741500-abb4-800f-a922-087a552ba49d
2026-01-24 01:40:27 +01:00
kevinveenbirkenbach f4b342ef34 Optimized timings 2026-01-23 21:57:50 +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 0b9f71463c refactor(tls): replace legacy tls filters with strict tls_resolve lookup
- Remove deprecated filter_plugins/tls.py and all dependent filters
- Introduce strict lookup plugin lookup_plugins/tls_resolve.py as single TLS authority
- Migrate all roles, templates, vars, and tasks to use tls_resolve (protocols, ports, URLs, cert paths)
- Enforce explicit TLS context (domains, applications, TLS_ENABLED, TLS_MODE)
- Support letsencrypt and self_signed with SAN handling and per-app overrides
- Update TLS provider roles to assert resolver state instead of setting facts
- Add comprehensive unit tests for tls_resolve lookup

https://chatgpt.com/share/6972b49b-b074-800f-a323-dd9fe69d02eb
2026-01-23 00:36:46 +01:00
kevinveenbirkenbach 9fdb0cddd0 Replace global WEB_PROTOCOL / WEB_PORT / WEBSOCKET_PROTOCOL logic
with explicit per-application TLS resolution.

Key changes:
- Introduce sys-front-tls-layer as the single TLS abstraction
- Centralize certificate paths via TLS_CERT_FILE / TLS_KEY_FILE / TLS_CA_FILE
- Replace sys-svc-letsencrypt SSL templates with generic TLS layer includes
- Add tls_* Jinja filters (enabled, mode, protocol, port, websocket)
- Resolve TLS mode per application (letsencrypt | self_signed | off)
- Remove implicit defaults and WEB_* globals to fail fast on misconfiguration
- Support self-signed certificates with SAN awareness
- Make TLS behavior explicit and consistent across all roles

This decouples application logic from certificate providers and
allows switching TLS flavor without touching app roles.

https://chatgpt.com/share/69727c61-8e68-800f-a267-473a7e627978
2026-01-22 20:36:49 +01:00
kevinveenbirkenbach 6767fb0960 Optimized configuration path 2026-01-18 18:02:50 +01:00
kevinveenbirkenbach 66aec3b577 refactor(docker-compose): generate volumes via compose_volumes filter
Replace legacy volumes*.yml.j2 includes with the new compose_volumes filter across roles.
Add YAML-safe serialization for Ansible/Jinja proxy types to avoid PyYAML representer errors.
Remove obsolete volumes templates and extend unit tests to enforce required database_volume behavior.

https://chatgpt.com/share/696c2722-fd30-800f-bf01-dfcd3cb7ba72
2026-01-18 01:19:31 +01:00
kevinveenbirkenbach 95e3823d2f refactor: centralize token store init and allow Mailu 301 status checks
- move sys-token-store initialization to constructor stage
- remove duplicate token store includes from frontend and app roles
- allow Mailu reachability check to accept configurable status codes (200, 301)
- make Mailu health check consistent with web-app-mailu config
- increase test-local-rapid verbosity for better diagnostics

https://chatgpt.com/share/696c0f49-7888-800f-8175-fb21893c0d67
2026-01-17 23:37:54 +01:00
kevinveenbirkenbach 750da97cc6 vars:
MAILU_DOCKER_DIR:    "{{ docker_compose.directories.instance }}"
  mailu_api_base_url:  "http://127.0.0.1:8080/api/v1"
  mailu_action: >-
    {{
      ('administrator' in (user_item.value.get('roles', [])))
      | ternary('admin','user')
    }}
  mailu_user_key:      "{{ user_item.key }}"
  mailu_user_name:     "{{ user_item.value.username }}"
  mailu_password:      "{{ user_item.value.password }}"
  mailu_token_ip:      "{{ user_item.value.ip | default(networks.internet.ip4) }}"
  mailu_token_name:    "{{ SOFTWARE_NAME ~ ' Token for ' ~ user_item.value.username }}"
  mailu_user_roles:    "{{ user_item.value.roles | default([]) }}"
loop: "{{ users | dict2items }}"
loop_control:
  loop_var: user_item

https://chatgpt.com/share/696be309-fb4c-800f-8f28-de22276d2f53
2026-01-17 20:28:46 +01:00
kevinveenbirkenbach c104867735 Changed License to Infinito.Nexus Community License (Non-Commercial) 2026-01-17 18:26:05 +01:00
kevinveenbirkenbach e4c254ace1 feat(mailu): add retry logic for user creation via flask admin 2026-01-17 14:49:26 +01:00
kevinveenbirkenbach e0d3811c01 Retry 'Change password for user' 2026-01-17 14:41:31 +01:00
kevinveenbirkenbach b9a1965cf9 web-app-mailu: wait for API token endpoint to become available
Add retries with delay when fetching existing API tokens via Mailu API
to handle slow container startup and avoid race conditions.

https://chatgpt.com/share/696b8e81-1638-800f-84db-6999297491ae
2026-01-17 14:28:11 +01:00
kevinveenbirkenbach d6335f6d22 mailu: unify hostname handling and switch to canonical SYSTEM_EMAIL_HOST
- Use SYSTEM_EMAIL_HOST as single canonical Mailu hostname
- Remove MAILU_HOSTNAMES list handling and related assertion
- Simplify Mailu env HOSTNAMES to single hostname
- Align Mailu server domain config with primary mail domain
- Ensure consistent hostname resolution across email + web services

https://chatgpt.com/share/696ac991-db50-800f-9d3c-ca41bdb7058a
2026-01-17 00:28:14 +01:00
kevinveenbirkenbach 989c0c0fa2 refactor(stacks): merge stateful/stateless backend+full stacks into sys-stk-backend/sys-stk-full
- Replace sys-stk-back-stateful + sys-stk-back-stateless with unified sys-stk-backend role
- Replace sys-stk-full-stateful + sys-stk-full-stateless with unified sys-stk-full role
- Add reusable task helpers: _load_service.yml (optional deps) and 01_database.yml (DB bootstrap)
- Switch optional dependency loading (OpenLDAP, Ollama) to service_load_enabled (enabled && shared) + run_once guard
- Remove legacy OLLAMA_LOCAL_ENABLED flag; rely on docker.services.ollama.enabled/shared config
- Update all affected app/service roles and web-app template to use new stack role names

https://chatgpt.com/share/69685fb2-cb1c-800f-a9e8-2f5f765a1a53
2026-01-15 04:31:54 +01:00
kevinveenbirkenbach 482a9eb65c test(mailu): disable webmail healthcheck in MODE_TEST for local act runs
Disable the Mailu webmail healthcheck when MODE_TEST is enabled to avoid
local AppArmor and startup timing issues on Manjaro during act-based CI
runs. This keeps production and GitHub CI behavior unchanged while
allowing reliable local testing.

Also introduce MODE_TEST flag in inventory and modes configuration.

https://chatgpt.com/share/6965806a-daa0-800f-ad9a-28ddf1c8eabc
2026-01-13 00:14:38 +01:00
kevinveenbirkenbach 054810050d refactor(features): migrate feature flags to docker.services and update AI and LDAP network wiring
* Move top-level features flags to docker.services.<feature>.enabled
* Replace features.local_ai with docker.services.ollama.shared for central AI networking
* Switch central LDAP network gating from docker.services.ldap.enabled to docker.services.ldap.shared
* Add per-app service feature entries like css, javascript, hcaptcha, recaptcha under docker.services
* Update Gitea to use derived GITEA_LDAP_ENABLED and adjust IAM conditions

https://chatgpt.com/share/69641f2f-5d6c-800f-8927-fdb3580e7964
2026-01-11 23:07:25 +01:00
kevinveenbirkenbach 04c9490745 Solved unit and integration tests 2026-01-10 13:07:12 +01:00
kevinveenbirkenbach 0208f9f29c Optimized OAuth2 2026-01-10 11:57:57 +01:00
kevinveenbirkenbach 84623d713e Refactored simpleicons and oidc 2026-01-10 11:16:45 +01:00
kevinveenbirkenbach e2bf636ba9 Changed features structure 2026-01-10 11:13:29 +01:00
kevinveenbirkenbach c02ac72a16 fix(mailu): handle optional user roles safely
- Make user roles optional and default to empty list
- Avoid failures when roles key is missing or null
- Centralize role-based logic via mailu_user_roles
- Ensure admin/user action selection remains consistent

https://chatgpt.com/share/695ea61f-2fc8-800f-adba-60b2f12763e8
2026-01-07 19:29:31 +01:00
kevinveenbirkenbach 8d3e8d0b73 feat(email): unify SYSTEM_EMAIL_* vars and improve msmtp/postfix local delivery
- Replace DEFAULT_SYSTEM_EMAIL merge with flat SYSTEM_EMAIL_* variables
- Update templates across apps to new variable names
- Fix msmtp health check to use -t and local username fallback
- Improve postfix localhost config (localdomain, mydestination, timeouts)
- Extend sys-hostname to ensure /etc/hosts mapping once

https://chatgpt.com/share/695e8f39-0694-800f-b91c-a74f4b78d7c8
2026-01-07 17:52:04 +01:00
kevinveenbirkenbach dd729fd35d Introduced lifecycle into meta/main.yml roles 2026-01-06 14:42:52 +01:00
kevinveenbirkenbach d7a5c8d9ca Added YAML Output for Ansible
https://chatgpt.com/share/695bb21c-a83c-800f-baae-90ef7442c0b3
2026-01-05 13:44:05 +01:00
kevinveenbirkenbach 93f09ac0a7 feat(token-store): hydrate runtime tokens + unify Matomo token usage
**Body**

* add sys-token-store filter plugin to hydrate users.*.tokens from persisted store (users win if non-empty)
* load token store during sys-token-store core run and inject hydrated tokens into users fact
* remove legacy lookup task and simplify docs + store path naming
* switch Matomo frontend injection to use hydrated users.administrator.tokens[web-app-matomo] directly
* ensure Mailu token handling uses sys-token-store write task and checks token presence via users.*.tokens
* add unittest for token hydration filter plugin with path-based module loading
2025-12-31 13:43:29 +01:00
kevinveenbirkenbach 2de4c7d314 fix(mail): disable SMTP auth in no-TLS mode and align ports for CI/DinD
- Switch SMTP port dynamically: 465 with TLS, 25 without TLS
- Disable SMTP AUTH automatically when TLS/STARTTLS is not enabled
- Bind Mailu SMTP ports to 0.0.0.0 in Docker-in-Docker environments
- Fix boolean handling in msmtp and Mobilizon SMTP templates
- Ensure plain SMTP (no TLS, no AUTH) works reliably in CI/test setups

https://chatgpt.com/share/69540941-279c-800f-a2b1-79a189c2bdcc
2025-12-30 18:17:46 +01:00
kevinveenbirkenbach 6bc097f96f refactor(email,domain): unify primary domain and TLS handling
- replace localhost special-casing with valid FQDN (infinito.localhost)
- derive system email DOMAIN and HOST directly from DOMAIN_PRIMARY
- align Mailu TLS_FLAVOR with SYSTEM_EMAIL.TLS (mail vs notls)
- tie OIDC_VERIFY_SSL to TLS_ENABLED for consistent test/CI behavior
- update CI deploy script to use new primary domain

https://chatgpt.com/share/695311c0-fbe8-800f-8058-9d40a06b189a
2025-12-30 00:41:46 +01:00
kevinveenbirkenbach ea04035e12 feat(config): rename SSL_ENABLED to TLS_ENABLED across stack
* Replace global `SSL_ENABLED` flag with `TLS_ENABLED`
* Update web protocol/ports (http/https, ws/wss) to use `TLS_ENABLED`
* Switch cert-related roles and nginx TLS header gating to `TLS_ENABLED`
* Update app env templates (BookWyrm, Confluence, Jira, Magento, OpenProject, WordPress, etc.) to use `TLS_ENABLED`
* Adjust inventory generator to write `TLS_ENABLED` and update CLI help text accordingly
* Update unit tests for inventory vars overrides to expect `TLS_ENABLED`

https://chatgpt.com/share/695306ef-a798-800f-b118-e07b525e1811
2025-12-29 23:55:20 +01:00
kevinveenbirkenbach 75b9386b52 Solved database execute bug 2025-12-29 22:51:33 +01:00
kevinveenbirkenbach 7befda8f93 fix(mailu): wait for database schema before creating users
- add explicit wait task for Mailu DB initialization (domain table)
- fail fast with last 300 lines of admin container logs if schema is missing
- prevent race condition between container startup and user creation
- rename manage_user task to keep execution order explicit

https://chatgpt.com/share/6952f1e3-3690-800f-950d-3ce55e90b6b4
2025-12-29 22:25:46 +01:00
kevinveenbirkenbach ffea6535b1 cleanup(mailu): remove unused DKIM schema entry and hard restart todo
- drop unused credentials.dkim_public_key from schema (runtime-generated only)
- switch Mailu API token to alphanumeric with stronger validation
- remove obsolete hard-restart todo entry

https://chatgpt.com/share/6952e8dd-fee8-800f-989d-5268b33caf02
2025-12-29 21:47:20 +01:00
kevinveenbirkenbach e846766b73 backup: switch docker-to-local backups to dump-only and disable redis backups
- run baudolo with explicit --backups-dir and --dump-only
- disable backup for redis services across all web-app roles
- minor formatting cleanup in system service configuration

https://chatgpt.com/share/6951ad3b-b5b8-800f-a84c-e6ca1e98933e
2025-12-28 23:20:38 +01:00
kevinveenbirkenbach 17cba11c99 Optimized administrator integration 2025-12-24 16:47:51 +01:00
kevinveenbirkenbach 1f29519624 centralize system email domain and remove hardcoded admin emails
- derive internal email domain with .localdomain fallback for localhost
- ensure valid email domains for local installations
- remove hardcoded administrator emails from all roles
- prepare roles to consume centrally defined system email settings

https://chatgpt.com/share/694c05d5-e8c0-800f-8d86-602aaa82be21
2025-12-24 16:25:06 +01:00
kevinveenbirkenbach 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
kevinveenbirkenbach 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
kevinveenbirkenbach 986f959696 Refactor webserver proxy variables and fix BigBlueButton deployment behavior
Refactor proxy/webserver configuration variables to a consistent webserver_* naming scheme across roles. Replace legacy variables like proxy_extra_configuration, client_max_body_size, vhost_flavour, location_ws and ws_port with webserver_extra_configuration, webserver_client_max_body_size, webserver_vhost_flavour, webserver_websocket_location and webserver_websocket_port. Update NGINX vhost and location templates (html, upload, ws, basic, ws_generic) as well as callers (sys-front-inj-all, sys-stk-front-proxy, various web-app-* and web-svc-* roles) to use the new naming.

Tighten docker-compose Git repository handling by making docker_git_repository_pull depend on docker_git_repository_address being defined, a string and non-empty. This avoids accidental Git operations when the repository address is unset or of the wrong type.

Refactor the BigBlueButton role structure and fix deployment bugs: introduce 01_core.yml to orchestrate docker/proxy setup, database seeding, websocket map deployment, docker-compose overrides and admin/bootstrap logic in a single once-executed entrypoint. Rename supporting task files (02_docker-compose.yml, 03_administrator.yml, 04_dependencies.yml) and update tasks/main.yml to delegate via include_tasks with run_once_web_app_bigbluebutton. Improve Greenlight admin creation behavior by treating the 'Email has already been taken' error as a non-fatal, unchanged outcome and running user:set_admin_role as a fallback, both for the primary password and the OIDC starred-password path.

Also standardize vhost flavour selection for services like Mailu, Discourse, CDN, Collabora, Coturn, OnlyOffice, Simpleicons and web-svc-logout by explicitly passing webserver_vhost_flavour where needed and aligning client_max_body_size and websocket configuration with the new webserver_* variables.

Reference: ChatGPT conversation https://chatgpt.com/share/6931c530-bba8-800f-9997-dd61dc1d497b
2025-12-04 18:31:09 +01:00
kevinveenbirkenbach fc0bdbea9a Implemented SSL_ENABLED 2025-12-04 10:48:45 +01:00
kevinveenbirkenbach 298ba80664 Added explicit variable names 2025-12-03 19:13:06 +01:00
kevinveenbirkenbach 716ebef33b Refactor task includes and update variable handling for Ansible 2.20 migration
This commit updates multiple roles to ensure compatibility with Ansible 2.20.
Several include paths and task-loading mechanisms required adjustments,
as Ansible 2.20 applies stricter evaluation rules for complex Jinja expressions
and no longer resolves certain relative include paths the way Ansible 2.18 did.

Key changes:
- Replaced legacy once_finalize.yml and once_flag.yml with the new structure
  under tasks/utils/once/finalize.yml and tasks/utils/once/flag.yml.
- Updated all include_tasks statements to use 'path_join' with playbook_dir,
  ensuring deterministic and absolute file resolution across roles.
- Fixed all network helper includes by converting direct relative paths such as
  'roles/docker-compose/tasks/utils/network.yml' to proper Jinja-evaluated paths.
- Normalized MATOMO_* variable names for consistency with the updated variable
  scope behavior in Ansible 2.20.
- Removed deprecated patterns that were implicitly supported in Ansible 2.18
  but break under the more strict variable and path resolution model in 2.20.

These changes are part of the full migration step required to ensure the
infinito-nexus roles remain stable, deterministic, and forward-compatible with
Ansible 2.20.

Details of the discussion and reasoning can be found in this conversation:
https://chatgpt.com/share/69300a8d-24d4-800f-bec0-e895a695618a
2025-12-03 11:02:34 +01:00
kevinveenbirkenbach e09f561f0b Refactor run-once orchestration and bootstrap Mailu/Mastodon in a single deploy
- Replace legacy utils/run_once.yml with the new helpers utils/once_flag.yml and utils/once_finalize.yml
- Introduce utils/compose_up.yml to ensure docker-compose stacks are up and to flush handlers safely without coupling to run-once flags
- Migrate all affected roles (desk-*, dev-*, sys-ctl-*, sys-svc-*, web-app-*, web-svc-*, util-*) to the new run-once helpers
- Rework sys-svc-msmtp to auto-load Mailu once per deploy, check reachability, and reuse the running stack instead of requiring multiple playbook passes
- Adjust web-app-mailu to integrate cert deployment, handler flushing, and run-once handling so Mailu is fully initialized in a single deploy
- Improve Matomo, CDN, logout and CSP/health-check related roles to cooperate with the new compose_up / once_* pattern
- Simplify alarm/backup/timer/service orchestration (sys-ctl-alm-*, sys-bkp-provider, sys-timer-cln-bkps, etc.) by moving run-once logic into dedicated 01_core.yml files
- Update integration tests so utils/once_flag.yml and utils/once_finalize.yml are recognised as valid run-once providers, keeping the global run_once_* guarantees consistent
- Align frontend injection and service dependencies so Mastodon- and Mailu-related services can be brought up coherently within a single deployment cycle rather than several iterations
2025-12-01 13:30:50 +01:00
kevinveenbirkenbach bee833feb4 Introduce deterministic CSS gradient angle and shared color palette facts
This ensures CSS output remains stable between runs, preventing unnecessary OpenResty restarts for every service caused by randomized gradients or regenerated CSS files.

Ref: https://chatgpt.com/share/69281d4b-2488-800f-8c0c-c0db44810d1d
2025-11-27 10:44:01 +01:00
kevinveenbirkenbach 57d5269b07 CSP (Safari-safe): merge -elem/-attr into base; respect explicit disables; no mirror-back; header only for documents/workers
- Add CSP3 support for style/script: include -elem and -attr directives
- Base (style-src, script-src) now unions elem/attr (CSP2/Safari fallback)
- Respect explicit base disables (e.g. style-src.unsafe-inline: false)
- Hashes only when 'unsafe-inline' absent in the final base tokens
- Nginx: set CSP only for HTML/worker via header_filter_by_lua_block; drop for subresources
- Remove per-location header_filter; keep body_filter only
- Update app role flags to *-attr where appropriate; extend desktop CSS sources
- Add comprehensive unit tests for union/explicit-disable/no-mirror-back

Ref: https://chatgpt.com/share/68f87a0a-cebc-800f-bb3e-8c8ab4dee8ee
2025-10-22 13:53:06 +02:00
kevinveenbirkenbach 087175a3c7 Solved mailu token bug 2025-10-13 10:50:59 +02:00
kevinveenbirkenbach 3da645f3b8 Mailu/MSMTP: split token mgmt, idempotent reload, safer guards
• Rename: 02_create-user.yml → 02_manage_user.yml; 03_create-token.yml → 03a_manage_user_token.yml + 03b_create_user_token.yml
• Only (re)run sys-svc-msmtp when no-reply token exists; set run_once_sys_svc_msmtp=true in 01_core
• Reset by setting run_once_sys_svc_msmtp=false after creating no-reply token; then include sys-svc-msmtp
• Harden when-guards (no '{{ }}' in when, safe .get lookups)
• Minor formatting and failed_when readability

Conversation: https://chatgpt.com/share/68ebd196-a264-800f-a215-3a89d0f96c79
2025-10-12 18:05:00 +02:00
kevinveenbirkenbach b2978a3141 Changed mailu token name 2025-10-12 14:36:13 +02:00