Commit Graph
69 Commits
Author SHA1 Message Date
kevinveenbirkenbachandClaude Opus 4.6 b70a783423 refactor(lookups): migrate to runtime applications/users lookups
Replaces inline `applications`/`users` merging with dedicated lookup
plugins and runtime hydration. Introduces `add_csp_hash` filter,
integrates sort into `find_dock_val_by_bkp_entr`, splits the Keycloak
one-shot realm import into `05a_realm_import_run.yml`, and fixes the
Mastodon administrator task YAML. Removes obsolete `csp_hashes` filter,
`sys-token-store` Jinja filter, and empty CLI setup modules.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-15 23:44:19 +02:00
kevinveenbirkenbach 8a81630391 Added newline at file and POSIX compatible 2026-02-04 19:49:56 +01:00
kevinveenbirkenbach 01e18a52a8 Removed async because it isn't allowed at build-in script 2026-02-03 12:31:56 +01:00
kevinveenbirkenbach 2755e0ce3d feat(keycloak): optionally mark user emails as verified via kcadm script
https://chatgpt.com/share/6978e108-6d80-800f-91ba-c2b5101e3dbf
2026-01-27 16:59:57 +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 29f5f4ab63 fix(keycloak): add retry logic to LDAP group sync handler
Retry LDAP roles mapper sync up to 6 times with 20s delay to
avoid race conditions during Keycloak/LDAP startup.

https://chatgpt.com/share/696d500b-18c8-800f-8b0f-c68420a8c418
2026-01-18 22:24:12 +01:00
kevinveenbirkenbach 48d5390264 keycloak: fix ldap group mapper parent and sync groups via handler
Ensure the ldap-roles group mapper always uses the correct parent group id
by injecting groups.path.group based on the actual Keycloak group.

Trigger LDAP → Keycloak group synchronization via a handler whenever the
mapper configuration changes, ensuring deterministic and reproducible
group imports under /roles.

https://chatgpt.com/share/696d02b4-1418-800f-8fe5-864f4e7494e8
2026-01-18 16:56:26 +01:00
kevinveenbirkenbach 51470fd54f web-app-keycloak: ensure jq is installed for RBAC and LDAP tasks
Install jq on localhost before running RBAC and LDAP update routines to
avoid runtime failures when parsing kcadm JSON output via shell pipes.

https://chatgpt.com/share/69653d6e-3678-800f-9ecc-53ea5cd21280
2026-01-12 19:34:06 +01:00
kevinveenbirkenbach 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
kevinveenbirkenbach 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
kevinveenbirkenbach 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
kevinveenbirkenbach 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
kevinveenbirkenbach 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
kevinveenbirkenbach 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
kevinveenbirkenbach 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
kevinveenbirkenbach 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
kevinveenbirkenbach a526d1adc4 Solved Keycloak Master Email Configuration Update settings 2025-10-11 16:57:36 +02:00
kevinveenbirkenbach ca95079111 Added Email Configuration for Keycloak Master Realm 2025-10-11 16:45:50 +02:00
kevinveenbirkenbach 098099b41e Refactored web-app-keycloak 2025-10-10 22:45:26 +02:00