Files
computer-playbook/roles/web-app-seaweedfs/files/playwright/test-administrator-persona.js
kevinveenbirkenbachandClaude Opus 4.8 0039602379 feat(seaweedfs): extract browser frontend into a gated service
SeaweedFS is a server-side S3 backend for its consumers; only the
filer/master admin UIs are browser-facing. Split them into a `frontend`
service that stays off on onion nodes ('svc-net-tor' in group_names):

- frontend disabled: no nginx proxy container, no filer/master vhosts,
  no oauth2 SSO sidecar; the S3 API vhost is unaffected
- stale filer/master vhosts from earlier frontend-enabled deploys are
  removed so the site-wide CSP health probe stops hitting dead domains
- csp_skip_domains additionally skips canonicals a disabled service
  declares via services.<name>.domains (defense in depth)
- UI personas (admin/biber/guest/storage-buckets) gate on the
  FRONTEND_SERVICE_ENABLED flag; tor variants dropped (backend role)

Verified on the onion node: 4/4 UI specs skip, S3 API reachable, CSP
health check green, matrix S3 media consumer unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 10:56:13 +02:00

30 lines
1.5 KiB
JavaScript

const { test } = require("@playwright/test");
const { gotoOnion } = require("./personas");
exports.register = function (shared) {
const { env, keycloakLogin, isAuthChain, expect } = shared;
test("administrator: can log in and reach both Filer and Master UIs", async ({ page }) => {
test.skip(!env.frontendEnabled, "frontend disabled (headless backend node)");
test.skip(!env.ssoEnabled, "SSO disabled");
await gotoOnion(page, env.filerUrl, { waitUntil: "domcontentloaded" });
if (isAuthChain(page.url())) {
await keycloakLogin(page, env.adminUsername, env.adminPassword);
}
await page.waitForLoadState("networkidle").catch(() => {});
expect(isAuthChain(page.url()), "admin must land back on the Filer UI").toBe(false);
expect(page.url()).toContain(new URL(env.filerUrl).host);
const filerBody = (await page.locator("body").innerText().catch(() => "")) || "";
expect(filerBody.length, "Filer UI must render content").toBeGreaterThan(0);
await gotoOnion(page, env.masterUrl, { waitUntil: "domcontentloaded" });
await page.waitForLoadState("networkidle").catch(() => {});
expect(isAuthChain(page.url()), "admin must reach the Master UI without re-auth").toBe(false);
expect(page.url()).toContain(new URL(env.masterUrl).host);
const masterBody = (await page.locator("body").innerText().catch(() => "")) || "";
expect(masterBody, "Master UI must show SeaweedFS cluster status").toMatch(/volume|topology|cluster|seaweed/i);
});
};