Commit Graph

3000 Commits

Author SHA1 Message Date
5320a5d20c Improve infinito CLI global and full help:
- Add ANSI color fallback when colorama is missing
- Refactor global help into print_global_help() and reuse for --help and --help-all
- Enhance show_full_help_for_all() with colorful Subcommand/File headers
- Extend unit tests for global help, child sound handling, and failure loop

Reference: https://chatgpt.com/share/692e88de-39f4-800f-ab7f-5ac178698831/share/this-conversation
2025-12-02 08:17:06 +01:00
1064afc0dc Add --help-all global flag, implement full CLI help printer, extend Usage output, and add comprehensive unit tests for color_text, nested command discovery, error fallback in extract_description_via_help, and subprocess invocation in show_full_help_for_all.
Reference: https://chatgpt.com/share/692e88de-39f4-800f-ab7f-5ac178698831
2025-12-02 07:36:50 +01:00
8314d7e6a6 Refactor DB initialization handling: externalize database_init flag for svc-db-mariadb and svc-db-postgres, remove internal auto-detection, and pass explicit init signal from sys-stk-back-stateful. Improves clarity, avoids incorrect credential lookups, and stabilizes central DB setup.
Reference: ChatGPT conversation https://chatgpt.com/share/692def1c-a79c-800f-b7dd-35e1845424bf
2025-12-01 20:40:30 +01:00
116c20d61d Refactor Nextcloud fullstack and config tasks:
- Load proxy in fullstack
- Simplify config merging logic
- Improve handler flushing and container config update

Context: https://chatgpt.com/share/692dc9d4-a884-800f-85e5-e92471c7b52b
2025-12-01 18:01:25 +01:00
81c4d407a5 Solved missing Mailu Token Bug and to late reset of docker compose dirs, which let to problems in the reset deploy mode 2025-12-01 15:48:01 +01:00
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
72ede9414b Removed other blocks 2025-12-01 05:43:46 +01:00
81304934d5 Removed another block 2025-12-01 05:42:26 +01:00
c9f959058b Removed unnecessary blocks 2025-12-01 05:30:41 +01:00
d55ab2a2d7 Add WEBSERVER_CORE_APPLICATIONS and merge them into CURRENT_PLAY_APPLICATIONS
Refactored constructor logic to always include core webserver applications (web-svc-logout, web-svc-cdn) by using a dict2items → selectattr → items2dict merge pipeline.

Conversation reference: https://chatgpt.com/share/692cbd03-19d8-800f-a8a8-f42d73481a0d
2025-11-30 22:54:32 +01:00
f57ccb2dd7 Removed inj_enabled. logic 2025-11-30 22:53:06 +01:00
1e1f8e56e0 Removed uneccessary reset test 2025-11-30 22:43:08 +01:00
edec4f3722 Fix Matomo bootstrap logic and dependency ordering to prevent recursion (see conversation: https://chatgpt.com/share/692cb23b-fb3c-800f-98b6-ce7f61595305 )
This commit introduces several improvements to the Matomo initialization workflow:

- Moves the Matomo reachability check into sys-front-inj-all/tasks/01_dependencies.yml.
- Ensures web-app-matomo is only initialized when the endpoint is unreachable.
- Avoids condition inheritance on include_role by removing block-level when conditions.
- Adds explicit guarding conditions (inj_enabled.matomo, run_once_web_app_matomo usage).
- Ensures Matomo-dependent injections (CSS, Desktop, Logout, CDN) are skipped for Matomo itself.
- Fixes incorrect status_code format (now using YAML list format).
- Moves utils/run_once.yml to the top of 01_core.yml to prevent recursive re-invocation of web-app-matomo.
- Cleans Matomo config/main.yml feature definitions and clarifies which features are disabled during initial bootstrap.
- Removes legacy global Matomo bootstrap from 02_server.yml, centralizing logic in sys-front-inj-all.
- Fixes typo in inj_enabled task name.

This results in a robust, idempotent, recursion-safe Matomo bootstrap sequence that works across all injected web domains.
2025-11-30 22:08:46 +01:00
8d3874f432 Prevented the cleaning up of certs in RESET_MODE, to much certificate renewals at Letsencrypt 2025-11-30 22:05:01 +01:00
8008afe0de Refactor user variable name from OPERNLDAP_USERS to OPENLDAP_USERS and add dynamic state handling for objectClass cleanup.
See conversation: https://chatgpt.com/share/692cab28-1ce0-800f-81da-712c8ea08e5c
2025-11-30 21:38:16 +01:00
0cb9b08e8f Solved bug when openresty isn't up yet, but conf should be validated 2025-11-30 19:01:32 +01:00
fff7d261a2 Refactor run-once logic across multiple roles and integrate unified utils/run_once.yml
This commit standardizes all run-once implementations across the following roles:
- desk-git
- dev-fakeroot
- dev-git
- dev-python-yaml
- sys-lock
- sys-svc-certs (wildcard flavor)
- update-apt
- update-pacman
- update-compose
- user-root (moved logic to 01_core.yml + unified run-once handling)
- web-app-matomo
- web-svc-libretranslate

All roles now:
- Use a block guarded by 'run_once_<role>' facts
- Trigger run-once state through utils/run_once.yml
- Optionally disable handler flushing via 'flush_handlers: false'
- Achieve consistent per-host one-time execution semantics

Conversation reference: https://chatgpt.com/share/692c7fbb-ff68-800f-8cb4-4b132cffc8e4
2025-11-30 18:51:40 +01:00
e53abbec3b Refactor alarm composer and sys-service handling:
- Introduce dynamic SYSTEMCTL_ALARM_COMPOSER_SUBSERVICES based on Mailu token and MODE_RESET
- Prevent inclusion of sys-ctl-alm-email when disabled
- Add system_service_is_template flag to avoid state-setting on template services
- Update notifications to reload daemon for @ template units
- Align msmtp execution conditions

See: https://chatgpt.com/share/692c7a71-afcc-800f-8aba-6800a042ce3b
2025-11-30 18:10:30 +01:00
5a523cfe24 Prevented the setup of MSMTP when MODE_RESET 2025-11-30 17:34:56 +01:00
f19f64b1cd Set correct variable 2025-11-30 16:59:36 +01:00
e6d6cb639c Fix variable definition test: ignore boolean keywords (not/and/or) and detect bare vars in YAML list expressions. See ChatGPT conversation: https://chatgpt.com/share/692c693b-9958-800f-a815-6c15ca045108 2025-11-30 16:57:07 +01:00
007963044b refactor: centralize web front proxy and internal nginx configs
Unify reverse proxy handling across apps via sys-stk-front-proxy and cleanly separate internal docker nginx configs from external vhosts.

Changes:

- docker-compose: use with_first_found for optional env and docker-compose.override files so roles can provide either a template or a static file without noisy 'Could not find or access' failures.

- sys-stk-front-proxy: remove front_proxy_domain_conf_src and switch nginx vhost rendering to with_first_found over app-specific proxy.conf.j2 and the generic roles/sys-svc-proxy vhost flavour; keep health-check and handler logic unchanged.

- web-app-nextcloud: migrate to sys-stk-full-stateful (front proxy + DB + docker), move internal nginx config to docker.conf.j2 under the volume path, and rename host.conf.j2 to proxy.conf.j2 for the external vhost.

- web-app-magento: rename nginx.conf.j2 to docker.conf.j2 and update the runtime template task accordingly to make the intent (internal nginx) explicit.

- web-app-matrix: rename nginx.conf.j2 to synapse.conf.j2 and adjust the webserver task to use the new template name for the synapse vhost.

- web-app-bridgy-fed & web-app-flowise: pass domain and http_port explicitly when including sys-stk-front-proxy so the front stack has all required context.

- web-svc-cdn/file/html: replace direct sys-stk-front-base + sys-util-csp-cert + nginx.conf.j2 handling with sys-stk-front-proxy and proxy.conf.j2, relying on the shared front-stack for TLS/CSP/vHost wiring.

- web-svc-collabora: drop the direct nginx.conf.j2 vhost generation and rename it to proxy.conf.j2 so it is picked up by sys-stk-front-proxy like other services.

- web-opt-rdr-domains: rename redirect.domain.nginx.conf.j2 to redirect-domain.conf.j2 and adjust the task for clearer and more consistent naming.

Context: see ChatGPT refactor discussion on 2025-11-30 (proxy unification, Collabora/Nextcloud/CDN stacks, CSP/header handling): https://chatgpt.com/share/692c64ea-a488-800f-ad42-7f7692a3742f
2025-11-30 16:38:39 +01:00
5a65410dd8 Fix: Avoid loop variable collision in MinIO front-proxy include
Replaced default 'item' with explicit loop variable 'minio_proxy' to prevent
conflicts with inner roles (e.g., sys-stk-front-proxy using with_first_found).

This resolves the undefined variable error and removes the Ansible warning
about the loop variable already being in use.

Reference: https://chatgpt.com/share/692c5778-2b24-800f-b203-5b6b2c9b1d4b
2025-11-30 15:41:17 +01:00
7d0489e312 Optimized SMTP Config for Keycloak 2025-11-30 10:58:22 +01:00
f363d36a36 Keycloak UserProfile: Switch to component lookup via providerId and use structured KEYCLOAK_USER_PROFILE_CONFIG_PAYLOAD for merging kc.user.profile.config. Simplifies update logic and removes jq-based ID resolution.
See: https://chatgpt.com/share/692b97b2-7350-800f-9c2e-2672612c3b98
2025-11-30 02:03:06 +01:00
ce7347f70b Refactor Keycloak kcadm updates into custom Ansible module (see ChatGPT: https://chatgpt.com/share/692b6f0c-ebd4-800f-89e7-474d23c5dd32) 2025-11-29 23:09:34 +01:00
ece4f493d3 Add declarative UserProfileProvider update routine and improve component providerId safety check
Implements automated merging of kc.user.profile.config using the generic _update.yml handler.
Fixes missing safety guard for components without a 'name' attribute and aligns providerId validation logic.

Reference: https://chatgpt.com/share/692b3337-a224-800f-8617-32f47a5af1df
2025-11-29 18:54:17 +01:00
86760a4be7 Improve logout patch debug and tighten detection
- Add debugMode parameter to initLogoutPatch with structured console logging
- Pass MODE_DEBUG into logout_one_liner init call
- Exclude <form> elements and large text blocks from logout candidates to avoid mapping LAM user list form as logout

Ref: https://chatgpt.com/share/692b325e-37c0-800f-bb5a-129aae4c65f8
2025-11-29 18:53:03 +01:00
26dfab147d Implement reserved username handling for users, LDAP and Keycloak
Add end-to-end support for reserved usernames and tighten CAPTCHA / Keycloak logic.

Changes:

- Makefile: rename EXTRA_USERS → RESERVED_USERNAMES and pass it as --reserved-usernames to the users defaults generator.

- cli/build/defaults/users.py: propagate  flag into generated users, add --reserved-usernames CLI option and mark listed accounts as reserved.

- Add reserved_users filter plugin with  and  helpers for Ansible templates and tasks.

- Add unit tests for reserved_users filters and the new reserved-usernames behaviour in the users defaults generator.

- group_vars/all/00_general.yml: harden RECAPTCHA_ENABLED / HCAPTCHA_ENABLED checks with default('') and explicit > 0 length checks.

- svc-db-openldap: introduce OPENLDAP_PROVISION_* flags, add OPENLDAP_PROVISION_RESERVED and OPERNLDAP_USERS to optionally exclude reserved users from provisioning.

- svc-db-openldap templates/tasks: switch role/group LDIF and user import loops to use OPERNLDAP_USERS instead of the full users dict.

- networks: assign dedicated subnet for web-app-roulette-wheel.

- web-app-keycloak vars: compute KEYCLOAK_RESERVED_USERNAMES_LIST and KEYCLOAK_RESERVED_USERNAMES_REGEX from users | reserved_usernames.

- web-app-keycloak user profile template: inject reserved-username regex into username validation pattern and improve error message, fix SSH public key attribute usage and add component name field.

- web-app-keycloak update/_update.yml: strip subComponents from component payloads before update and disable async/poll for easier debugging.

- web-app-keycloak tasks/main.yml: guard cleanup include with MODE_CLEANUP and keep reCAPTCHA update behind KEYCLOAK_RECAPTCHA_ENABLED.

- user/users defaults: mark system/service accounts (root, daemon, mail, admin, webmaster, etc.) as reserved so they cannot be chosen as login names.

- svc-prx-openresty vars: simplify OPENRESTY_CONTAINER lookup by dropping unused default parameter.

- sys-ctl-rpr-btrfs-balancer: simplify main.yml by removing the extra block wrapper.

- sys-daemon handlers: quote handler name for consistency.

Context: change set discussed and refined in ChatGPT on 2025-11-29 (Infinito.Nexus reserved usernames & Keycloak user profile flow). See conversation: https://chatgpt.com/share/692b21f5-5d98-800f-8e15-1ded49deddc9
2025-11-29 17:40:45 +01:00
3b3725cbd1 Added sorted domain list to logout to make it determenistic and prevent unnecessary handler triggers 2025-11-29 14:52:45 +01:00
7fa6b2d770 Make CSP header token ordering deterministic
Sort CSP directive tokens lexicographically (keeping 'self' first) to ensure
stable, reproducible Content-Security-Policy headers and avoid spurious
Ansible changes caused by ordering-only differences. Add unit tests to verify
sorted connect-src tokens and deterministic output for unsorted whitelists.

Reference: https://chatgpt.com/share/692af53f-c3a4-800f-bd28-cc7e0b6ff7ce
2025-11-29 14:30:19 +01:00
9314cab664 Optimized domains and desktop menu order 2025-11-29 13:42:12 +01:00
03bea763f1 Ensure deterministic ordering of web health expectations and add unit tests
This update sorts all expectation keys alphabetically to guarantee idempotent
Ansible deployments and stable systemd unit generation. Added two unit tests to
validate proper key ordering for canonical domains, aliases, redirects, and WWW
mappings.

Reference: https://chatgpt.com/share/692ae99b-dd88-800f-8fad-2ff62666e295
2025-11-29 13:40:31 +01:00
1129b943fc Added --diff option for deploy to check file differences 2025-11-29 13:31:48 +01:00
e754df7e5c Optimized Captcha implementation by solving not defined bugs 2025-11-28 23:38:08 +01:00
880d0ab1d6 Removed block from main.yml and moved run_once logic to 01_core.yml 2025-11-28 23:24:04 +01:00
654131ab89 Add global CAPTCHA config and EspoCRM seeder
- Introduce shared CAPTCHA settings and RECAPTCHA_ENABLED/HCAPTCHA_ENABLED flags in group_vars
- Wire reCAPTCHA/hCaptcha credentials into EspoCRM, Keycloak, Listmonk and Nextcloud
- Replace EspoCRM set_flags.php with generic seed_config.php and hook it into entrypoint/env
- Fix run_once handling in sys-ctl-cln-disc-space and minor CSS Jinja spacing issue

https://chatgpt.com/share/692a1d4f-1154-800f-a4ae-bb068aa24a53
2025-11-28 23:08:32 +01:00
4dd1769225 web-app-keycloak: sync Google reCAPTCHA config from realm dictionary
This adds update/06_recaptcha.yml to update the registration reCAPTCHA authenticator
from KEYCLOAK_DICTIONARY_REALM and wires it into the main Keycloak task flow.

Ref: https://chatgpt.com/share/6929f91c-cc98-800f-9562-1c6ea802d72d
2025-11-28 20:34:02 +01:00
c2a181edd4 Add generic hCaptcha CSP support and tests (ref: ChatGPT conversation https://chatgpt.com/share/6929f2ba-cedc-800f-9c4c-2049810cea94) 2025-11-28 20:06:58 +01:00
2132356f02 Enable custom EspoCRM CSS with Infinito.Nexus color scheme
- Activate css feature flag for EspoCRM
- Extend CSP with frame-ancestors for PRIMARY_DOMAIN
- Add style.css mapping EspoCRM UI to the --color-01-** blue palette

See ChatGPT discussion: https://chatgpt.com/share/6929b521-3a90-800f-9ce7-29bfb1faaeb4
2025-11-28 15:44:15 +01:00
3dddda39f6 Optimized Listmonk configuration and styling 2025-11-28 14:13:07 +01:00
3912e9b217 Add fediverse_url filter, integrate unified followus URL generation, update Listmonk config, adjust menu categories, and include full Python unittests. Details: https://chatgpt.com/share/69298521-dfc0-800f-9177-fefc7d32fec7 2025-11-28 12:19:12 +01:00
4337b63c2f Updated the desktop menu structure 2025-11-28 11:09:57 +01:00
0287652774 Improve Pixelfed resource configuration and translate waiting message
- Updated Pixelfed worker and application CPU/RAM limits
- Added Redis memory reservation and limit
- Added pids_limit for worker
- Translated script message from German to English
- Reference: https://chatgpt.com/share/69295cad-0398-800f-9604-953c2f5a833b
2025-11-28 09:26:48 +01:00
03a8819483 Solved OAuth2 Proxy host wrong identifier bug 2025-11-27 23:50:26 +01:00
9dd48b7a8e Solved OAuth2 Proxy port config path bugs 2025-11-27 23:10:21 +01:00
e72e5d3e37 Introduced CSP wildcards for MiniQR 2025-11-27 22:23:00 +01:00
21a1c99fda Added Newsletter button to following 2025-11-27 22:02:20 +01:00
9f4bbd4066 Added test for littlejs filter 2025-11-27 21:51:08 +01:00
7eac9374bc Implemented loading of javascript.js und javascript.js.j2 files 2025-11-27 21:50:39 +01:00