Commit Graph
14501 Commits
Author SHA1 Message Date
kevinveenbirkenbachandClaude Opus 5.5 3044ae7a2e perf(web-app-nextcloud): plan the plugin pipeline from one app:list
Every addon ran through the install, enable and configure stages on its own, and each stage asked occ for the plugin's state again. The role now reads occ app:list --output=json once, and the new nextcloud_plugin_plan filter replays the addon order (an enabled entry switches its incompatible_plugins off and itself on, a disabled entry switches itself off, the later entry wins) and splits the app ids into disable, install, enable and configure. One app:disable call takes every id that has to go off; the install, enable and configure includes loop only over the ids that need that stage, so an already enabled plugin skips straight to its configuration. A plugin shipped as a pinned archive still goes through install on every run.

On echoserver the plugin phase took 608 s in full-9 for 51 addons; a repeat deploy is derived at about 195 s instead of about 550 s.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 07:39:16 +01:00
kevinveenbirkenbachandClaude Opus 5.5 d670d4f537 fix(web-app-wordpress,web-app-joomla): loop the vhosts without shadowing domain
9e2afff43b moved Mastodon and PeerTube off `loop_var: domain`, and full-9
on echoserver showed it: no warning for either, but WordPress still logged
"The loop variable 'domain' is already in use", because
tasks/utils/load/app.yml hands every loaded application `domain` as an
include var. WordPress and Joomla now name the item front_proxy_vhost and
pass it to sys-stk-front-proxy as `domain` in the include vars, the name
its tasks/main.yml reads. Their loop-var-shadow suppressions go, and no
`loop_var: domain` is left in the repository.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 00:54:43 +02:00
kevinveenbirkenbachandClaude Opus 5.5 7d777022e9 perf(web-app-listmonk): apply the settings in one psql run, recreate only on a change
02_manager_ops.yml ran one `container exec … psql` per LISTMONK_SETTINGS
entry, async and reaped (26.6 s plus 11.6 s in full-9 on echoserver,
47.5 s plus 12.9 s in full-6). templates/sql/apply_settings.sql.j2 now
collects every entry whose condition holds into one JSON object inside a
dollar quote and updates the rows that differ in a single statement
(UPDATE … FROM jsonb_each(…) WHERE value IS DISTINCT FROM); the task feeds
it to one psql over stdin.

The values no longer go through `'{{ item.value }}'`, which broke on any
apostrophe, and the OIDC secret, SMTP password and hCaptcha keys no
longer stand in the argv of the heredoc's bash -c. The unused
oidc_settings_json fact, which also carried the OIDC secret, is dropped.
psql reports `UPDATE n`, and only n > 0 notifies container-recreate, so a
deploy that changes no setting no longer recreates Listmonk (16.9 s in
full-9). d0ec15cc05 recreated on every run because Listmonk reads its
settings only at startup; a changed row still triggers that recreate.
What is given up: a run that dies between the UPDATE and the recreate
leaves the rows written, the next run sees UPDATE 0, and Listmonk keeps
the old values until a setting changes again or it restarts.

Evidence: Ansible's Templar renders the template with conditions as bool
and as string, apostrophes, `$` and lists; against PostgreSQL 16 the first
run printed UPDATE 5 with the exact values and the second UPDATE 0; the
old per-item quoting fails with a syntax error on an apostrophe.
ansible-lint --offline passes.

On merge: feature/store-i18n 5efd82b9c4 adds `include_tasks: 03_design.yml`
next to this task; keep it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 00:53:52 +02:00
kevinveenbirkenbachandClaude Opus 5.5 0ab85e0c86 Revert "perf(web-app-openwebui): poll the MCP grant every 3 s instead of every 10 s"
This reverts commit b625247d5b.

full-9 on echoserver measured it: the grant took 26.2 s with three
attempts, against 21.6 s with two in full-8. An attempt is not cheap, it
starts python3 in the container and signs in against the API (about 6 s),
and Open WebUI needs about 15 s after compose up before it answers. A 3 s
delay therefore spends two failed attempts on that wait where the 10 s
delay spent one.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 00:33:18 +02:00
kevinveenbirkenbachandClaude Opus 5.5 b19786c90f perf(sys-front-inj-matomo): resolve site ids from one cached site list, token in the POST body
Every vhost asked Matomo for its site id with its own
SitesManager.getSitesIdFromSiteUrl call, carrying token_auth in the query
string of a public URL (112.6 s of sys-front-inj-matomo in full-8, and one
token per call in the Matomo and proxy access logs). inject.yml now loads
SitesManager.getSitesWithAtLeastViewAccess once per Matomo URL and token
(matomo_site_cache, scoped by sha256 of both) and takes the lowest idsite
whose main_url is one of the five variants getNormalizedUrls builds
(Matomo 5.14.2 plugins/SitesManager/API.php:651). Only a cache miss runs
the old lookup; a failed list or lookup still turns the injection off for
the vhost. inject_apply.yml appends a site it adds, so a later vhost of the
same domain hits the cache.

Both reads send module, method and token_auth as a form-urlencoded POST
body, as feature/store-i18n 7309d50575 does; Matomo reads API parameters
from $_GET + $_POST (core/API/Request.php:774), which also settles that
commit's open question about POST for read methods.

A hit returns what the old lookup returned: getAllSitesIdFromSiteUrl is a
UNION of site.main_url and site_url.url without ORDER BY, the site table
has no index on main_url (PRIMARY KEY(idsite) only), so its first row is
the lowest matching idsite, and this role adds every site with a single
URL. A hand-made alias that points a lower idsite at the domain is the one
case where a hit picks differently; an alias-only match is a miss and
falls back to the lookup.

Evidence: Ansible's Templar evaluated every when of inject.yml and
inject_apply.yml for 28 states (list 200, error mapping, -1, skipped; hit,
miss, token change; lookup found, empty, error; append and later hit), all
as intended. ansible-lint --offline passes on both task files.

On merge: feature/store-i18n 7309d50575 moves the lookup into
tasks/resolve_site.yml and absorbs inject_apply.yml. Put the list load,
the cache and the cached-id step in front of its lookup there, keep its
dict-bodied addSite with its failed_when, and append to the cache after it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 23:18:52 +02:00
kevinveenbirkenbachandClaude Opus 5.5 1ec2b21c9c perf(web-app-mastodon): ensure the administrator in one rails runner
05_administrator.yml booted Rails three times for the administrator: a
rails runner to delete UsernameBlock rows, `tootctl accounts create`, and
an async `tootctl accounts modify --approve` with its reaper (8.8 s, 7.4 s
and 12.2 s in full-8). files/ruby/ensure_administrator.rb does all three in
one `bundle exec rails runner -` and prints `changed` or `ok` for
changed_when.

Without a local account it builds the User and Account the way Mastodon
v4.6.2 lib/mastodon/cli/accounts.rb `create` does with --confirmed --role
Owner: random password, agreement, bypass_registration_checks, then
mark_email_as_confirmed!. A local account without a user aborts. An
unapproved user gets approved = true and save!, as `modify --approve`
does. A mail address already held by another account now fails save!
loudly, where the old assert let the "taken" through and the approve
step failed instead. The README and playwright.env rationale keep their
claim (no captured password, so no native sign-in) with the new wording.

On merge: feature/store-i18n 6b3ca938dd and 7ca6537830 run four boots
there (unblock, create, admin_password.rb, approve) with
platform_administrator. Fold admin_password.rb into this script after the
create and before the approve (pass MASTODON_ADMIN_PASSWORD by name,
converge with valid_password? and update!), use platform_administrator,
and keep store-i18n's README and playwright.env wording, since the
password is converged there.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 23:08:44 +02:00
kevinveenbirkenbachandClaude Opus 5.5 2b11a7e9fe perf(web-app-discourse): read the applied settings back in the apply runner
The read-back booted Rails a second time (9.0 s on echoserver in full-8)
to check what the apply runner had just written. verify_settings.rb now
runs as the third script of the apply runner's `rails r` and registers
discourse_settings_readback for the unchanged refuse assert; every env var
and stdin line it needs is already a subset of the apply runner's.

It starts with SiteSetting.refresh!, which reloads the settings through
fetch_setting_hash_from_provider (Discourse v2026.9.1
lib/site_setting_extension.rb:595), so the check reads what the database
holds rather than the values the same process has just set;
User.find_by_email loads the administrator afresh. The formatter's wrap
of the `sh -c` line rides along; it parses to the same string.

On merge: feature/store-i18n 8c2f9c95c2 moves both runners' credentials
to `-e NAME` plus `environment:` and reads platform_administrator. Keep
that convention on the apply runner, drop the read-back runner as here,
and keep the third script and the register on the apply runner.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 23:04:50 +02:00
kevinveenbirkenbachandClaude Opus 5.5 28ce14ffe7 style(web-app-keycloak,web-app-openproject): apply autoformat to the no-verify commits
quality-high's autoformat pass rewrote three files that 9301220d05,
49aa920034 and c78d5f906c committed without the hooks. ruff drops three
`noqa: E402` markers as unused (RUF100): E402 does not fire on an import
that follows sys.path.insert. The formatter wraps the long
KEYCLOAK_RBAC_GROUP_LOGIC_DIGEST line and the OpenProject admin runner's
`sh -c` line; the double-quoted scalar and the `>-` block both fold the
break back into a space, and a parse against HEAD gives equal values.

On merge: feature/store-i18n 2bcf59109e carries the same four Keycloak
hunks byte for byte; they merge without a conflict.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 23:02:56 +02:00
kevinveenbirkenbachandClaude Opus 5.5 b625247d5b perf(web-app-openwebui): poll the MCP grant every 3 s instead of every 10 s
The grant runs right after compose up recreated Open WebUI, so its first
attempt meets a server that is still starting; full-7 and full-8 both
logged one retry and spent 21.9 s and 21.6 s on the task, most of it the
fixed 10 s delay. retries 100 with delay 3 keeps the 300 s budget for a
refusing server and lets the second attempt start after 3 s.

A server that accepts and then hangs costs each attempt up to the
script's 30 s urlopen timeout, so that failure now surfaces after about
3300 s instead of 1200 s; it fails the same way.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 23:00:18 +02:00
kevinveenbirkenbachandClaude Opus 5.5 9e2afff43b fix(web-app-mastodon,web-app-peertube): loop the vhosts without shadowing domain
tasks/utils/load/app.yml hands every loaded application `domain` as an
include var, so the vhost loops of Mastodon and PeerTube, which named
their item `domain`, made Ansible warn "The loop variable 'domain' is
already in use" (full-6 once, full-7 three times, full-8 twice). The loops
now name the item front_proxy_vhost and pass it to sys-stk-front-proxy as
`domain` in the include vars, which is the name its tasks/main.yml reads;
the two loop-var-shadow suppressions go with the shadowing.

Evidence: a stub playbook with an outer `domain` include var and a nested
include reproduces the warning with the old shape and shows none with the
new one; both shapes deliver each vhost to the outer and the nested role,
and the outer `domain` is intact after the loop.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 22:58:33 +02:00
kevinveenbirkenbachandClaude Opus 5.5 c5cb05905b fix(web-app-nextcloud): leave an LDAP-backed administrator's password to LDAP
full-8 on echoserver stopped in 02_manager_ops/04_admin.yml with
`[FAIL] occ user:resetpassword failed for 'administrator'.` and nothing
else. occ prints its error on stdout, which the script sent to /dev/null.
`occ user:info administrator` on the host showed `"backend":"LDAP"`: the
account lives in user_ldap, which refuses setPassword, and the declared
value is the role-local secrets.credentials.administrator_password, not
the LDAP password OpenLDAP keeps for that user.

When the marker does not match, the script now reads the backend from
`occ user:info --output=json` (the field is getBackendClassName(), and
Database::getBackendName() returns 'Database'). Any other backend ends
with `[UNCHANGED] The <backend> backend owns the password ...`; an empty
backend or a failing user:info is a [FAIL] that carries occ's output, as
is a failing user:resetpassword now. The password reaches the container
as `-e OC_PASS` by name only, so it no longer stands in the argv.

Evidence: six stubbed cases (LDAP, Database, reset error, user:info
error, no backend, marker match) pass with the password absent from
every recorded argv; the HEAD script reproduces the full-8 message on
the LDAP case. shellcheck clean.

On merge: feature/store-i18n ffed838bc7 changes the same exec line to
`-e OC_PASS`; this side already carries that line, take it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 22:55:47 +02:00
kevinveenbirkenbachandClaude Opus 5.5 d1a2b5c87e perf(mcp): rebuild and recreate only the adapter sidecar in compose mode
svc-ai-mcp-adapter/tasks/rebuild.yml notified compose-build and compose-up,
so every MCP provider rebuilt every image of its stack and ran a full
`compose up` to refresh one sidecar. In compose mode it now sets
compose_service_up_targets to the provider's mcp.endpoint.service_key and
notifies compose-service-up; swarm keeps the stack-wide path.

sys-svc-compose gains three handlers on that topic: `compose build` of the
targets with the same retry ladder as compose_build, a `--no-cache --pull`
rebuild once it is exhausted, and `compose up -d --no-deps` of the targets.
The instance guard listens to the topic too. They are defined after the
compose-up chain, so a flush that carries both brings the stack up first.
test_compose_build_retry_budget pins the new ladder against the budget.

When upstream_key.yml wrote a new credential it already includes the
rebuild and flushes, so gitea, gitlab, jenkins, mattermost and nextcloud
skip their own rebuild on `mcp_upstream_written.changed`; each registers it
unconditionally in the same file right before.

Baserow's Dockerfile and SSO files now notify compose-build and compose-up,
and the Nextcloud whiteboard Dockerfile adds compose-up to its build, so a
changed image also replaces the running container.

Evidence: the real handlers and rebuild.yml executed with a stubbed compose
binary ran guard, `build giteamcp`, `up -d --no-deps giteamcp` in the
instance dir; with a failing build, three attempts, the no-cache rebuild,
then up. All 16 providers declare a service_key equal to the compose service
name their template renders. DEPLOYMENT_MODE is defined as either swarm or
compose. Stacks keep coming up through sys-svc-compose up.yml, which
notifies compose-up on a changed template, no running container or a
pending marker; a stack whose adapter runs while its main service is
stopped is no longer started by the rebuild.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 22:54:21 +02:00
kevinveenbirkenbach 07887fcd42 Merge branch 'main' into feature/updater 2026-10-24 21:06:59 +02:00
kevinveenbirkenbach 57ffd74560 Merge pull request #1209 from infinito-nexus/fix/tls-selfsigned/cn-length
fix(tls-selfsigned): cap the leaf certificate CN at 64 characters
2026-10-24 21:05:17 +02:00
kevinveenbirkenbachandClaude Opus 5.5 e80eec2acb fix(tls-selfsigned): cap the leaf certificate CN at 64 characters
X.509 limits commonName to 64 characters, and openssl refuses a longer
one while generating the CSR:

  ASN1_mbstring_ncopy:string too long:../crypto/asn1/a_mbstr.c:106:maxsize=64

The global leaf builds its CN as `<DOMAIN_PRIMARY upper> Global TLS`, so
any primary domain longer than 53 characters fails the deploy in
sys-front-tls-selfsigned. Worktree stacks hit it first: their domain is
derived from the branch name (`fix-security-exec-argv-secrets-store-1153
.infinito.test` gives a 66 character CN).

The CN is now truncated to 64 characters in all three branches (global,
explicit subject CN, per-app primary domain). Clients verify the SAN
list, not the CN, so a truncated CN changes nothing for them, and an
existing certificate is only regenerated on SAN drift, as before.
sys-ca-selfsigned already caps the root CA's CN.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 21:04:10 +02:00
kevinveenbirkenbachandClaude Opus 5.5 3f331cd8b8 perf(web-app-moodle): converge plugin settings in one CLI run per plugin
04_oidc.yml and 05_ldap_sync.yml looped over 69 auth_oidc and 73
auth_ldap settings and ran one `container exec … php cfg.php --set` per
setting; every exec booted Moodle once, 62 s plus 73 s per deploy on
echoserver.

tasks/utils/plugin_config.yml stages files/php/provision/plugin_config.php
in the container and runs it once per plugin with `{component, settings}`
as JSON on stdin. The script validates the whole payload before writing,
refuses `core` and settings forced in config.php, and for each setting
compares get_config with the wanted value and calls set_config plus
add_to_config_log only on a difference, as cfg.php does; set_config
invalidates the plugin's config cache itself (Moodle v5.3.0
moodlelib.php). It prints `CHANGED <n>`, which drives changed_when.

bind_pw and clientsecret no longer sit on the argv of every exec as
`--set="…"`; they only travel in the stdin payload. Values that the old
host-shell double quotes altered are now written exactly, so the first
run may report them changed.

Evidence: PHPUnit in the test container 42/42 including the 9 new
PluginConfigTest cases; Templar render of both mappings identical to the
old loop items (69/69, 73/73).

On merge: feature/iam-profile-rbac a46d93ff96 replaces several field_map
values with OIDC.ATTRIBUTES.*; carry them into the new mappings.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 21:00:44 +02:00
kevinveenbirkenbachandClaude Opus 5.5 e4090ffce9 refactor(web-app-friendica,web-app-matomo): group the patch scripts in a patch folder
269a15863f added a second `patch_*.sh` to the shell files of Friendica
and Matomo, so test_prefix_grouped_files reported two prefix groups. The
scripts now live in files/shell/patch/ without the prefix
(ldapauth_autocreate.sh, local_config.sh, database.sh, trusted_hosts.sh)
and every task that ships them points at the new path. Content is
unchanged apart from the usage line of ldapauth_autocreate.sh.

On merge: feature/store-i18n changes the old patch_trusted_hosts.sh
(SIBLINGS); apply that change to patch/trusted_hosts.sh.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 20:58:26 +02:00
kevinveenbirkenbachandClaude Opus 5.5 8e35d053a2 fix(security): stop seeding demo data on every deploy, gate it on MODE_DEMO
Snipe-IT ran `php artisan db:seed --force` on every deploy. Its upstream
DatabaseSeeder (v8.8.3) truncates users, assets, licenses, orders and
settings, deletes uploads and creates about 2100 users, among them the
superusers `admin` and `snipe`, all with the factory password `password`,
plus a settings row against the public demo LDAP ldap.forumsys.com. Every
redeploy wiped real data and planted known superuser logins.

Decidim ran `rails db:seed` on every deploy with failed_when: false. The
generated seeds call Decidim.seed!, whose participatory-space seeds run in
production too: from the second deploy on they add demo processes and,
once a non-admin user exists, confirmed users with admin, moderator and
valuator roles and the password `decidim123456789`.

Snipe-IT now only creates its settings row when none exists, through
files/php/ensure_settings.php and SNIPE_IT_INITIAL_SETTINGS, and records
what already-seeded installs keep in TODO.md (taken verbatim from
d12b57be90 on feature/store-i18n). Decidim's seed task is gone; the role
creates its organization, pages and admin itself.

MODE_DEMO (group_vars/all/01_modes.yml, default false) brings both demo
seeds back on purpose; Decidim's then runs after the organization exists
and fails loudly. tests/lint/ansible/tasks/test_no_default_database_seeder.py
rejects Laravel's default seeder and Rails db:seed/seed:replant/setup/
reset/prepare unless the task is gated on MODE_DEMO; a Rails task whose
seeds are production-safe carries `# nocheck: default-seeder <reason>`,
which Mastodon does (find_or_create seeds, development-only admin seed).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 20:56:00 +02:00
kevinveenbirkenbachandClaude Opus 5.5 c78d5f906c perf(web-app-openproject): apply settings and the administrator in one rails runner
Three `bundle exec rails runner -` calls each booted OpenProject's Rails
app (35.2 s, 33.3 s and 33.1 s on echoserver): the settings in
02_settings.yml, the administrator and the LDAP link in 04_admin.yml.
They now run as one runner in 04_admin.yml with apply_settings.rb,
ensure_admin_user.rb and, under header SSO, link_admin_to_ldap.rb in that
order. It runs after 03_ldap.yml, which creates the ldap_auth_sources row
the link needs; nothing between 02 and 04 reads the settings.
02_settings.yml keeps only the migration and becomes 02_migrate.yml.

The administrator password and OPENPROJECT_RAILS_SETTINGS (which carries
smtp_password) leave argv: they are the first two stdin lines, exported
by `sh -c 'IFS= read -r …; export …; exec "$@"'` before rails reads the
script from the rest of stdin. stdin is a `|-` block, one expression per
line.

On merge: feature/store-i18n 463053e061 moved these secrets to
`environment:`; keep this version. feature/iam-profile-rbac 89e291e738
adds a fourth runner (reconcile_admins.rb) to 04_admin.yml; fold it into
this single runner.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 20:17:56 +02:00
kevinveenbirkenbachandClaude Opus 5.5 2949d46bff perf(web-app-discourse): apply settings and the admin in one rails runner
Applying the site settings and ensuring the administrator were two
container exec calls, each booting Rails (10.0 s and 8.8 s on
echoserver). They now run as one `rails r` with apply_settings.rb and
ensure_admin_user.rb concatenated in that order; the read-back stays a
separate call because it proves persistence.

The administrator password, the OIDC client secret and the LDAP site
settings (which carry ldap_bind_password) no longer travel as
`container exec -e NAME=value` argv entries: they are stdin lines that
`sh -c 'IFS= read -r …; export …; exec "$@"'` exports in the container
before exec'ing rails, so no secret appears in any process argv. stdin is
a `|-` block because `>- {{ a ~ '\n' ~ b }}` sends a literal backslash-n
in ansible-core 2.20. The read-back gets its two secrets the same way.

feature/store-i18n carries 463053e061 (`-e NAME` plus `environment:`)
for the same file; on merge, keep this version.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 20:07:16 +02:00
kevinveenbirkenbachandClaude Opus 5.5 269a15863f perf(web-app-friendica,web-app-matomo): report config patches changed only on change
Friendica's local.config.php patch (two sed -ri tasks) and Matomo's
config.ini.php database patch (four sed -i tasks) carried no changed_when
and notified compose-up, so every deploy reported them changed and
force-recreated the stack: a second compose flush for Friendica (about
19 s plus a restart) and pull, up and a health wait for Matomo (about
15 s plus a restart). Matomo's trusted-hosts script was already
idempotent but reported changed every run as well.

Each patch is now one script under files/shell/ that dry-runs its sed
expressions, compares cksum with the file, rewrites it only on a
difference and prints PATCHED; the tasks set changed_when on that marker.
The trusted-hosts script compares cksum before and after. Values reach
the scripts through the environment and are written literally, so a
password containing $ or a backtick is no longer mangled by host-shell
double quotes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 19:58:29 +02:00
kevinveenbirkenbachandClaude Opus 5.5 dba6aa7407 docs(requirements): add 045 stack service
Records the operator-confirmed design for replacing the sys-stk-full,
sys-stk-backend and sys-stk-front-proxy includes (115 call sites in 94
roles) with one shared `stack` service that sys-service-loader runs once
before the application roles and that processes every application of
the play in one batch: per-role literal `stack` and `openresty` keys,
front proxy and database derived from enabled services, per-domain vhost
data in meta without exceptions, all roles in one change.

The document carries the verified codebase facts with file:line on
origin/main 6997dd3dbb, the ordering and binding constraints, the cost
measured on the echoserver full-6 and full-7 deploys, a target design,
grouped acceptance criteria, validation commands and an implementation
order, so another agent can implement it without this conversation.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 19:48:43 +02:00
kevinveenbirkenbachandClaude Opus 5.5 49aa920034 perf(web-app-keycloak): mark user emails verified in one REST call
The emailVerified update looped over every non-reserved user, uploaded a
shell script per user and ran kcadm with a JVM login each time, and it
always reported changed: 7 users took 23.8 s on echoserver.

email_verified.py uses the shared keycloak_admin client through
tasks/utils/rest_script.yml: it looks each user up by exact username,
skips users already verified, and writes emailVerified with a GET plus a
full-representation PUT, as kcadm update did. The task reports changed
only when a user was updated, and a failed lookup now fails the task
instead of being treated as a missing user. The old lookup piped
kcadm -q username=X into head -n1, which could have hit a longer username
sharing the prefix.

Evidence (local compose, slot 104): summary updated=0 unchanged=8
missing=0 failed=0 in 0.60 s, task ok, staging dir removed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 19:39:53 +02:00
kevinveenbirkenbachandClaude Opus 5.5 9301220d05 perf(web-app-keycloak): reconcile per-app RBAC over the admin REST API
The per-app RBAC groups and LDAP group mappers were reconciled by four
kcadm shell scripts that started a JVM per call and re-synced every app
on every deploy: 582 s for the mappers plus 324 s for the orphan purge on
echoserver (39 apps).

rbac_reconcile.py now talks to the admin REST API from inside the
Keycloak network namespace (nsenter --net) with the admin credentials
read from /proc/<pid>/environ, so nothing secret reaches argv or output.
It drops the shared ldap-roles mapper, purges root groups of undeployed
apps, ensures each app group and mapper, and syncs a mapper only when the
group is new, the mapper config drifted, or the fingerprint stored on the
group (mapper payload, app rbac and domains, group-logic digest) differs.

The per-app payload no longer carries groups.path.group: Keycloak 26.8.1
does not store that key, so a payload with it never matched the stored
mapper and every deploy re-synced every app.

The admin client lives in keycloak_admin.py; tasks/utils/rest_script.yml
stages it with the script in a 0700 temp dir on KEYCLOAK_HOST_NODE, runs
it and removes the dir in an always block.

Evidence (local compose, slot 104): matrix iteration green in both
variants and passes; update runs show synced=1 in 1.1 s, then
synced=0 unchanged=1 in 0.81 s through the final delivery path, no
staging dir left behind.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 19:28:31 +02:00
kevinveenbirkenbachandClaude Opus 5.5 6aac7efb53 perf(svc-bkp-volume-2-local): install baudolo once per host
Every database seed included 01_install.yml unguarded, so the pinned
backup-docker-to-local package was installed again for each consumer
(15x per echoserver deploy) and the seed re-created DIR_SECRETS with mode
0755 each time (14x). The 0755 also fought the 0700 that sys-token-store
and this role's core set, so the secrets directory was world-listable
for stretches of every run and both sides reported changed.

01_install.yml now ensures DIR_SECRETS as root:root 0700 and sets
run_once_svc_bkp_volume_2_local_install; the core and the seed include it
only while that fact is undefined, following the run_once_<name>
convention of sys-svc-certs. The old guard on backup_docker_to_local_folder
was dead (defined nowhere). The reset only removes databases.csv, so
ensuring the directory before it is safe. A new ansible-playbook process
installs once again.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 19:09:33 +02:00
kevinveenbirkenbachandClaude Opus 5.5 352dceb0ed perf(web-app-bigbluebutton): render the compose override once
sys-svc-compose already renders the role's compose.override.yml.j2 for
every app (04_files.yml, mode 0640, notify compose-up). manager_ops.yml
rendered the same template a second time without a mode, which
stack_host_template defaults to 0644, so every deploy flipped the mode,
both writers reported changed and BigBlueButton's whole stack was
force-recreated (58 s up plus the Greenlight wait in echoserver full-7).
The template renders identically in both places: domain is a role var
and service_name is set inside the template. The role's own writer is
gone; the first deploy after this settles the mode to 0640 once.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 19:06:35 +02:00
kevinveenbirkenbachandClaude Opus 5.5 2515565e31 fix(sys-stk-front-proxy): probe the vhost itself, not where it redirects
The reachability probe and the post-reload verify followed redirects. A
vhost whose root redirects to a host the stack does not serve yet, such
as icons.infinito.nexus answering 302 to docs.infinito.nexus before
web-app-sphinx is deployed, made the probe fail the TLS handshake on the
default server (ssl_reject_handshake), report -1, and -1 is a stale-config
signature, so OpenResty was force-recreated on every deploy (echoserver
full-6 and full-7). Both probes now stop at the vhost's own answer; 301
and 302 are in DEFAULT_OK, and roles with 303/307/308 declare them. A
vhost OpenResty has not loaded still answers -1 or 404 without any
redirect, so stale-config detection is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 19:04:20 +02:00
kevinveenbirkenbachandClaude Opus 5.5 84159801f2 fix(tasks): name looped includes without their loop variable
Ansible renders a looped task's name before the loop variable exists, so
the GitLab and Mastodon wait includes and the Keycloak realm RBAC group
loop printed "<< error 1 - 'wait_container' is undefined >>" (or 'item')
in their task header and raised "Encountered 1 template error" on every
deploy. The names are static now; the per-item output still shows the
container or group path through the included tasks and the loop label.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 18:58:12 +02:00
kevinveenbirkenbachandClaude Opus 5.5 6c31c3fd79 fix(inventory): declare the mapache password the matrix aborts on
The deploy validates every inventory key against the names core reads,
and PLAYWRIGHT_MAPACHE_PASSWORD had lost its declaration when it left
secrets.credentials, so every local compose deploy aborted with
"'PLAYWRIGHT_MAPACHE_PASSWORD' is not read by the deploy". The persona
role now declares it; the inventory keeps owning the value.

(cherry picked from commit 323f3acfd8, playwright part only:
web-svc-design does not exist on this branch)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 18:07:19 +02:00
kevinveenbirkenbachandClaude Opus 5.5 372142848b test(web-app-stalwart): decide the IMAP parallelism instead of racing it
The parallel-sessions test asserted that more than one of four sessions
appended something, which a loaded host where one worker drains the
shared iterator fails with nothing broken. The sessions now meet at a
barrier before their first append, so a serialised pool still fails the
assertion while a concurrent one always passes.

(cherry picked from commit 657015852a)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 18:01:19 +02:00
kevinveenbirkenbachandClaude Opus 5.5 d48fcf7303 perf(ansible): keep SSH masters for two minutes and drop the group name warning
ControlPersist=20s closed the SSH master to a remote host whenever the controller worked longer than 20 s on its own, as it does while rendering the applications SPOT (up to 21 s), reaping async jobs or running localhost tasks, so the next task paid a fresh handshake. 120 s bridges those gaps; ServerAliveInterval still drops a dead connection within 45 s.

force_valid_group_names = ignore keeps the role-named groups exactly as never did and only stops the 'Invalid characters were found in group names' warning every play printed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 15:35:09 +02:00
kevinveenbirkenbach 9d08fda117 Merge remote-tracking branch 'origin/main' into feature/updater-lockdown-probe 2026-10-24 15:09:52 +02:00
kevinveenbirkenbachandClaude Opus 5.5 72da6f645e fix(web-app-seaweedfs): point the homepage at seaweedfs.com
https://seaweedfs.org/ answers 404, which failed test-external on the README link; seaweedfs.com answers 200. Same content as 7e241c6557 on main, so a later merge of main is clean.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 15:07:12 +02:00
kevinveenbirkenbachandClaude Opus 5.5 3efbdbdfc7 perf(sys-dns-cloudflare-records): apply the SRV records in parallel
SRV was the only record type applied one at a time: the three mail SRV records took 32 s in full-5. They now start as async jobs together with the other types. Only records that set ignore_errors: false join the reap, so a tolerated SRV failure still never stops the deploy, and without async the per-record ignore_errors applies as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 15:05:17 +02:00
kevinveenbirkenbachandClaude Opus 5.5 d3b9ae59a9 fix(sys-token-store): let the users lookup read the store of the stack host
Lookups render on the controller and read FILE_TOKENS there, while sys-token-store writes the store on STACK_HOST and mirrors it to the controller only in swarm. A compose deploy run from another machine therefore resolved every token empty: on echoserver Friendica rendered an empty SMTP_AUTH_PASS (msmtp: authentication method PLAIN needs a password) and Stalwart minted new bot app passwords on every run.

get_merged_users and the applications carrier key now take the sys_token_store_users fact, which the play reads from the stack host, over the controller file; write.yml refreshes the fact after each write, and 01_load.yml slurps from STACK_HOST so every host reads the store that is written. Without the fact, as in tests and ad-hoc calls, the controller file still applies, and where controller and stack host share the file the merged users are identical.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 15:01:05 +02:00
kevinveenbirkenbachandClaude Opus 5.5 84090bb24e perf(sys-stk-front-base): purge each Cloudflare zone once at the end of the play
Every front-proxied domain fired its own purge_everything, which clears the whole zone: 16 identical purges of infinito.nexus in full-5, 2 to 8 s each just to start the async task, and each one counted against Cloudflare's purge limit. A domain now only queues its zone, and the destructor stage purges every queued zone once, after the last app changed its content.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 13:38:37 +02:00
kevinveenbirkenbachandClaude Opus 5.5 ab356a079e test(lint): read the meta path of the loop_var lint from the role-file SPOT
The nested loop_var lint built meta/main.yml by hand, which test_file_spot refuses; it now imports ROLE_FILE_META_MAIN like the other role lints.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 13:19:36 +02:00
kevinveenbirkenbach 6997dd3dbb Merge pull request #1208 from infinito-nexus/update/docker-image-versions-web-app-socialhome-20261024-2923b1c
update(images): update Docker image versions (web-app-socialhome)
2026-10-24 13:05:10 +02:00
kevinveenbirkenbach 62164178a2 Merge pull request #1204 from infinito-nexus/fix/web-app-matrix/probe-and-federation-delegation
fix(web-app-matrix): probe only served domains and serve the federation delegation
2026-10-24 13:04:32 +02:00
infinito-nexus-updater[bot] bed4581faa update(images): update Docker image versions (web-app-socialhome) 2026-10-24 11:02:40 +00:00
kevinveenbirkenbach bc520e11af Merge pull request #1205 from infinito-nexus/fix/lint/mermaid-chrome-crash/1154
fix(install-lint): give chrome-headless-shell a font on dnf, yum and pacman
2026-10-24 13:02:04 +02:00
kevinveenbirkenbachandClaude Opus 5.5 bfd6f7c9b8 fix(install-lint): give chrome-headless-shell a font on dnf, yum and pacman
On a fresh Fedora dev container lint-mermaid failed most files with
ConnectionClosedError: the browser aborted with
`FATAL:third_party/skia/src/ports/SkFontMgr_FontConfigInterface.cpp:163]
Not implemented.` in its font fallback, because the host had no font at
all. install-lint provisions the browser's libraries by soname on dnf,
yum and pacman, and a font is not a soname; apt-get gets fonts through
puppeteer's --install-deps.

It looked load-dependent because lint-packages installs rpmlint in the
same parallel phase, which pulls fontconfig and Noto Sans: renders
crashed until that transaction landed, and every later run was green.
With every font removed, lint-mermaid alone fails 274 of 289 files the
same way.

ensure() now installs the distribution's font provide when
/usr/share/fonts holds no file (`font(:lang=en)` on dnf and yum,
`ttf-font` on pacman), and browser_installed() counts the font, so the
install-lint stamp is not fresh on a font-less host.

Closes #1154

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 12:59:42 +02:00
kevinveenbirkenbachandClaude Opus 5.5 ce9490d317 refactor(web-opt-rdr-domains): serve a per-domain well-known directory, not a Matrix path
045ef095f2 taught the generic redirect vhost a Matrix location and let
web-app-matrix include web-opt-rdr-domains for its server name on its
own. The first put one app's contract into a shared role and made every
redirect source (www, aliases, asset, css) advertise the Matrix
delegation; the second bypassed current_play_redirect_domains and could
overwrite a vhost the server name already had, such as the Synapse one.

Every redirect vhost now serves `/.well-known/` from `<well-known>/<domain>/`
and hands a missing file or the bare directory to `location /` via
`error_page 403 404 = /`, so it still answers 301 with the original
request URI. web-app-matrix only writes its delegation file into the
directory of its server name.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 12:59:22 +02:00
kevinveenbirkenbachandClaude Opus 5.5 cc3737463f perf(svc-db-postgres): skip the pg_hba swap when the password already works
The superuser check rewrote pg_hba.conf, reloaded and retried TCP auth before and after an ALTER USER even when nothing changed: 32.5 s on echoserver. It now first authenticates over the container's own address, where the image's scram rule applies; a deliberately wrong password must be refused there, so a trust rule can never report a match. Any other outcome falls through to the previous path.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 12:04:59 +02:00
kevinveenbirkenbachandClaude Opus 5.5 297f3f4a67 perf(web-app-discourse): pin the launcher and plugins to commits
discourse_docker tracked main, so every upstream push changed the git pull and rebuilt the image: 1029 s of the 2338 s full-4 deploy on echoserver. The launcher and the upstream plugins are pinned to their current branch tips; the git task fetches the pinned commit by refspec, and the plugin hook fetches a single commit instead of cloning a branch, which works for commits and branch names alike. The dead budget-derived UNICORN_WORKERS line is dropped: YAML kept the later 8, and the budget value would be 55 to 200 workers because split_postgres_connections no longer finds a postgres role.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 12:04:41 +02:00
kevinveenbirkenbachandClaude Opus 5.5 3d1480b3f7 fix(web-app-stalwart): resolve account ids when SSO owns the directory
With the Keycloak OIDC directory active, Stalwart refuses every account create with 'forbidden: Cannot set credentials for accounts in an external directory', and full-4 failed the new batch assert on all accounts. The create request now lists the accounts in the same call and takes each id from the listing of the provisioned domain. Under SSO a forbidden create is tolerated for people, who may not exist before their first login; every bot still needs an id because its app password is addressed by account.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 12:04:29 +02:00
kevinveenbirkenbachandClaude Opus 5.5 7e241c6557 fix(web-app-seaweedfs): point the homepage at seaweedfs.com
https://seaweedfs.org/ answers 404, which fails test-external
(tests/external/repository/test_urls_reachable.py) on README.md:167.
The upstream repository declares https://seaweedfs.com as its homepage.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 11:44:15 +02:00
kevinveenbirkenbachandClaude Opus 5.5 045ef095f2 fix(web-app-matrix): serve the federation delegation on the server name
The LiveKit JWT service checks each OpenID token over federation
against the user's homeserver. Server discovery found no delegation:
https://<server_name>/.well-known/matrix/server hit the redirect vhost
of web-opt-rdr-domains, which answered 301 to the dashboard and then
404, so the lookup fell back to <server_name>:8448. In compose OpenResty
runs in the host network and answers there; in swarm it publishes 80
and 443 only, the dial was refused and Element Call's token exchange
returned 401 M_UNAUTHORIZED (main run 40017166046, Nextcloud#12).

The role also wrote the delegation to `<well-known>/matrixserver`,
because the file path joined the directory and `server` without a
separator.

The file now lands at `<well-known>/matrix/server`, and the redirect
vhost serves `/.well-known/matrix/` from the shared well-known
directory, so discovery delegates to the Synapse domain on 443 in both
modes. Both flavors share tasks/utils/well_known.yml, which also
includes web-opt-rdr-domains for the server name when no play-wide
redirect claims it, so the delegation has a vhost there too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 11:44:14 +02:00
kevinveenbirkenbachandClaude Opus 5.5 7a82a92e84 fix(web-app-prometheus): probe only the domains an app serves itself
#1180 gave web-app-matrix a canonical `jitsi` domain for its own Jitsi
and listed it under `services.jitsi.domains`. When Jitsi is shared or
disabled nothing serves that domain, and the blackbox healthz job of
web-app-prometheus probed every canonical domain, so the probe of
https://jitsi.matrix.<domain>/healthz/ready failed with "tls:
unrecognized name" and `prometheus scrape: every consumer role reports
up=1 and passes its probe` went red (main run 40017166046: Matrix#2,
Nextcloud#12).

web_health_expectations already skipped such keys. The rule now lives
in utils/domains/unserved.py: a key claimed by a service entity that is
disabled, or enabled but shared, is not served by that app. The health
filter uses it unchanged, and prometheus.yml.j2 filters its targets
through the new `served_domains` filter, which also drops the
`<key>_onion` mirror of a skipped key.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 11:44:14 +02:00
kevinveenbirkenbachandClaude Opus 5.5 37e1a178a5 fix(roles): give every dependency loop a role-unique loop_var
Seventeen roles looped their dependency includes as dependency_role, and several of them reach each other (svc-bkp-* -> sys-ctl-cln-bkps -> sys-ctl-alm-compose, sys-svc-webserver-https -> sys-svc-cln-domains), so full-4 warned 'The loop variable dependency_role is already in use' three times. Each loop now names its item <role>_dependency. A new lint follows looped include_role targets transitively and refuses an outer loop_var that a reached role loops with again.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 11:25:48 +02:00