diff --git a/requirements/requirements.galaxy.yml b/requirements/requirements.galaxy.yml index d33da491ca..742b4a0226 100644 --- a/requirements/requirements.galaxy.yml +++ b/requirements/requirements.galaxy.yml @@ -3,7 +3,7 @@ collections: - name: ansible.posix version: 2.2.2 - name: ansible.mariadb - version: 6.0.2 + version: 6.0.3 - name: kewlfft.aur version: 0.13.0 - name: community.general diff --git a/requirements/requirements.git.yml b/requirements/requirements.git.yml index 4abcbdb8b3..555e7cb524 100644 --- a/requirements/requirements.git.yml +++ b/requirements/requirements.git.yml @@ -8,7 +8,7 @@ collections: - name: ansible.mariadb source: https://github.com/ansible-collections/ansible.mariadb.git type: git - version: 6.0.2 + version: 6.0.3 - name: kewlfft.aur source: https://github.com/kewlfft/ansible-aur.git diff --git a/roles/dsk-blender/tasks/00_core.yml b/roles/dsk-blender/tasks/00_core.yml index 9f038f066f..ebee471138 100644 --- a/roles/dsk-blender/tasks/00_core.yml +++ b/roles/dsk-blender/tasks/00_core.yml @@ -7,6 +7,8 @@ apply: become: true become_user: "{{ blender_user }}" + environment: + PATH: "{{ blender_exec_path }}" when: blender_mcp_enabled | bool - name: 🏛️ Give Blender its IFC and BIM surface @@ -15,4 +17,6 @@ apply: become: true become_user: "{{ blender_user }}" + environment: + PATH: "{{ blender_exec_path }}" when: blender_bonsai_enabled | bool diff --git a/roles/dsk-blender/tasks/addons/mcp-for-blender.yml b/roles/dsk-blender/tasks/addons/mcp-for-blender.yml index 55dc5a8c26..555ca8f2d8 100644 --- a/roles/dsk-blender/tasks/addons/mcp-for-blender.yml +++ b/roles/dsk-blender/tasks/addons/mcp-for-blender.yml @@ -30,7 +30,7 @@ - install-addon environment: BLENDERMCP_ADDONS_DIR: "{{ blender_addons_probe.stdout | regex_search('ADDONS=(\\S+)', '\\1') | first }}" - PATH: "{{ blender_pipx_bin_dir }}:/usr/local/bin:/usr/bin:/bin" + PATH: "{{ blender_pipx_bin_dir }}:{{ blender_exec_path }}" register: blender_mcp_addon changed_when: "'installed' in (blender_mcp_addon.stdout | lower)" diff --git a/roles/dsk-blender/vars/main.yml b/roles/dsk-blender/vars/main.yml index 52e71b26f3..86dede1a17 100644 --- a/roles/dsk-blender/vars/main.yml +++ b/roles/dsk-blender/vars/main.yml @@ -3,6 +3,7 @@ application_id: dsk-blender blender_user: "{{ lookup('users', WORKSTATION_USER).username }}" blender_home: "/home/{{ blender_user }}" blender_pipx_bin_dir: "{{ [blender_home, '.local', 'bin'] | path_join }}" +blender_exec_path: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" blender_claude_registry: "{{ [blender_home, '.claude.json'] | path_join }}" blender_mcp_enabled: "{{ lookup('config', application_id, 'addons.mcp-for-blender.enabled') | bool }}" blender_mcp_distribution: "{{ lookup('config', application_id, 'addons.mcp-for-blender.config.distribution') }}" diff --git a/roles/dsk-gnt-claude/meta/services.yml b/roles/dsk-gnt-claude/meta/services.yml index 2bffddfe3e..9773dd0e17 100644 --- a/roles/dsk-gnt-claude/meta/services.yml +++ b/roles/dsk-gnt-claude/meta/services.yml @@ -9,7 +9,7 @@ claude: host: enabled: true lifecycle: alpha - npm_version: 2.1.322 + npm_version: 2.1.323 update: key: npm_version type: npm diff --git a/roles/dsk-gnt-codex/meta/services.yml b/roles/dsk-gnt-codex/meta/services.yml index 068ed00b7a..11fe62524d 100644 --- a/roles/dsk-gnt-codex/meta/services.yml +++ b/roles/dsk-gnt-codex/meta/services.yml @@ -9,7 +9,7 @@ codex: host: enabled: true lifecycle: alpha - npm_version: 0.167.2 + npm_version: 0.169.0 update: key: npm_version type: npm diff --git a/roles/svc-cache-package/meta/services.yml b/roles/svc-cache-package/meta/services.yml index f1a9a92e74..1a4e561a09 100644 --- a/roles/svc-cache-package/meta/services.yml +++ b/roles/svc-cache-package/meta/services.yml @@ -89,6 +89,11 @@ frontend: http: 80 https: 443 lifecycle: beta + security: + suppressions: + # nocheck: cve upstream tag ships fixable CRITICAL CVEs; lift it once a rebuilt tag lands + - image_tag: "1.31-alpine" + until: 2026-11-30 # nocheck: dynamic-flag - proxied package content is re-fetchable, the backup consumer stays permanently off container_backup: enabled: false diff --git a/roles/sys-ctl-hlth-runtime/README.md b/roles/sys-ctl-hlth-runtime/README.md index c4c9fa73c6..8b0fd93533 100644 --- a/roles/sys-ctl-hlth-runtime/README.md +++ b/roles/sys-ctl-hlth-runtime/README.md @@ -28,6 +28,7 @@ Solid `1:1` edges are fixed relationships; dashed `0..1` edges are conditional ( ## Features - **Targets:** `container` scans the image of every running container through the read-only Docker socket, `host` scans the host root filesystem mounted read-only. In swarm every node scans itself. +- **Engine runtime:** An engine run that reads the host Docker socket runs on `runc`, also on a swarm worker that [`svc-virt-kata`](../svc-virt-kata/README.md) defaults to gVisor or Kata, because those runtimes refuse the bind-mounted socket and every container scan would fail there. Every other engine run, the host scan included, keeps the node's default runtime. - **Engines:** Syft builds one SBOM per target, Grype and OSV-Scanner read it, Trivy reads the target itself. Without `syft` in `engines`, Grype and OSV-Scanner read the target directly; `osv` then scans containers only. - **Source-built runtimes:** A runtime compiled into the image, such as the PHP of the official `php` images, is matched by Grype only. With `syft` but without `grype` in `engines`, Grype still scans the binary-classified packages of every SBOM. - **Threshold:** `severity` maps each reported severity to `fail` or `warn`, `{CRITICAL: fail, HIGH: warn}` by default and in production. The development inventory that `INFINITO_INVENTORY_VARS_FILE` names maps `CRITICAL` to `warn`, so a CI or development deploy reports a CRITICAL finding as a `⚠️` line and a `warn` record without failing, and the daily mirror scan tracks it as a `vulnerability` issue. A severity the mapping does not name is not reported, and `fixed_only` limits the report to findings with a fixed version. The list form of `severity` is rejected. diff --git a/roles/sys-ctl-hlth-runtime/files/python/script.py b/roles/sys-ctl-hlth-runtime/files/python/script.py index 582bab3251..f824cbd626 100755 --- a/roles/sys-ctl-hlth-runtime/files/python/script.py +++ b/roles/sys-ctl-hlth-runtime/files/python/script.py @@ -62,6 +62,7 @@ WORK = "/work" SBOM = "/sbom" CACHE = "/cache" DOCKER_SOCKET = "/var/run/docker.sock" +SOCKET_RUNTIME = "runc" JOB_TIMEOUT_SECONDS = 4 * 3600 EXPORT_SLOTS = 1 RUN_PREFIX = "run-" @@ -1220,20 +1221,24 @@ def run_argv( image: the engine image. args: the engine's arguments. target: the target, which picks the host or Docker socket mount; - ``None`` for a run that reads neither. + ``None`` for a run that reads neither. A run with the Docker + socket runs on :data:`SOCKET_RUNTIME`, every other run on the + daemon's default runtime. extra_env: environment on top of the engine's own. scratch: :attr:`Step.scratch` of the run, its ``TMPDIR`` under :data:`WORK`. """ + options = ["--rm"] mounts = ["-v", f"{layout.sbom}:{SBOM}", "-v", f"{layout.work}:{WORK}"] if engine in SCANNERS: mounts += ["-v", f"{layout.databases / engine}:{CACHE}"] if target is not None and target.kind == "host": mounts += ["-v", f"/:{HOST_ROOT}:ro"] if target is not None and target.kind == "container": + options += ["--runtime", SOCKET_RUNTIME] mounts += ["-v", f"{DOCKER_SOCKET}:{DOCKER_SOCKET}:ro"] environment = {"TMPDIR": f"{WORK}/{scratch}", **ENGINE_ENV[engine], **extra_env} - return (*layout.runtime, "--rm", *mounts, *_env(environment), image, *args) + return (*layout.runtime, *options, *mounts, *_env(environment), image, *args) def scratch_of(engine: str, subject: str) -> str: @@ -1385,7 +1390,7 @@ def grype_step(layout: Layout, image: str, target: Target, config: ScanConfig) - "grype", image, args, - target=target, + target=None if config.reads_sbom("grype") else target, extra_env={"GRYPE_DB_AUTO_UPDATE": "false"}, scratch=scratch, ), diff --git a/roles/sys-service/vars/main.yml b/roles/sys-service/vars/main.yml index 5392f9f1ac..222da26a1a 100644 --- a/roles/sys-service/vars/main.yml +++ b/roles/sys-service/vars/main.yml @@ -73,4 +73,4 @@ system_service_tpl_runtime: "{{ '' if system_service_tpl_type == 'oneshot' else system_service_tpl_exec_start_pre: "" system_service_tpl_exec_start: "{{ system_service_script_exec }}" system_service_tpl_exec_start_post: "" -system_service_tpl_timeout_start_sec: "" # If not defined the default values from sys-daemon in manager will be used +system_service_tpl_timeout_start_sec: "{{ SYS_SERVICE_DEFAULT_RUNTIME if system_service_tpl_type == 'oneshot' else '' }}" diff --git a/roles/web-app-bridgy-fed/meta/services.yml b/roles/web-app-bridgy-fed/meta/services.yml index f6648a6ee7..0b0a13f888 100644 --- a/roles/web-app-bridgy-fed/meta/services.yml +++ b/roles/web-app-bridgy-fed/meta/services.yml @@ -53,7 +53,7 @@ bridgy-fed: version: 3.14-slim name: web-app-bridgy-fed repository: https://github.com/snarfed/bridgy-fed.git - ref: 187d21635727ea92e5689b953d9054de12fc7602 + ref: d340cd2cba1ca089bf919dbfcca9644dc99e11be ports: local: http: 8053 diff --git a/roles/web-app-erpnext/templates/compose.yml.j2 b/roles/web-app-erpnext/templates/compose.yml.j2 index 2015935cac..5e9530c30b 100644 --- a/roles/web-app-erpnext/templates/compose.yml.j2 +++ b/roles/web-app-erpnext/templates/compose.yml.j2 @@ -1,5 +1,16 @@ {% include 'roles/sys-svc-compose/templates/base.yml.j2' %} -{% set ERPNEXT_CONFIG_READY_GATE = "until grep -q redis_socketio sites/common_site_config.json 2>/dev/null; do sleep 2; done;" %} +{% set ERPNEXT_CONFIGURATOR_STEPS = [ + 'ls -1 apps > sites/apps.txt', + 'bench set-config -g db_host "' ~ ERPNEXT_DB_HOST ~ '"', + 'bench set-config -gp db_port ' ~ ERPNEXT_DB_PORT, + 'bench set-config -g redis_cache "' ~ ERPNEXT_REDIS_URL ~ '/0"', + 'bench set-config -g redis_queue "' ~ ERPNEXT_REDIS_URL ~ '/1"', + 'bench set-config -g redis_socketio "' ~ ERPNEXT_REDIS_URL ~ '/2"', + 'bench set-config -gp socketio_port ' ~ ERPNEXT_WEBSOCKET_PORT, + 'bench set-config -g host_name "' ~ lookup('tls', application_id, 'url.origin') ~ '"', + ] %} +{% set ERPNEXT_CONFIGURATOR_DIGEST = ERPNEXT_CONFIGURATOR_STEPS | join(';') | hash('sha256') %} +{% set ERPNEXT_CONFIG_READY_GATE = "until grep -q " ~ ERPNEXT_CONFIGURATOR_DIGEST ~ " sites/common_site_config.json 2>/dev/null; do sleep 2; done;" %} {% set ERPNEXT_BACKEND_READY_GATE = "until (exec 3<>/dev/tcp/backend/" ~ ERPNEXT_BACKEND_PORT ~ ") 2>/dev/null; do sleep 2; done;" %} {% set service_name = 'backend' %} @@ -82,14 +93,11 @@ - -c command: - > - ls -1 apps > sites/apps.txt; - bench set-config -g db_host "{{ ERPNEXT_DB_HOST }}"; - bench set-config -gp db_port {{ ERPNEXT_DB_PORT }}; - bench set-config -g redis_cache "{{ ERPNEXT_REDIS_URL }}/0"; - bench set-config -g redis_queue "{{ ERPNEXT_REDIS_URL }}/1"; - bench set-config -g redis_socketio "{{ ERPNEXT_REDIS_URL }}/2"; - bench set-config -gp socketio_port {{ ERPNEXT_WEBSOCKET_PORT }}; - bench set-config -g host_name "{{ lookup('tls', application_id, 'url.origin') }}"; + set -e; + {% for step in ERPNEXT_CONFIGURATOR_STEPS %} + {{ step }}; + {% endfor %} + bench set-config -g infinito_configurator_digest "{{ ERPNEXT_CONFIGURATOR_DIGEST }}"; {{ lookup('container_volumes', service_name) | indent(4) }} {{ lookup('container_depends_on', application_id) | indent(4) }} {{ lookup('container_extra_hosts') | indent(4) }} diff --git a/roles/web-app-jenkins/meta/addons/mattermost.yml b/roles/web-app-jenkins/meta/addons/mattermost.yml index 9f8bec1d6b..688064ce32 100644 --- a/roles/web-app-jenkins/meta/addons/mattermost.yml +++ b/roles/web-app-jenkins/meta/addons/mattermost.yml @@ -3,7 +3,8 @@ enabled: "{{ lookup('config', 'web-app-jenkins', 'services.mattermost.enabled') required: true mechanism: plugin source: upstream -version: "latest" +# nocheck: unwatched-version Reason: mattermost 3.2.0 and later ship Java 25 bytecode, so on the Java 21 runtime of the jenkins/jenkins LTS image their descriptors fail with UnsupportedClassVersionError and the plugin's global section vanishes; move the pin only together with a Java 25 controller image +version: "3.1.3" bridges: - mattermost config: diff --git a/roles/web-app-n8n/meta/services.yml b/roles/web-app-n8n/meta/services.yml index 04ef0862a3..6fa693bea9 100644 --- a/roles/web-app-n8n/meta/services.yml +++ b/roles/web-app-n8n/meta/services.yml @@ -75,7 +75,7 @@ n8n: backup: stop_required: true image: docker.n8n.io/n8nio/n8n - version: "3.2.0" + version: "3.2.2" update: type: registry_tags image: docker.n8n.io/n8nio/n8n diff --git a/roles/web-app-nextcloud/templates/config/memcache.config.php.j2 b/roles/web-app-nextcloud/templates/config/memcache.config.php.j2 index 2e81c4695b..aa2cb7b1f6 100644 --- a/roles/web-app-nextcloud/templates/config/memcache.config.php.j2 +++ b/roles/web-app-nextcloud/templates/config/memcache.config.php.j2 @@ -1,9 +1,4 @@ '\\OC\\Memcache\\APCu', -]; -{% else %} {% set _redis_user = lookup('engine', 'redis', application_id, 'username') %} {% set _redis_password = lookup('engine', 'redis', application_id, 'password') %} return [ @@ -21,4 +16,3 @@ return [ {% endif %} ], ]; -{% endif %} diff --git a/roles/web-app-odoo/files/pip/requirements-no-deps.txt b/roles/web-app-odoo/files/pip/requirements-no-deps.txt index 81b3ccf645..6986342ca0 100644 --- a/roles/web-app-odoo/files/pip/requirements-no-deps.txt +++ b/roles/web-app-odoo/files/pip/requirements-no-deps.txt @@ -1,3 +1,3 @@ odoo-addon-fs_storage==19.0.1.1.3.5 -odoo-addon-fs_attachment==19.0.1.1.4 +odoo-addon-fs_attachment==19.0.1.1.7 odoo-addon-fs_attachment_s3==19.0.1.2.1.4 diff --git a/roles/web-app-penpot/files/playwright/_shared.js b/roles/web-app-penpot/files/playwright/_shared.js index deaef6c22a..50d60483de 100644 --- a/roles/web-app-penpot/files/playwright/_shared.js +++ b/roles/web-app-penpot/files/playwright/_shared.js @@ -83,21 +83,41 @@ const env = { biberEmail: decodeDotenvQuotedValue(process.env.BIBER_EMAIL), }; -const loginRoute = (base) => `${base.replace(/\/$/, "")}/#/auth/login`; +const screenRoute = (base, screen) => `${base.replace(/\/$/, "")}/?screen=${screen}`; +const loginRoute = (base) => screenRoute(base, "auth-login"); +const screenOf = (url) => new URL(url).searchParams.get("screen") || ""; async function assertAuthenticated(page) { await expect - .poll(() => page.url(), { timeout: resolveTimeout(60_000), message: "expected to leave the login route after sign-in" }) - .not.toContain("/auth/login"); - await expect - .poll(() => page.url(), { timeout: resolveTimeout(60_000), message: "expected the SPA to reach a #/ route after sign-in" }) - .toContain("#/"); + .poll(() => screenOf(page.url()), { timeout: resolveTimeout(60_000), message: "expected the SPA to reach a dashboard screen after sign-in" }) + .toMatch(/^dashboard-/); await expect( page.locator("[data-testid='dashboard-sidebar']"), "Expected the Penpot dashboard shell, not a gateway error page", ).toBeVisible({ timeout: resolveTimeout(60_000) }); } +/** + * Args: + * page: Playwright page that has just come back from the Keycloak login form. + * fullname: name entered when Penpot's first sign-in form arrives without one. + */ +async function confirmFirstOidcSignIn(page, fullname) { + await expect + .poll(() => screenOf(page.url()), { + timeout: resolveTimeout(60_000), + message: "expected Penpot to answer the OIDC callback with the dashboard or its first sign-in form", + }) + .toMatch(/^(dashboard-|auth-register-validate$)/); + if (screenOf(page.url()) !== "auth-register-validate") return; + const nameField = page.getByLabel(/full ?name/i); + await expect(nameField, "Expected the first sign-in form to ask for the full name").toBeVisible({ timeout: resolveTimeout(30_000) }); + if (!(await nameField.inputValue())) await nameField.fill(fullname); + const createAccount = page.getByRole("button", { name: /^create an account$/i }); + await expect(createAccount, "Expected the first sign-in form to enable its submit button").toBeEnabled({ timeout: resolveTimeout(30_000) }); + await createAccount.click({ timeout: resolveTimeout(30_000) }); +} + // In-app OIDC (flavor: oidc): the login page renders an "OpenID" provider entry // (clickable text, not a role=button) that redirects to Keycloak. async function penpotOidcLogin(page, username, password) { @@ -110,6 +130,7 @@ async function penpotOidcLogin(page, username, password) { .poll(() => page.url(), { timeout: resolveTimeout(60_000), message: `expected redirect to ${expectedAuth}` }) .toContain(expectedAuth); await performKeycloakLoginForm(page, username, password); + await confirmFirstOidcSignIn(page, username); await assertAuthenticated(page); } @@ -132,7 +153,7 @@ async function penpotLdapLogin(page, email, password) { // two-step form: email/password, then full name). SMTP-off deployments activate // the profile immediately (no verification), landing on the dashboard. async function penpotRegister(page, fullname, email, password) { - await gotoOnion(page, `${env.baseUrl.replace(/\/$/, "")}/#/auth/register`); + await gotoOnion(page, screenRoute(env.baseUrl, "auth-register")); const emailField = page.getByLabel(/work email|^email$/i).first(); const passwordField = page.getByLabel(/^password$/i).first(); await expect(emailField, "Expected the Penpot register form").toBeVisible({ timeout: resolveTimeout(60_000) }); @@ -183,6 +204,7 @@ module.exports = { runGuestFlow, env, loginRoute, + screenOf, penpotOidcLogin, penpotLdapLogin, penpotNativeLogin, diff --git a/roles/web-app-penpot/files/playwright/playwright.spec.js b/roles/web-app-penpot/files/playwright/playwright.spec.js index 9bdadb1724..50ae94b48d 100644 --- a/roles/web-app-penpot/files/playwright/playwright.spec.js +++ b/roles/web-app-penpot/files/playwright/playwright.spec.js @@ -63,8 +63,8 @@ test("asset: administrator uploads an image asset into a design file", async ({ const newFile = page.getByText(/\+\s*New File/i).first(); await expect(newFile, "Expected a create-file control in Drafts").toBeVisible({ timeout: resolveTimeout(60_000) }); await newFile.click({ timeout: resolveTimeout(30_000) }); - await expect.poll(() => page.url(), { timeout: resolveTimeout(90_000), message: "expected to enter the Penpot workspace editor" }) - .toContain("/workspace"); + await expect.poll(() => shared.screenOf(page.url()), { timeout: resolveTimeout(90_000), message: "expected to enter the Penpot workspace editor" }) + .toBe("workspace"); const validPng = shared.validImagePng(); const fileInput = page.locator("#image-upload"); diff --git a/roles/web-app-penpot/files/playwright/test-design.js b/roles/web-app-penpot/files/playwright/test-design.js index 3ce02e79dd..0bac747c2a 100644 --- a/roles/web-app-penpot/files/playwright/test-design.js +++ b/roles/web-app-penpot/files/playwright/test-design.js @@ -85,21 +85,25 @@ async function rpc(page, method, params) { ); } +/** + * Args: + * base: Penpot base URL without a trailing slash. + * name: marker that makes the document URL unique, so two views of the same screen each load a document of their own. + * screen: Penpot screen as its route id, optionally followed by "?" and that screen's query parameters, e.g. "dashboard-recent?team-id=…"; empty for the app root. + * + * Returns: + * The query-routed URL Penpot 2.19 resolves that screen from. + */ +function screenUrl(base, name, screen) { + const [id, params] = screen.split("?"); + const query = [id && `screen=${id}`, params, `design-view=${name}`].filter(Boolean); + return `${base}/?${query.join("&")}`; +} + exports.register = function (shared) { const { test, expect, skipUnlessServiceEnabled, isServiceEnabled, env } = shared; const base = env.baseUrl.replace(/\/$/, ""); - - /** - * Args: - * name: marker that makes the document URL unique. Every Penpot route is a hash route, so without it two routes share one document and a navigation between them requests none. - * route: hash route of the app, starting with a slash. - * - * Returns: - * The URL of that route. - */ - function url(name, route) { - return `${base}/?design-view=${name}#${route}`; - } + const url = (name, screen) => screenUrl(base, name, screen); async function animationsSettled(page) { await expect @@ -167,7 +171,7 @@ exports.register = function (shared) { async function signIn(page) { if (session) { await page.context().addCookies(session); - await gotoOnion(page, url("session", "/")); + await gotoOnion(page, url("session", "")); } else if (isServiceEnabled("sso")) { await shared.penpotOidcLogin(page, env.adminUsername, env.adminPassword); } else if (isServiceEnabled("ldap")) { @@ -247,10 +251,10 @@ exports.register = function (shared) { function visitorViews() { return [ - { name: "sign-in", url: url("sign-in", "/auth/login"), prepare: shown(LOGIN_TITLE, VIEW_TIMEOUT) }, + { name: "sign-in", url: url("sign-in", "auth-login"), prepare: shown(LOGIN_TITLE, VIEW_TIMEOUT) }, { name: "sign-in-focus", - url: url("sign-in-focus", "/auth/login"), + url: url("sign-in-focus", "auth-login"), prepare: async (page) => { await shown(EMAIL, VIEW_TIMEOUT)(page); await page.locator(EMAIL).focus(); @@ -259,7 +263,7 @@ exports.register = function (shared) { }, { name: "sign-in-invalid", - url: url("sign-in-invalid", "/auth/login"), + url: url("sign-in-invalid", "auth-login"), prepare: async (page) => { await shown(EMAIL, VIEW_TIMEOUT)(page); await page.locator(EMAIL).fill("not-an-address"); @@ -269,7 +273,7 @@ exports.register = function (shared) { }, { name: "recovery-request", - url: url("recovery-request", "/auth/recovery/request"), + url: url("recovery-request", "auth-recovery-request"), prepare: shown(RECOVERY_SUBMIT, VIEW_TIMEOUT), }, ]; @@ -277,60 +281,60 @@ exports.register = function (shared) { function signedInViews({ teamId, projectId, fileId }) { const team = `team-id=${teamId}`; - const dashboard = (name, route, content) => ({ name, url: url(name, route), prepare: loaded(SIDEBAR, content) }); - const settings = (name, route, content) => ({ name, url: url(name, route), prepare: loaded(SETTINGS_NAV, content) }); + const dashboard = (name, screen, content) => ({ name, url: url(name, screen), prepare: loaded(SIDEBAR, content) }); + const settings = (name, screen, content) => ({ name, url: url(name, screen), prepare: loaded(SETTINGS_NAV, content) }); return [ - dashboard("projects", `/dashboard/recent?${team}`, NEW_PROJECT), + dashboard("projects", `dashboard-recent?${team}`, NEW_PROJECT), { name: "project-menu", - url: url("project-menu", `/dashboard/recent?${team}`), + url: url("project-menu", `dashboard-recent?${team}`), prepare: opened(SIDEBAR, PROJECT_OPTIONS, "[role='menu'] [role='menuitem']"), }, - dashboard("project-files", `/dashboard/files?${team}&project-id=${projectId}`, GRID_ITEM), - dashboard("libraries", `/dashboard/libraries?${team}`, HEADER), - dashboard("fonts", `/dashboard/fonts?${team}`, HEADER), - dashboard("deleted", `/dashboard/deleted?${team}`, DELETED), - dashboard("team-members", `/dashboard/members?${team}`, TABLE_ROW), - dashboard("team-invitations", `/dashboard/invitations?${team}`, INVITE), - dashboard("team-settings", `/dashboard/settings?${team}`, HEADER), + dashboard("project-files", `dashboard-files?${team}&project-id=${projectId}`, GRID_ITEM), + dashboard("libraries", `dashboard-libraries?${team}`, HEADER), + dashboard("fonts", `dashboard-fonts?${team}`, HEADER), + dashboard("deleted", `dashboard-deleted?${team}`, DELETED), + dashboard("team-members", `dashboard-members?${team}`, TABLE_ROW), + dashboard("team-invitations", `dashboard-invitations?${team}`, INVITE), + dashboard("team-settings", `dashboard-settings?${team}`, HEADER), { name: "invite-dialog", - url: url("invite-dialog", `/dashboard/invitations?${team}`), + url: url("invite-dialog", `dashboard-invitations?${team}`), prepare: opened(SIDEBAR, INVITE, INVITE_DIALOG), }, { name: "profile-menu", - url: url("profile-menu", `/dashboard/recent?${team}`), + url: url("profile-menu", `dashboard-recent?${team}`), prepare: opened(SIDEBAR, PROFILE_BUTTON, PROFILE_MENU_ENTRY), }, { name: "team-switcher", - url: url("team-switcher", `/dashboard/recent?${team}`), + url: url("team-switcher", `dashboard-recent?${team}`), prepare: opened(SIDEBAR, TEAM_SWITCH, TEAM_MENU_ENTRY), }, { name: "navigation-hover", - url: url("navigation-hover", `/dashboard/recent?${team}`), + url: url("navigation-hover", `dashboard-recent?${team}`), prepare: async (page) => { await shown(SIDEBAR, VIEW_TIMEOUT)(page); await page.locator(NAV_TITLE).nth(1).hover(); await animationsSettled(page); }, }, - settings("settings-profile", "/settings/profile", REMOVE_ACCOUNT), - settings("settings-password", "/settings/password", SAVE_PASSWORD), - settings("settings-notifications", "/settings/notifications", SAVE_NOTIFICATIONS), - settings("settings-options", "/settings/options", SETTINGS_FORM), - settings("settings-feedback", "/settings/feedback", HEADER), + settings("settings-profile", "settings-profile", REMOVE_ACCOUNT), + settings("settings-password", "settings-password", SAVE_PASSWORD), + settings("settings-notifications", "settings-notifications", SAVE_NOTIFICATIONS), + settings("settings-options", "settings-options", SETTINGS_FORM), + settings("settings-feedback", "settings-feedback", HEADER), { name: "delete-account-dialog", - url: url("delete-account-dialog", "/settings/profile"), + url: url("delete-account-dialog", "settings-profile"), prepare: opened(SETTINGS_NAV, REMOVE_ACCOUNT, CONFIRM_REMOVE_ACCOUNT), }, - { name: "not-found", url: url("not-found", "/design-showcase-missing"), prepare: shown("#app svg", VIEW_TIMEOUT) }, + { name: "not-found", url: url("not-found", "design-showcase-missing"), prepare: shown("#app svg", VIEW_TIMEOUT) }, { name: "workspace", - url: url("workspace", `/workspace?${team}&file-id=${fileId}`), + url: url("workspace", `workspace?${team}&file-id=${fileId}`), prepare: shown(LAYERS, VIEW_TIMEOUT), }, ]; @@ -338,7 +342,7 @@ exports.register = function (shared) { test("design: corporate tokens apply in light and dark mode", async ({ page }) => { skipUnlessServiceEnabled("design"); - await gotoOnion(page, url("tokens", "/auth/login")); + await gotoOnion(page, url("tokens", "auth-login")); await shown(LOGIN_TITLE)(page); await assertDesignTokens(page, "Penpot"); }); @@ -349,7 +353,7 @@ exports.register = function (shared) { skipUnlessServiceEnabled("design"); for (const mode of MODES) { await page.emulateMedia({ colorScheme: mode }); - await gotoOnion(page, url(`sign-in-${mode}`, "/auth/login")); + await gotoOnion(page, url(`sign-in-${mode}`, "auth-login")); await shown(LOGIN_TITLE)(page); await expect( page.locator("html"), @@ -385,7 +389,7 @@ exports.register = function (shared) { await withSystemTheme(page, async () => { for (const mode of MODES) { await page.emulateMedia({ colorScheme: mode }); - await gotoOnion(page, url(`shell-${mode}`, `/dashboard/recent?team-id=${teamId}`)); + await gotoOnion(page, url(`shell-${mode}`, `dashboard-recent?team-id=${teamId}`)); await shown(NEW_PROJECT)(page); await expect(page.locator("body"), "the system theme follows the browser").toHaveClass(THEME_CLASS[mode]); await expect(page.locator("html")).toHaveAttribute("data-design-theme", mode); @@ -395,7 +399,7 @@ exports.register = function (shared) { await assertToken(page, NAV_CURRENT, "background-color", "--design-surface-active", `selected entry ${mode}`); await assertToken(page, `${NAV_CURRENT} [class*='element-title']`, "color", "--design-link", `selected entry ${mode}`); - await gotoOnion(page, url(`form-${mode}`, "/settings/profile")); + await gotoOnion(page, url(`form-${mode}`, "settings-profile")); await shown(REMOVE_ACCOUNT)(page); await assertToken(page, SETTINGS_CONTAINER, "border-top-color", "--design-border", `content divider ${mode}`); const fullname = page.locator(`${SETTINGS_CONTAINER} input[type='text']`).first(); @@ -408,7 +412,7 @@ exports.register = function (shared) { await assertToken(page, SAVE_PROFILE, "background-color", "--design-primary-hover", `hovered action ${mode}`); } await page.emulateMedia({ colorScheme: null }); - await gotoOnion(page, url("shell", `/dashboard/recent?team-id=${teamId}`)); + await gotoOnion(page, url("shell", `dashboard-recent?team-id=${teamId}`)); await shown(NEW_PROJECT)(page); await assertLightAndDark(page, SIDEBAR, "Penpot dashboard"); await assertReadable( @@ -427,7 +431,7 @@ exports.register = function (shared) { const surface = () => tokenValue(page, "--design-surface-1", "background-color"); try { await page.emulateMedia({ colorScheme: "dark" }); - await gotoOnion(page, url("theme", "/settings/options")); + await gotoOnion(page, url("theme", "settings-options")); await shown(SETTINGS_FORM)(page); await expect(html, "the system theme follows the browser").toHaveAttribute("data-design-theme", "dark"); const darkSurface = await surface(); @@ -449,7 +453,7 @@ exports.register = function (shared) { darkSurface, ); - await gotoOnion(page, url("theme-kept", "/settings/options")); + await gotoOnion(page, url("theme-kept", "settings-options")); await shown(SETTINGS_FORM)(page); await expect(html, "the picked theme must survive a reload").toHaveAttribute("data-design-theme", "dark"); @@ -465,7 +469,7 @@ exports.register = function (shared) { test("design: the interface shows the generated logo and the configured title", async ({ page }) => { skipUnlessServiceEnabled("design"); test.skip(!logoUrl && !title, "logo and title replacement are disabled for this role"); - await gotoOnion(page, url("brand", "/auth/login")); + await gotoOnion(page, url("brand", "auth-login")); await shown(LOGIN_TITLE)(page); const titled = (label) => expect diff --git a/roles/web-app-penpot/files/playwright/test-seaweedfs.js b/roles/web-app-penpot/files/playwright/test-seaweedfs.js index b0e9df0089..ed39569d5b 100644 --- a/roles/web-app-penpot/files/playwright/test-seaweedfs.js +++ b/roles/web-app-penpot/files/playwright/test-seaweedfs.js @@ -21,8 +21,8 @@ test("seaweedfs: an uploaded Penpot image asset is stored in the SeaweedFS bucke await expect(newFile, "Expected a create-file control in Drafts").toBeVisible({ timeout: resolveTimeout(60_000) }); await newFile.click({ timeout: resolveTimeout(30_000) }); await expect - .poll(() => appPage.url(), { timeout: resolveTimeout(90_000), message: "expected to enter the Penpot workspace editor" }) - .toContain("/workspace"); + .poll(() => shared.screenOf(appPage.url()), { timeout: resolveTimeout(90_000), message: "expected to enter the Penpot workspace editor" }) + .toBe("workspace"); const seed = Date.now(); const markerBase = `infinito-storage-check-${seed}`; diff --git a/roles/web-app-penpot/templates/design.js b/roles/web-app-penpot/templates/design.js index 7c9cd95487..40162e4083 100644 --- a/roles/web-app-penpot/templates/design.js +++ b/roles/web-app-penpot/templates/design.js @@ -1,7 +1,7 @@ (function () { const root = document.documentElement; function visitor() { - return window.location.hash.indexOf("#/auth/") === 0; + return /[?&]screen=auth-/.test(window.location.search) || window.location.hash.indexOf("#/auth/") === 0; } function mirror() { const body = document.body; diff --git a/roles/web-app-penpot/templates/playwright.env.j2 b/roles/web-app-penpot/templates/playwright.env.j2 index 619fcb3a1a..e4559fa577 100644 --- a/roles/web-app-penpot/templates/playwright.env.j2 +++ b/roles/web-app-penpot/templates/playwright.env.j2 @@ -20,7 +20,7 @@ MATOMO_SERVICE_ENABLED={{ lookup('config', application_id, 'services.matomo.enab NODE_TLS_REJECT_UNAUTHORIZED=0 OIDC_ISSUER_URL={{ OIDC.CLIENT.ISSUER_URL | dotenv_quote }} PENPOT_BASE_URL={{ lookup('tls', application_id, 'url.base') | dotenv_quote }} -# nocheck: persona-block-rationale — Penpot's login lives on the SPA hash route /#/auth/login (files/playwright/_shared.js:84), which the helper's ${base}/login probing never reaches, and its OIDC entry is a bare "OpenID" text node (files/playwright/_shared.js:94-100) rather than a link or button named log in / sign in / sso; under OIDC the native password form is disabled outright via PENPOT_FLAGS (vars/main.yml:44, README "Identity"). Admin auth is covered by files/playwright/test-login-oidc-admin.js, test-login-ldap-admin.js and test-login-native.js (see README "Testing"). +# nocheck: persona-block-rationale — Penpot's login lives on the query-routed SPA screen /?screen=auth-login (files/playwright/_shared.js:87), which the helper's ${base}/login probing never reaches, and its OIDC entry is a bare "OpenID" text node (files/playwright/_shared.js:121-128) rather than a link or button named log in / sign in / sso; under OIDC the native password form is disabled outright via PENPOT_FLAGS (vars/main.yml:44, README "Identity"). Admin auth is covered by files/playwright/test-login-oidc-admin.js, test-login-ldap-admin.js and test-login-native.js (see README "Testing"). PERSONA_ADMINISTRATOR_BLOCKED=true # nocheck: persona-block-rationale — see PERSONA_ADMINISTRATOR_BLOCKED above; biber's auth is covered by files/playwright/test-login-oidc-biber.js and test-login-ldap-biber.js (see README "Testing"). diff --git a/roles/web-app-stalwart/meta/services.yml b/roles/web-app-stalwart/meta/services.yml index ad504dda43..8e4e6af8a5 100644 --- a/roles/web-app-stalwart/meta/services.yml +++ b/roles/web-app-stalwart/meta/services.yml @@ -43,7 +43,7 @@ stalwart: # nocheck: default-placement-manager mail edge at a known IP: MX A-record, PTR and SPF bind to the stack host IP (a floating task's egress IP breaks deliverability); the mail store is NFS-hostile and IS the app — same rationale as web-app-mailu placement: manager image: stalwartlabs/stalwart - webui_version: "v2.0.5" + webui_version: "v2.0.6" version: "v1.1.0" update: - key: webui_version diff --git a/scripts/system/worktree/lib.sh b/scripts/system/worktree/lib.sh index 65ea51167f..2878a6bd14 100755 --- a/scripts/system/worktree/lib.sh +++ b/scripts/system/worktree/lib.sh @@ -57,15 +57,48 @@ worktree_slot_of() { printf '%s' "${slot}" } +WORKTREE_MAX_SLOT=254 +WORKTREE_NET_PREFIX=172.30 +WORKTREE_LAB_PREFIX=10.160 + +worktree_used_subnets() { + local -a ids=() + command -v docker >/dev/null 2>&1 || return 0 + mapfile -t ids < <(docker network ls -q 2>/dev/null) + [ "${#ids[@]}" -gt 0 ] || return 0 + docker network inspect "${ids[@]}" \ + --format '{{range .IPAM.Config}}{{.Subnet}}{{"\n"}}{{end}}' 2>/dev/null || return 0 +} + +# Param slot: the candidate slot. +# Param subnets: newline-separated subnets docker networks already hold. +# Returns: 0 when a network holds the slot's compose or swarm lab subnet. +worktree_slot_taken() { + local subnet + while read -r subnet; do + case "${subnet}" in + "${WORKTREE_NET_PREFIX}.$1."* | "${WORKTREE_LAB_PREFIX}.$1."*) return 0 ;; + esac + done <<<"$2" + return 1 +} + worktree_next_slot() { - local max=0 path slot + local used=" " path slot subnets while read -r path; do - slot="$(worktree_slot_of "${path}")" - if [ "${slot}" -gt "${max}" ]; then - max="${slot}" - fi + used+="$(worktree_slot_of "${path}") " done < <(git worktree list --porcelain | awk '/^worktree /{print $2}') - printf '%s' "$((max + 1))" + subnets="$(worktree_used_subnets)" + for ((slot = 1; slot <= WORKTREE_MAX_SLOT; slot++)); do + case "${used}" in + *" ${slot} "*) continue ;; + esac + if ! worktree_slot_taken "${slot}" "${subnets}"; then + printf '%s' "${slot}" + return 0 + fi + done + printf '%s' "$((WORKTREE_MAX_SLOT + 1))" } worktree_meta_dir() { diff --git a/scripts/system/worktree/up.sh b/scripts/system/worktree/up.sh index e11ac134d7..11d953d599 100755 --- a/scripts/system/worktree/up.sh +++ b/scripts/system/worktree/up.sh @@ -18,7 +18,6 @@ source "${SCRIPT_DIR}/lib.sh" branch="${1:?branch name required}" base="${2:-}" -max_slot=255 cd "${REPO_ROOT}" @@ -38,8 +37,8 @@ if [ -e "${path}" ]; then fi slot="$(worktree_next_slot)" -if [ "${slot}" -gt "${max_slot}" ]; then - echo "FAILURE: no free slot left (max ${max_slot}); tear down an existing worktree" >&2 +if [ "${slot}" -gt "${WORKTREE_MAX_SLOT}" ]; then + echo "FAILURE: no free slot left (max ${WORKTREE_MAX_SLOT}); tear down an existing worktree" >&2 exit 1 fi diff --git a/tests/lint/ansible/services/test_cve_suppressions.py b/tests/lint/ansible/services/test_cve_suppressions.py index 58a92e6513..878b8617fc 100644 --- a/tests/lint/ansible/services/test_cve_suppressions.py +++ b/tests/lint/ansible/services/test_cve_suppressions.py @@ -119,6 +119,47 @@ def problems(text: str, where: str, today: dt.date) -> list[str]: return found +def unshared_image_tags(services: dict[str, object]) -> list[str]: + """ + Args: + services: ``{role: meta/services.yml mapping}`` of every role. + + Returns: + One message per non-custom service that runs an upstream image tag + another non-custom service suppresses by ``image_tag`` while it does not. + """ + running: dict[tuple[str, str], list[str]] = {} + accepted: dict[tuple[str, str], list[str]] = {} + for role, declared in sorted(services.items()): + if not isinstance(declared, dict): + continue + for service, spec in declared.items(): + if not isinstance(spec, dict) or spec.get("custom"): + continue + if "image" not in spec or "version" not in spec: + continue + key = (str(spec["image"]), str(spec["version"])) + owner = f"{role}:{service}" + running.setdefault(key, []).append(owner) + security = spec.get("security") + entries = ( + security.get("suppressions") if isinstance(security, dict) else None + ) + if isinstance(entries, list) and any( + isinstance(entry, dict) and str(entry.get("image_tag")) == key[1] + for entry in entries + ): + accepted.setdefault(key, []).append(owner) + return [ + f"{owner} runs {image}:{tag} without the image_tag suppression declared " + f"for the same upstream image by {', '.join(accepted[(image, tag)])}" + for (image, tag), owners in sorted(running.items()) + if (image, tag) in accepted + for owner in owners + if owner not in accepted[(image, tag)] + ] + + class TestCveSuppressions(unittest.TestCase): def test_every_suppression_is_justified_and_dated(self) -> None: today = dt.datetime.now(tz=dt.UTC).date() @@ -131,6 +172,16 @@ class TestCveSuppressions(unittest.TestCase): found += problems(text, str(path.relative_to(PROJECT_ROOT)), today) self.assertEqual(found, [], "\n".join(found)) + def test_services_on_one_upstream_image_tag_share_its_suppression(self) -> None: + services = { + path.parent.parent.name: load_yaml_str(read_text(str(path))) + for path in sorted( + (PROJECT_ROOT / "roles").glob(f"*/{ROLE_FILE_META_SERVICES}") + ) + } + found = unshared_image_tags(services) + self.assertEqual(found, [], "\n".join(found)) + TODAY = dt.date(2026, 10, 31) VALID = """\ @@ -228,6 +279,40 @@ app: - image_tag: "2.18.6" until: 2026-11-30 """ +UNTAGGED = """\ +app: + image: app + version: "2.18.6" +""" + + +class TestSiblingImageTagCases(unittest.TestCase): + def _found(self, **roles: str) -> list[str]: + return unshared_image_tags( + {role: load_yaml_str(text) for role, text in roles.items()} + ) + + def test_siblings_that_both_suppress_the_tag_pass(self) -> None: + self.assertEqual(self._found(a=TAGGED, b=TAGGED), []) + + def test_a_sibling_without_the_tag_suppression_fails(self) -> None: + self.assertEqual( + self._found(a=TAGGED, b=UNTAGGED), + [ + ( + "b:app runs app:2.18.6 without the image_tag suppression declared " + "for the same upstream image by a:app" + ) + ], + ) + + def test_a_custom_build_on_the_same_tag_is_its_own_image(self) -> None: + custom = UNTAGGED.replace(" image: app\n", " image: app\n custom: true\n") + self.assertEqual(self._found(a=TAGGED, b=custom), []) + + def test_a_sibling_on_another_tag_is_not_compared(self) -> None: + other = UNTAGGED.replace("2.18.6", "2.18.7") + self.assertEqual(self._found(a=TAGGED, b=other), []) if __name__ == "__main__": diff --git a/tests/lint/filesystem/env/test_worktree_swarm_lab_subnet.py b/tests/lint/filesystem/env/test_worktree_swarm_lab_subnet.py index 7395b5f012..4b86c55908 100644 --- a/tests/lint/filesystem/env/test_worktree_swarm_lab_subnet.py +++ b/tests/lint/filesystem/env/test_worktree_swarm_lab_subnet.py @@ -20,8 +20,9 @@ from utils.env.parser import parse_static_env from . import PROJECT_ROOT _UP_SH = PROJECT_ROOT / "scripts/system/worktree/up.sh" +_LIB_SH = PROJECT_ROOT / "scripts/system/worktree/lib.sh" _NETWORKS = PROJECT_ROOT / "group_vars/all/08_networks.yml" -_MAX_SLOT_RE = re.compile(r"^max_slot=(?P\d+)$", re.MULTILINE) +_MAX_SLOT_RE = re.compile(r"^WORKTREE_MAX_SLOT=(?P\d+)$", re.MULTILINE) _LAB_PREFIX_RE = re.compile(r'^lab_prefix="(?P