From 13626fdfd81f150aefc8ab238ad9125e20b1aac4 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 29 May 2026 12:42:27 +0200 Subject: [PATCH 1/8] fix(web-app-bookwyrm): compile SCSS themes before collectstatic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BookWyrm ships its themes as `bookwyrm-light.scss` / `bookwyrm-dark.scss` in `bookwyrm/static/css/themes/`, not pre-compiled CSS. The role startup chain ran `collectstatic --noinput` directly, which hashes existing files into the staticfiles manifest but does not compile SCSS. As a result, the manifest never contained `css/themes/bookwyrm-light.css`, and every request that resolved a `{% sass_src %}` tag for that theme raised: ValueError: Missing staticfiles manifest entry for 'css/themes/bookwyrm-light.css' Django turned that into a 500 on the `/setup` landing page. Variant 0 hid the breakage because oauth2-proxy issues a 302 before the request reaches BookWyrm; variant 1 (no SSO) exposed it and the baseline Playwright check (`status < 500`) failed. Insert `manage.py compile_themes` between `migrate` and `collectstatic` so the theme CSS is on disk before the staticfiles manifest is built. Validated in the live container before the repo change: compile_themes → "Compiled SASS/SCSS file: bookwyrm-light.scss" + dark collectstatic → "2 static files copied" HUP gunicorn → curl https://book.infinito.example/ = 200 (was 500) `make compose-deploy mode=update apps=web-app-bookwyrm variant=1` then ran Playwright green end-to-end (failed=0, 2 passed + 4 passed across the two sync/async passes). Co-Authored-By: Claude Opus 4.7 --- roles/web-app-bookwyrm/templates/compose.yml.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/web-app-bookwyrm/templates/compose.yml.j2 b/roles/web-app-bookwyrm/templates/compose.yml.j2 index 2fe6e1b5e4..d09bc5278a 100644 --- a/roles/web-app-bookwyrm/templates/compose.yml.j2 +++ b/roles/web-app-bookwyrm/templates/compose.yml.j2 @@ -5,6 +5,7 @@ command: >- bash -c ' /venv/bin/python manage.py migrate --noinput && + /venv/bin/python manage.py compile_themes && /venv/bin/python manage.py collectstatic --noinput && (/venv/bin/python manage.py initdb || true) && /venv/bin/python -m gunicorn bookwyrm.wsgi:application --bind 0.0.0.0:{{ container_port }} From a52d2e626fc7930fc7462e18d7e629c74e44ea8b Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 29 May 2026 16:31:45 +0200 Subject: [PATCH 2/8] refactor(dev-nix): extract official-installer branch to 03_install_official.yml Adding the purge task pushed dev-nix/tasks/02_non_arch_installer.yml to 4 tasks gated by `when: dev_nix_binary_path_before | length == 0`, tripping tests.integration.roles.when.test_duplication. A `block:` would satisfy that lint but exceeds the project convention of max 3 entries per block. Move the six install-branch tasks (purge, nixbld group+uid probes, override set_facts, installer run) into a dedicated tasks/03_install_official.yml and call it once via include_tasks with the original guard `when:` on the include. Behavior unchanged; inner tasks no longer re-evaluate the binary-path condition each call. Co-Authored-By: Claude Opus 4.7 --- roles/dev-nix/tasks/02_non_arch_installer.yml | 69 +------------------ roles/dev-nix/tasks/03_install_official.yml | 63 +++++++++++++++++ 2 files changed, 65 insertions(+), 67 deletions(-) create mode 100644 roles/dev-nix/tasks/03_install_official.yml diff --git a/roles/dev-nix/tasks/02_non_arch_installer.yml b/roles/dev-nix/tasks/02_non_arch_installer.yml index a5317bd593..476de024ef 100644 --- a/roles/dev-nix/tasks/02_non_arch_installer.yml +++ b/roles/dev-nix/tasks/02_non_arch_installer.yml @@ -52,73 +52,8 @@ ) | default("", true) }} -- name: Purge stale nixbld users blocking the multi-user installer - ansible.builtin.script: - cmd: "{{ role_path }}/files/purge_stale_nixbld.sh" - register: dev_nix_purge_stale_nixbld_result - changed_when: > - dev_nix_purge_stale_nixbld_result.stdout is search('\\[CHANGED\\]') - failed_when: > - dev_nix_purge_stale_nixbld_result.rc != 0 or - dev_nix_purge_stale_nixbld_result.stdout is search('\\[FAIL\\]') - become: true - when: dev_nix_binary_path_before | length == 0 - -- name: Read existing nixbld group entry before installer run - ansible.builtin.getent: - database: group - key: nixbld - fail_key: false - become: true - when: dev_nix_binary_path_before | length == 0 - -- name: Set build group override for Nix installer when nixbld exists - ansible.builtin.set_fact: - dev_nix_installer_build_group_id: "{{ ansible_facts.getent_group.nixbld[1] }}" - when: - - dev_nix_binary_path_before | length == 0 - - ansible_facts.getent_group is defined - - "'nixbld' in ansible_facts.getent_group" - -- name: Read existing nixbld1 user entry before installer run - ansible.builtin.getent: - database: passwd - key: nixbld1 - fail_key: false - become: true - when: dev_nix_binary_path_before | length == 0 - -- name: Set first build uid override for Nix installer when nixbld1 exists - ansible.builtin.set_fact: - dev_nix_installer_first_build_uid: "{{ ansible_facts.getent_passwd.nixbld1[1] }}" - when: - - dev_nix_binary_path_before | length == 0 - - ansible_facts.getent_passwd is defined - - "'nixbld1' in ansible_facts.getent_passwd" - -- name: Run Nix installer in daemon (multi-user) mode if Nix is not installed - ansible.builtin.shell: > - "{{ dev_nix_installer_dest }}" --daemon - environment: >- - {{ - ( - (dev_nix_installer_build_group_id is defined) - | ternary( - {'NIX_BUILD_GROUP_ID': (dev_nix_installer_build_group_id | string)}, - {} - ) - ) - | combine( - ( - (dev_nix_installer_first_build_uid is defined) - | ternary( - {'NIX_FIRST_BUILD_UID': (dev_nix_installer_first_build_uid | string)}, - {} - ) - ) - ) - }} - become: true +- name: Install Nix via official installer when no Nix binary is present + ansible.builtin.include_tasks: 03_install_official.yml when: dev_nix_binary_path_before | length == 0 - name: Probe common nix binary paths after installation diff --git a/roles/dev-nix/tasks/03_install_official.yml b/roles/dev-nix/tasks/03_install_official.yml new file mode 100644 index 0000000000..215a55af89 --- /dev/null +++ b/roles/dev-nix/tasks/03_install_official.yml @@ -0,0 +1,63 @@ +--- +- name: Purge stale nixbld users blocking the multi-user installer + ansible.builtin.script: + cmd: "{{ role_path }}/files/purge_stale_nixbld.sh" + register: dev_nix_purge_stale_nixbld_result + changed_when: > + dev_nix_purge_stale_nixbld_result.stdout is search('\\[CHANGED\\]') + failed_when: > + dev_nix_purge_stale_nixbld_result.rc != 0 or + dev_nix_purge_stale_nixbld_result.stdout is search('\\[FAIL\\]') + become: true + +- name: Read existing nixbld group entry before installer run + ansible.builtin.getent: + database: group + key: nixbld + fail_key: false + become: true + +- name: Set build group override for Nix installer when nixbld exists + ansible.builtin.set_fact: + dev_nix_installer_build_group_id: "{{ ansible_facts.getent_group.nixbld[1] }}" + when: + - ansible_facts.getent_group is defined + - "'nixbld' in ansible_facts.getent_group" + +- name: Read existing nixbld1 user entry before installer run + ansible.builtin.getent: + database: passwd + key: nixbld1 + fail_key: false + become: true + +- name: Set first build uid override for Nix installer when nixbld1 exists + ansible.builtin.set_fact: + dev_nix_installer_first_build_uid: "{{ ansible_facts.getent_passwd.nixbld1[1] }}" + when: + - ansible_facts.getent_passwd is defined + - "'nixbld1' in ansible_facts.getent_passwd" + +- name: Run Nix installer in daemon (multi-user) mode + ansible.builtin.shell: > + "{{ dev_nix_installer_dest }}" --daemon + environment: >- + {{ + ( + (dev_nix_installer_build_group_id is defined) + | ternary( + {'NIX_BUILD_GROUP_ID': (dev_nix_installer_build_group_id | string)}, + {} + ) + ) + | combine( + ( + (dev_nix_installer_first_build_uid is defined) + | ternary( + {'NIX_FIRST_BUILD_UID': (dev_nix_installer_first_build_uid | string)}, + {} + ) + ) + ) + }} + become: true From d9a6006da1239a559db530cf4851e0c6d5daeded Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sun, 31 May 2026 19:54:30 +0200 Subject: [PATCH 3/8] style(web-app-zammad): collapse column-aligned whitespace to autoformat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pure whitespace reflow applied by `make autoformat` — column-aligned mapping values were collapsed to single-space alignment so the files match the project-wide YAML formatter output. No behavior change. Co-Authored-By: Claude Opus 4.7 --- roles/web-app-zammad/meta/schema.yml | 4 +- roles/web-app-zammad/tasks/01_core.yml | 54 +++++++++++++------------- roles/web-app-zammad/vars/main.yml | 44 ++++++++++----------- 3 files changed, 52 insertions(+), 50 deletions(-) diff --git a/roles/web-app-zammad/meta/schema.yml b/roles/web-app-zammad/meta/schema.yml index 6e09ab97bd..31ff612dc3 100644 --- a/roles/web-app-zammad/meta/schema.yml +++ b/roles/web-app-zammad/meta/schema.yml @@ -16,7 +16,9 @@ credentials: validation: "^[A-Za-z0-9]{16,}$" length: 32 api_bot_password: - description: "Local password for the role-internal `zammad-api-bot` user that backs Basic-auth REST-API calls (Playwright). Also reused as the wizard-bypass admin's local password. Alphanumeric on purpose — `lookup('users', 'administrator').password` carries `'$tr0ng€xampl3PW!`-style chars that get mangled by the Ansible→bash→`container exec -e`→Ruby ENV.fetch chain (see roles/web-app-joomla/tasks/02_install.yml:55-61 for the same class of bug)." + description: "Local password for the role-internal `zammad-api-bot` user that backs Basic-auth REST-API calls (Playwright). Also reused as the wizard-bypass admin's + local password. Alphanumeric on purpose — `lookup('users', 'administrator').password` carries `'$tr0ng€xampl3PW!`-style chars that get mangled by the Ansible→bash→`container + exec -e`→Ruby ENV.fetch chain (see roles/web-app-joomla/tasks/02_install.yml:55-61 for the same class of bug)." algorithm: alphanumeric validation: "^[A-Za-z0-9]{32,}$" length: 48 diff --git a/roles/web-app-zammad/tasks/01_core.yml b/roles/web-app-zammad/tasks/01_core.yml index 1a5c726037..483c920a41 100644 --- a/roles/web-app-zammad/tasks/01_core.yml +++ b/roles/web-app-zammad/tasks/01_core.yml @@ -83,11 +83,11 @@ {{ ZAMMAD_RAILS_CONTAINER }} \ bundle exec rails r - < {{ role_path }}/files/scripts/apply_api_bot.rb environment: - API_BOT_LOGIN: "{{ ZAMMAD_API_BOT_USER.username }}" - API_BOT_EMAIL: "{{ ZAMMAD_API_BOT_USER.email }}" - API_BOT_FIRSTNAME: "{{ ZAMMAD_API_BOT_USER.firstname }}" - API_BOT_LASTNAME: "{{ ZAMMAD_API_BOT_USER.lastname }}" - API_BOT_PASSWORD: "{{ ZAMMAD_API_BOT_PASSWORD }}" + API_BOT_LOGIN: "{{ ZAMMAD_API_BOT_USER.username }}" + API_BOT_EMAIL: "{{ ZAMMAD_API_BOT_USER.email }}" + API_BOT_FIRSTNAME: "{{ ZAMMAD_API_BOT_USER.firstname }}" + API_BOT_LASTNAME: "{{ ZAMMAD_API_BOT_USER.lastname }}" + API_BOT_PASSWORD: "{{ ZAMMAD_API_BOT_PASSWORD }}" register: zammad_api_bot_apply changed_when: false @@ -100,12 +100,12 @@ {{ ZAMMAD_RAILS_CONTAINER }} \ bundle exec rails r - < {{ role_path }}/files/scripts/apply_oidc_settings.rb environment: - ZAMMAD_FQDN: "{{ ZAMMAD_HOSTNAME }}" - ZAMMAD_HTTP_TYPE: "{{ ZAMMAD_WEB_PROTOCOL }}" - OIDC_BUTTON_TEXT: "{{ OIDC.BUTTON_TEXT }}" - OIDC_CLIENT_ID: "{{ OIDC.CLIENT.ID }}" + ZAMMAD_FQDN: "{{ ZAMMAD_HOSTNAME }}" + ZAMMAD_HTTP_TYPE: "{{ ZAMMAD_WEB_PROTOCOL }}" + OIDC_BUTTON_TEXT: "{{ OIDC.BUTTON_TEXT }}" + OIDC_CLIENT_ID: "{{ OIDC.CLIENT.ID }}" OIDC_CLIENT_SECRET: "{{ OIDC.CLIENT.SECRET }}" - OIDC_ISSUER_URL: "{{ OIDC.CLIENT.ISSUER_URL }}" + OIDC_ISSUER_URL: "{{ OIDC.CLIENT.ISSUER_URL }}" register: zammad_oidc_apply changed_when: false when: ZAMMAD_OIDC_ENABLED @@ -119,13 +119,13 @@ {{ ZAMMAD_RAILS_CONTAINER }} \ bundle exec rails r - < {{ role_path }}/files/scripts/apply_ldap_source.rb environment: - LDAP_NAME: "{{ ORGANIZATION }} svc-db-openldap" - LDAP_HOST: "{{ LDAP.SERVER.DOMAIN }}" - LDAP_PORT: "{{ LDAP.SERVER.PORT }}" - LDAP_BASE_DN: "{{ LDAP.DN.OU.USERS }}" - LDAP_BIND_DN: "{{ LDAP.DN.ADMINISTRATOR.DATA }}" - LDAP_BIND_PW: "{{ LDAP.BIND_CREDENTIAL }}" - LDAP_UID_ATTR: "{{ LDAP.USER.ATTRIBUTES.ID }}" + LDAP_NAME: "{{ ORGANIZATION }} svc-db-openldap" + LDAP_HOST: "{{ LDAP.SERVER.DOMAIN }}" + LDAP_PORT: "{{ LDAP.SERVER.PORT }}" + LDAP_BASE_DN: "{{ LDAP.DN.OU.USERS }}" + LDAP_BIND_DN: "{{ LDAP.DN.ADMINISTRATOR.DATA }}" + LDAP_BIND_PW: "{{ LDAP.BIND_CREDENTIAL }}" + LDAP_UID_ATTR: "{{ LDAP.USER.ATTRIBUTES.ID }}" register: zammad_ldap_apply changed_when: false when: ZAMMAD_LDAP_ENABLED @@ -140,17 +140,17 @@ {{ ZAMMAD_RAILS_CONTAINER }} \ bundle exec rails r - < {{ role_path }}/files/scripts/apply_email_channel.rb environment: - MAIL_GROUP_NAME: "Users" - MAIL_FROM_NAME: "{{ ORGANIZATION }} Helpdesk" + MAIL_GROUP_NAME: "Users" + MAIL_FROM_NAME: "{{ ORGANIZATION }} Helpdesk" MAIL_FROM_ADDRESS: "{{ ZAMMAD_HELPDESK_EMAIL }}" - IMAP_HOST: "{{ ZAMMAD_MAIL.host }}" - IMAP_PORT: "143" - IMAP_USER: "{{ ZAMMAD_HELPDESK_EMAIL }}" - IMAP_PASS: "{{ ZAMMAD_HELPDESK_PASS }}" - SMTP_HOST: "{{ ZAMMAD_MAIL.host }}" - SMTP_PORT: "{{ ZAMMAD_MAIL.port }}" - SMTP_USER: "{{ ZAMMAD_HELPDESK_EMAIL }}" - SMTP_PASS: "{{ ZAMMAD_HELPDESK_PASS }}" + IMAP_HOST: "{{ ZAMMAD_MAIL.host }}" + IMAP_PORT: "143" + IMAP_USER: "{{ ZAMMAD_HELPDESK_EMAIL }}" + IMAP_PASS: "{{ ZAMMAD_HELPDESK_PASS }}" + SMTP_HOST: "{{ ZAMMAD_MAIL.host }}" + SMTP_PORT: "{{ ZAMMAD_MAIL.port }}" + SMTP_USER: "{{ ZAMMAD_HELPDESK_EMAIL }}" + SMTP_PASS: "{{ ZAMMAD_HELPDESK_PASS }}" register: zammad_email_apply changed_when: false when: ZAMMAD_EMAIL_ENABLED and (ZAMMAD_HELPDESK_EMAIL | length > 0) diff --git a/roles/web-app-zammad/vars/main.yml b/roles/web-app-zammad/vars/main.yml index b07c640d33..be0b5b6d8c 100644 --- a/roles/web-app-zammad/vars/main.yml +++ b/roles/web-app-zammad/vars/main.yml @@ -8,15 +8,15 @@ ZAMMAD_VERSION: "{{ lookup('config', application_id, 'services.zammad.version') ZAMMAD_SEARCH_IMAGE: "{{ lookup('config', application_id, 'services.search.image') }}" ZAMMAD_SEARCH_VERSION: "{{ lookup('config', application_id, 'services.search.version') }}" -ZAMMAD_INIT_CONTAINER: "zammad-init" -ZAMMAD_RAILS_CONTAINER: "zammad-railsserver" +ZAMMAD_INIT_CONTAINER: "zammad-init" +ZAMMAD_RAILS_CONTAINER: "zammad-railsserver" ZAMMAD_WEBSOCKET_CONTAINER: "zammad-websocket" ZAMMAD_SCHEDULER_CONTAINER: "zammad-scheduler" -ZAMMAD_NGINX_CONTAINER: "zammad-nginx" -ZAMMAD_SEARCH_CONTAINER: "zammad-elasticsearch" +ZAMMAD_NGINX_CONTAINER: "zammad-nginx" +ZAMMAD_SEARCH_CONTAINER: "zammad-elasticsearch" ZAMMAD_MEMCACHED_CONTAINER: "zammad-memcached" -ZAMMAD_MEMCACHED_IMAGE: "{{ lookup('config', 'svc-db-memcached', 'services.memcached.image') }}" +ZAMMAD_MEMCACHED_IMAGE: "{{ lookup('config', 'svc-db-memcached', 'services.memcached.image') }}" ZAMMAD_MEMCACHED_VERSION: "{{ lookup('config', 'svc-db-memcached', 'services.memcached.version') }}" ZAMMAD_RAILS_PORT: 3000 @@ -24,36 +24,36 @@ ZAMMAD_WEBSOCKET_PORT: 6042 # Both bots need a shell-safe alphanumeric password — the default users-SPOT # password carries chars that get mangled through Ansible→bash→docker-exec→Ruby ENV. -ZAMMAD_API_BOT_USER: "{{ lookup('users', 'zammad-api-bot') }}" -ZAMMAD_WIZARD_BYPASS_USER: "{{ lookup('users', 'zammad-wizard-bypass-admin') }}" -ZAMMAD_API_BOT_PASSWORD: "{{ lookup('config', application_id, 'credentials.api_bot_password') }}" +ZAMMAD_API_BOT_USER: "{{ lookup('users', 'zammad-api-bot') }}" +ZAMMAD_WIZARD_BYPASS_USER: "{{ lookup('users', 'zammad-wizard-bypass-admin') }}" +ZAMMAD_API_BOT_PASSWORD: "{{ lookup('config', application_id, 'credentials.api_bot_password') }}" ZAMMAD_INITIAL_ADMIN_PASSWORD: "{{ lookup('config', application_id, 'credentials.initial_admin_password') }}" -ZAMMAD_SECRET_KEY_BASE: "{{ lookup('config', application_id, 'credentials.secret_key_base') }}" +ZAMMAD_SECRET_KEY_BASE: "{{ lookup('config', application_id, 'credentials.secret_key_base') }}" -ZAMMAD_HOSTNAME: "{{ lookup('domain', application_id) }}" +ZAMMAD_HOSTNAME: "{{ lookup('domain', application_id) }}" ZAMMAD_WEB_PROTOCOL: "{{ lookup('tls', application_id, 'protocols.web') }}" -ZAMMAD_VOLUMES_DIR: "{{ lookup('container', application_id, 'directories.volumes') }}" -ZAMMAD_AUTO_WIZARD_HOST_PATH: "{{ ZAMMAD_VOLUMES_DIR }}auto_wizard.json" -ZAMMAD_OMNIAUTH_INIT_HOST_PATH: "{{ ZAMMAD_VOLUMES_DIR }}zz_omniauth_allow_get.rb" +ZAMMAD_VOLUMES_DIR: "{{ lookup('container', application_id, 'directories.volumes') }}" +ZAMMAD_AUTO_WIZARD_HOST_PATH: "{{ ZAMMAD_VOLUMES_DIR }}auto_wizard.json" +ZAMMAD_OMNIAUTH_INIT_HOST_PATH: "{{ ZAMMAD_VOLUMES_DIR }}zz_omniauth_allow_get.rb" ZAMMAD_OMNIAUTH_INIT_CONTAINER_PATH: "/opt/zammad/config/initializers/zz_omniauth_allow_get.rb" -ZAMMAD_TELEGRAM_HELPER_HOST_PATH: "{{ ZAMMAD_VOLUMES_DIR }}telegram_helper.rb" +ZAMMAD_TELEGRAM_HELPER_HOST_PATH: "{{ ZAMMAD_VOLUMES_DIR }}telegram_helper.rb" ZAMMAD_TELEGRAM_HELPER_CONTAINER_PATH: "/opt/zammad/lib/telegram_helper.rb" -ZAMMAD_OIDC_GROUP_ROLE_MAP_HOST_PATH: "{{ ZAMMAD_VOLUMES_DIR }}zz_oidc_group_role_mapping.rb" +ZAMMAD_OIDC_GROUP_ROLE_MAP_HOST_PATH: "{{ ZAMMAD_VOLUMES_DIR }}zz_oidc_group_role_mapping.rb" ZAMMAD_OIDC_GROUP_ROLE_MAP_CONTAINER_PATH: "/opt/zammad/config/initializers/zz_oidc_group_role_mapping.rb" ZAMMAD_OIDC_GROUP_ROLE_MAP: "/{{ RBAC.GROUP.NAME | trim('/') }}/{{ application_id }}/administrator": "Admin" - "/{{ RBAC.GROUP.NAME | trim('/') }}/{{ application_id }}/agent": "Agent" - "/{{ RBAC.GROUP.NAME | trim('/') }}/{{ application_id }}/customer": "Customer" + "/{{ RBAC.GROUP.NAME | trim('/') }}/{{ application_id }}/agent": "Agent" + "/{{ RBAC.GROUP.NAME | trim('/') }}/{{ application_id }}/customer": "Customer" -ZAMMAD_OIDC_ENABLED: "{{ lookup('config', application_id, 'services.sso.enabled') | bool }}" +ZAMMAD_OIDC_ENABLED: "{{ lookup('config', application_id, 'services.sso.enabled') | bool }}" ZAMMAD_EMAIL_ENABLED: "{{ lookup('config', application_id, 'services.email.enabled') | bool }}" -ZAMMAD_LDAP_ENABLED: "{{ lookup('config', application_id, 'services.ldap.enabled') | bool }}" +ZAMMAD_LDAP_ENABLED: "{{ lookup('config', application_id, 'services.ldap.enabled') | bool }}" -ZAMMAD_MAIL: "{{ lookup('email', application_id) if ZAMMAD_EMAIL_ENABLED else {} }}" -ZAMMAD_HELPDESK_USER: "{{ lookup('users', 'helpdesk') if ZAMMAD_EMAIL_ENABLED else {} }}" +ZAMMAD_MAIL: "{{ lookup('email', application_id) if ZAMMAD_EMAIL_ENABLED else {} }}" +ZAMMAD_HELPDESK_USER: "{{ lookup('users', 'helpdesk') if ZAMMAD_EMAIL_ENABLED else {} }}" ZAMMAD_HELPDESK_EMAIL: "{{ ZAMMAD_HELPDESK_USER.email | default('') }}" # Mailu enforces change_pw_next_login → user password rejects SMTP AUTH (535); per-app token is required. -ZAMMAD_HELPDESK_PASS: "{{ (ZAMMAD_HELPDESK_USER.tokens | default({})).get('web-app-mailu', '') }}" +ZAMMAD_HELPDESK_PASS: "{{ (ZAMMAD_HELPDESK_USER.tokens | default({})).get('web-app-mailu', '') }}" From f27e6337eeb28c1654de47490497e1f2aa0eccbf Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sun, 31 May 2026 20:43:03 +0200 Subject: [PATCH 4/8] fix(dev-nix): guard nixbld set_fact against `getent fail_key: false` None values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI run 26643336674 (feature/web-app-zammad) failed at: TASK [dev-nix : Set build group override for Nix installer when nixbld exists] Error while resolving value for 'dev_nix_installer_build_group_id': object of type 'NoneType' has no attribute 1 Root cause: `getent` with `fail_key: false` does NOT drop the key when the entry is missing — it inserts the key with a `None` value. The existing `when:` guard `'nixbld' in ansible_facts.getent_group` therefore evaluates True (the membership test only checks the key, not the value), and `getent_group.nixbld[1]` then crashes when the value is None. Fix: replace the membership check with an explicit `is not none` assertion for both `nixbld` (group entry) and `nixbld1` (passwd entry). A short comment above each `when:` block names the trap so the next reader does not re-introduce the membership-only check. Co-Authored-By: Claude Opus 4.7 --- roles/dev-nix/tasks/03_install_official.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/dev-nix/tasks/03_install_official.yml b/roles/dev-nix/tasks/03_install_official.yml index 215a55af89..21bcec4601 100644 --- a/roles/dev-nix/tasks/03_install_official.yml +++ b/roles/dev-nix/tasks/03_install_official.yml @@ -20,9 +20,12 @@ - name: Set build group override for Nix installer when nixbld exists ansible.builtin.set_fact: dev_nix_installer_build_group_id: "{{ ansible_facts.getent_group.nixbld[1] }}" + # `getent ... fail_key: false` inserts the key with a `None` value when the + # entry is missing, so the membership test is True but `.nixbld[1]` would + # crash on None — explicitly skip when the value is None. when: - ansible_facts.getent_group is defined - - "'nixbld' in ansible_facts.getent_group" + - ansible_facts.getent_group.nixbld is not none - name: Read existing nixbld1 user entry before installer run ansible.builtin.getent: @@ -34,9 +37,10 @@ - name: Set first build uid override for Nix installer when nixbld1 exists ansible.builtin.set_fact: dev_nix_installer_first_build_uid: "{{ ansible_facts.getent_passwd.nixbld1[1] }}" + # Same None-vs-missing trap as for the group entry above. when: - ansible_facts.getent_passwd is defined - - "'nixbld1' in ansible_facts.getent_passwd" + - ansible_facts.getent_passwd.nixbld1 is not none - name: Run Nix installer in daemon (multi-user) mode ansible.builtin.shell: > From 3a3fd67180ddcd76fa6a26771e4d30df3b01080e Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sun, 31 May 2026 22:29:19 +0200 Subject: [PATCH 5/8] fix(sys-svc-mail-msmtp,sys-ctl-hlth-msmtp): make health-check resilient on minimal images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI run 26721196005 failed at: TASK [sys-service : sys-service | Fail after shared service diagnostics] msg: Unable to start service hlth-msmtp.9.0.2.infinito.nexus.service. Two breakages in the start sequence: 1. `sys-ctl-hlth-msmtp/files/script.sh` called `hostname` in `$(...)`. The CI deploy containers ship without that binary, so `set -eu` aborted before msmtp ever saw stdin. Fall back to `${HOSTNAME:-...}` then `uname -n` then a literal "unknown". 2. `sys-svc-mail-msmtp/templates/msmtprc.conf.j2` hard-coded the trust file path per RedHat family — the file was missing on the deploy image and msmtp aborted with `Error while reading file. exit=66`. Probe a candidate list at deploy time (`SYS_SVC_MAIL_MSMTP_CA_BUNDLE_CANDIDATES`), pick the first existing path, surface it as `sys_svc_mail_msmtp_ca_bundle`, and install `ca-certificates` ahead of the probe. `make test` 5/5 green (186 OK). Co-Authored-By: Claude Opus 4.7 --- .gitignore | 2 ++ roles/sys-ctl-hlth-msmtp/files/script.sh | 5 ++-- roles/sys-svc-mail-msmtp/tasks/enable.yml | 24 +++++++++++++++++++ .../templates/msmtprc.conf.j2 | 2 +- roles/sys-svc-mail-msmtp/vars/main.yml | 7 ++++++ roles/web-app-discourse/meta/services.yml | 3 ++- 6 files changed, 39 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 7fe021ddd9..c4b6e0c91d 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ job-logs.txt .claude/skills .claude/agents .claude/commands +.claude/hooks .claude/settings.local.json *.lock node_modules/ @@ -42,3 +43,4 @@ node_modules/ .vscode .zprofile .zshrc + diff --git a/roles/sys-ctl-hlth-msmtp/files/script.sh b/roles/sys-ctl-hlth-msmtp/files/script.sh index df9a0d75da..2be216a02a 100644 --- a/roles/sys-ctl-hlth-msmtp/files/script.sh +++ b/roles/sys-ctl-hlth-msmtp/files/script.sh @@ -2,9 +2,10 @@ set -eu : "${MAIL_RECIPIENT:?MAIL_RECIPIENT not set}" : "${MAIL_TIMEOUT:?MAIL_TIMEOUT not set}" +HOST="${HOSTNAME:-$(uname -n 2>/dev/null || echo unknown)}" { echo "To: ${MAIL_RECIPIENT}" - echo "Subject: $(hostname) is alive" + echo "Subject: ${HOST} is alive" echo - echo "Host $(hostname) reports at $(date): I'm alive." + echo "Host ${HOST} reports at $(date): I'm alive." } | timeout "${MAIL_TIMEOUT}"s msmtp -t diff --git a/roles/sys-svc-mail-msmtp/tasks/enable.yml b/roles/sys-svc-mail-msmtp/tasks/enable.yml index 87d8bd86f9..d62eca4645 100644 --- a/roles/sys-svc-mail-msmtp/tasks/enable.yml +++ b/roles/sys-svc-mail-msmtp/tasks/enable.yml @@ -12,6 +12,11 @@ name: "{{ SYS_SVC_MAIL_MSMTP_PACKAGES.base }}" state: present +- name: Ensure system CA certificates are installed + package: + name: ca-certificates + state: present + - name: "Disable SMTP to avoid port conflicts" include_tasks: "{{ [playbook_dir, 'roles/sys-svc-mail-smtp/tasks/disable.yml' ] | path_join }}" @@ -31,6 +36,25 @@ force: true when: SYS_SVC_MAIL_MSMTP_PACKAGES.mta == '' +- name: Probe CA bundle candidate paths for msmtp TLS trust file + ansible.builtin.stat: + path: "{{ item }}" + loop: "{{ SYS_SVC_MAIL_MSMTP_CA_BUNDLE_CANDIDATES }}" + register: _sys_svc_mail_msmtp_ca_probe + +- name: Select first existing CA bundle path for msmtp + ansible.builtin.set_fact: + sys_svc_mail_msmtp_ca_bundle: >- + {{ + ( + _sys_svc_mail_msmtp_ca_probe.results + | selectattr('stat.exists') + | map(attribute='item') + | list + | first + ) | default(SYS_SVC_MAIL_MSMTP_CA_BUNDLE_CANDIDATES | first, true) + }} + - name: configure msmtprc.conf.j2 template: src: "msmtprc.conf.j2" diff --git a/roles/sys-svc-mail-msmtp/templates/msmtprc.conf.j2 b/roles/sys-svc-mail-msmtp/templates/msmtprc.conf.j2 index 999c7ac8fd..40d9a7bb0b 100644 --- a/roles/sys-svc-mail-msmtp/templates/msmtprc.conf.j2 +++ b/roles/sys-svc-mail-msmtp/templates/msmtprc.conf.j2 @@ -7,7 +7,7 @@ syslog {{ MODE_DEBUG | on_off }} auth {{ email.auth | on_off }} tls_starttls {{ email.start_tls | on_off }} tls {{ email.tls | on_off }} -tls_trust_file {{ '/etc/pki/tls/certs/ca-bundle.crt' if (ansible_facts['os_family'] | lower == 'redhat') else '/etc/ssl/certs/ca-certificates.crt' }} +tls_trust_file {{ sys_svc_mail_msmtp_ca_bundle }} tls_host_override {{ email.host }} account system_email_no_reply host {{ '127.0.0.1' if (DOCKER_IN_CONTAINER | bool) else email.host }} diff --git a/roles/sys-svc-mail-msmtp/vars/main.yml b/roles/sys-svc-mail-msmtp/vars/main.yml index 4533e7e38d..b012d66ae4 100644 --- a/roles/sys-svc-mail-msmtp/vars/main.yml +++ b/roles/sys-svc-mail-msmtp/vars/main.yml @@ -56,3 +56,10 @@ SYS_SVC_MAIL_MSMTP_EPEL_DISTRIBUTIONS: - RedHat - Rocky - AlmaLinux + +SYS_SVC_MAIL_MSMTP_CA_BUNDLE_CANDIDATES: + - /etc/pki/tls/certs/ca-bundle.crt + - /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem + - /etc/ssl/certs/ca-certificates.crt + - /etc/ssl/cert.pem + - /etc/ssl/ca-bundle.pem diff --git a/roles/web-app-discourse/meta/services.yml b/roles/web-app-discourse/meta/services.yml index 9eae848de2..f96c205c35 100644 --- a/roles/web-app-discourse/meta/services.yml +++ b/roles/web-app-discourse/meta/services.yml @@ -70,7 +70,8 @@ discourse: mem_reservation: 1g mem_limit: 2g pids_limit: 1024 - local_login_enabled: "{{ not (lookup('config', 'web-app-discourse', 'services.sso.enabled') | bool) or (lookup('config', 'web-app-discourse', 'services.ldap.enabled') | bool) }}" + local_login_enabled: "{{ not (lookup('config', 'web-app-discourse', 'services.sso.enabled') | bool) or (lookup('config', 'web-app-discourse', 'services.ldap.enabled') + | bool) }}" # nocheck: playwright-service-flag — css consumer, no Playwright surface (provider: web-svc-css) css: enabled: "{{ 'web-svc-css' in group_names }}" From fc3971859913dacc36553fba995f525d818d5a12 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 1 Jun 2026 00:14:42 +0200 Subject: [PATCH 6/8] chore: sync .dockerignore with .gitignore after `.claude/hooks` addition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `make setup` regenerates `.dockerignore` from `.gitignore` on every run. The earlier commit that added `.claude/hooks` to `.gitignore` did not re-emit the matching `.dockerignore`, so each CI invocation rewrote the file — and the `pre-commit` framework reported `make test` as failed ("files were modified by this hook"), even though every test target passed. Land the synced output here so the diff stays empty on a clean deploy. Co-Authored-By: Claude Opus 4.7 --- .dockerignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.dockerignore b/.dockerignore index 7fe021ddd9..c4b6e0c91d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -23,6 +23,7 @@ job-logs.txt .claude/skills .claude/agents .claude/commands +.claude/hooks .claude/settings.local.json *.lock node_modules/ @@ -42,3 +43,4 @@ node_modules/ .vscode .zprofile .zshrc + From c1215d3106f8ba03dcf6bb2822791d54f03fc90f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 02:41:17 +0000 Subject: [PATCH 7/8] chore(deps-dev): bump eslint from 10.4.0 to 10.4.1 Bumps [eslint](https://github.com/eslint/eslint) from 10.4.0 to 10.4.1. - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](https://github.com/eslint/eslint/compare/v10.4.0...v10.4.1) --- updated-dependencies: - dependency-name: eslint dependency-version: 10.4.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 29 ++++++++--------------------- package.json | 2 +- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index f93420dc8e..ab6eb569a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "devDependencies": { "@eslint/js": "^10.0.1", "@playwright/test": "^1.55.0", - "eslint": "^10.4.0", + "eslint": "^10.4.1", "eslint-plugin-playwright": "^2.10.4", "globals": "^15.14.0" } @@ -130,9 +130,9 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.1.tgz", - "integrity": "sha512-rZAP3aVgB9ds9KOeUSL+zZ21hPmo8dh6fnIFwRQj5EAZl9gzR7wxYbYXYysAM8CTqGmUGyp2S4kUdV17MnGuWQ==", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.2.tgz", + "integrity": "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -363,9 +363,9 @@ } }, "node_modules/eslint": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.4.0.tgz", - "integrity": "sha512-loXy6bWOoP3EP6JA7jo6p5jMpBJmHmsNZM5SFRHLdh1MGOPurMnNBj4ZlAbaqUAaQWbCr7jHV4P7gzAyryZWkQ==", + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.4.1.tgz", + "integrity": "sha512-AyIKhnOBuOAdueD7RB3xB+YeAWScb9jHsJBgH2Hcde8InP5JYhqrRR6iTMHyTEwgENK54Cp44e4v8BwNhsuHuw==", "dev": true, "license": "MIT", "dependencies": { @@ -374,7 +374,7 @@ "@eslint/config-array": "^0.23.5", "@eslint/config-helpers": "^0.6.0", "@eslint/core": "^1.2.1", - "@eslint/plugin-kit": "^0.7.1", + "@eslint/plugin-kit": "^0.7.2", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", @@ -479,19 +479,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/@eslint/js": { - "version": "9.39.4", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz", - "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://eslint.org/donate" - } - }, "node_modules/espree": { "version": "11.2.0", "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", diff --git a/package.json b/package.json index c1342812fe..eaf2184043 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "devDependencies": { "@eslint/js": "^10.0.1", "@playwright/test": "^1.55.0", - "eslint": "^10.4.0", + "eslint": "^10.4.1", "eslint-plugin-playwright": "^2.10.4", "globals": "^15.14.0" } From 4a2beaa3e72c2bba67ab03b8a4230119baa24c63 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 1 Jun 2026 11:29:42 +0200 Subject: [PATCH 8/8] Release version 9.1.0 --- CHANGELOG.md | 9 +++++++++ packaging/arch/PKGBUILD | 2 +- packaging/debian/changelog | 11 +++++++++++ packaging/fedora/infinito-nexus.spec | 10 +++++++++- pyproject.toml | 2 +- 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89558f981f..1bbf195b05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [9.1.0] - 2026-06-01 + +* * More robust Nix installer on Debian, Ubuntu, Fedora and CentOS systems: stale nixbld users from earlier installation attempts are cleaned up before the multi-user installer runs, and a long-standing crash on hosts where the nixbld group is absent has been resolved. +* Outbound mail health checks no longer fail silently on minimal container images: the heartbeat-email script copes with images that ship without the hostname binary, and the SSL trust file path is detected automatically across Red Hat, Debian, Ubuntu, Alpine and NixOS layouts. +* The Zammad helpdesk role completes its single-sign-on schema unification, with the variant matrix and Playwright test suite brought in line with the new shape. +* Internal infrastructure cleanups: re-synchronised .dockerignore and a shifted weekly CI schedule. + +Release maintained by [Kevin Veen-Birkenbach](https://veen.world). + ## [9.0.2] - 2026-05-29 * Restores the Debian dev-image build by introducing the INFINITO_VENV_DIR SPOT and calling infinito via its absolute venv path in scripts/docker/entry.sh, so the post-`make install` version check no longer trips on the PATH that bash -lc clobbers via /etc/profile; also scopes the auto-update PR dedup fingerprint to the files a run actually committed (instead of the whole commit tree) so unrelated drift on main no longer forces a fresh PR on every daily cron, nests web-app-bluesky's nocheck markers under the acl block they describe, and rolls up dependabot bumps (actions/cache 4→5, actions/setup-node 4→6) plus routine Docker image / git ref refreshes. diff --git a/packaging/arch/PKGBUILD b/packaging/arch/PKGBUILD index d4ca3b8bdc..0a0d14ad65 100644 --- a/packaging/arch/PKGBUILD +++ b/packaging/arch/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Kevin Veen-Birkenbach pkgname=infinito-nexus -pkgver=9.0.2 +pkgver=9.1.0 pkgrel=1 pkgdesc="Meta package for Infinito.Nexus host dependencies (dev + CI)." arch=('any') diff --git a/packaging/debian/changelog b/packaging/debian/changelog index 79ac03e247..13713b9d84 100644 --- a/packaging/debian/changelog +++ b/packaging/debian/changelog @@ -1,3 +1,14 @@ +infinito-nexus (9.1.0-1) unstable; urgency=medium + + * * More robust Nix installer on Debian, Ubuntu, Fedora and CentOS systems: stale nixbld users from earlier installation attempts are cleaned up before the multi-user installer runs, and a long-standing crash on hosts where the nixbld group is absent has been resolved. +* Outbound mail health checks no longer fail silently on minimal container images: the heartbeat-email script copes with images that ship without the hostname binary, and the SSL trust file path is detected automatically across Red Hat, Debian, Ubuntu, Alpine and NixOS layouts. +* The Zammad helpdesk role completes its single-sign-on schema unification, with the variant matrix and Playwright test suite brought in line with the new shape. +* Internal infrastructure cleanups: re-synchronised .dockerignore and a shifted weekly CI schedule. + +Release maintained by [Kevin Veen-Birkenbach](https://veen.world). + + -- Kevin Veen-Birkenbach Mon, 01 Jun 2026 11:29:42 +0200 + infinito-nexus (9.0.2-1) unstable; urgency=medium * Restores the Debian dev-image build by introducing the INFINITO_VENV_DIR SPOT and calling infinito via its absolute venv path in scripts/docker/entry.sh, so the post-`make install` version check no longer trips on the PATH that bash -lc clobbers via /etc/profile; also scopes the auto-update PR dedup fingerprint to the files a run actually committed (instead of the whole commit tree) so unrelated drift on main no longer forces a fresh PR on every daily cron, nests web-app-bluesky's nocheck markers under the acl block they describe, and rolls up dependabot bumps (actions/cache 4→5, actions/setup-node 4→6) plus routine Docker image / git ref refreshes. diff --git a/packaging/fedora/infinito-nexus.spec b/packaging/fedora/infinito-nexus.spec index 94f6a67489..80147859d6 100644 --- a/packaging/fedora/infinito-nexus.spec +++ b/packaging/fedora/infinito-nexus.spec @@ -1,5 +1,5 @@ Name: infinito-nexus -Version: 9.0.2 +Version: 9.1.0 Release: 1%{?dist} Summary: Meta package for Infinito.Nexus host dependencies @@ -58,6 +58,14 @@ install -d %{buildroot}%{_docdir}/%{name} %doc %{_docdir}/%{name}/DEPENDENCIES %changelog +* Mon Jun 01 2026 Kevin Veen-Birkenbach - 9.1.0-1 +- * More robust Nix installer on Debian, Ubuntu, Fedora and CentOS systems: stale nixbld users from earlier installation attempts are cleaned up before the multi-user installer runs, and a long-standing crash on hosts where the nixbld group is absent has been resolved. +* Outbound mail health checks no longer fail silently on minimal container images: the heartbeat-email script copes with images that ship without the hostname binary, and the SSL trust file path is detected automatically across Red Hat, Debian, Ubuntu, Alpine and NixOS layouts. +* The Zammad helpdesk role completes its single-sign-on schema unification, with the variant matrix and Playwright test suite brought in line with the new shape. +* Internal infrastructure cleanups: re-synchronised .dockerignore and a shifted weekly CI schedule. + +Release maintained by [Kevin Veen-Birkenbach](https://veen.world). + * Fri May 29 2026 Kevin Veen-Birkenbach - 9.0.2-1 - Restores the Debian dev-image build by introducing the INFINITO_VENV_DIR SPOT and calling infinito via its absolute venv path in scripts/docker/entry.sh, so the post-`make install` version check no longer trips on the PATH that bash -lc clobbers via /etc/profile; also scopes the auto-update PR dedup fingerprint to the files a run actually committed (instead of the whole commit tree) so unrelated drift on main no longer forces a fresh PR on every daily cron, nests web-app-bluesky's nocheck markers under the acl block they describe, and rolls up dependabot bumps (actions/cache 4→5, actions/setup-node 4→6) plus routine Docker image / git ref refreshes. diff --git a/pyproject.toml b/pyproject.toml index 3d2bc160f2..9f2f71fb8f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "infinito-nexus" -version = "9.0.2" +version = "9.1.0" description = "Infinito.Nexus" readme = "README.md" requires-python = ">=3.11"