mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
refactor(web-app-zammad): collapse helpdesk alias into single canonical zammad hostname
meta/server.yml: drop the helpdesk.<domain> canonical + zammad.helpdesk.<domain> alias pair; the role now publishes only zammad.helpdesk.<domain> as its canonical vhost. Also removes the alias-domain Playwright spec that asserted the alias-to-canonical rewrite — no alias remains to assert. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
345d33066a
commit
82491791e6
2 files changed
-33
No files matched your search
@@ -1,31 +0,0 @@
|
||||
const { test, expect, request } = require("@playwright/test");
|
||||
|
||||
exports.register = function (shared) {
|
||||
test("zammad alias domain maps to the canonical vhost (2xx direct OR 301-to-canonical)", async () => {
|
||||
const baseUrl = shared.env.zammadBaseUrl;
|
||||
expect(baseUrl, "ZAMMAD_BASE_URL must be set").toBeTruthy();
|
||||
|
||||
const canonicalHost = baseUrl.replace(/^https?:\/\//, "").replace(/\/$/, "");
|
||||
const aliasHost = canonicalHost.replace(/^helpdesk\./, "zammad.helpdesk.");
|
||||
|
||||
if (aliasHost === canonicalHost) {
|
||||
test.skip(true, "Alias hostname matches the canonical; nothing to assert.");
|
||||
}
|
||||
|
||||
const aliasUrl = baseUrl.replace(/\/\/[^/]+/, `//${aliasHost}`);
|
||||
const api = await request.newContext({ ignoreHTTPSErrors: true, maxRedirects: 0 });
|
||||
const aliasResp = await api.get(aliasUrl, { maxRedirects: 0 }).catch((err) => err);
|
||||
|
||||
const status = aliasResp.status?.();
|
||||
const isDirect2xx = typeof status === "number" && status >= 200 && status < 300;
|
||||
const isRedirectToCanonical = typeof status === "number" && status >= 300 && status < 400
|
||||
&& (aliasResp.headers?.()["location"] || "").includes(canonicalHost);
|
||||
|
||||
expect(
|
||||
isDirect2xx || isRedirectToCanonical,
|
||||
`Alias ${aliasUrl} must either serve 2xx directly (true vhost alias) or 30x-redirect to ${canonicalHost}. Got status=${status ?? aliasResp.message} location=${aliasResp.headers?.()["location"] ?? "<none>"}`
|
||||
).toBe(true);
|
||||
|
||||
await api.dispose();
|
||||
});
|
||||
};
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
domains:
|
||||
canonical:
|
||||
- helpdesk.{{ DOMAIN_PRIMARY }}
|
||||
aliases:
|
||||
- zammad.helpdesk.{{ DOMAIN_PRIMARY }}
|
||||
csp:
|
||||
flags:
|
||||
|
||||
Reference in new issue
Block a user