mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
Gitea ships no MCP server, so the role runs the project-owned gitea-mcp package as a sidecar next to it and points it at the instance over the container network. Two things the image forces. Its command carries the binary path explicitly because the image declares no ENTRYPOINT, so a bare flag list would replace the binary instead of extending it. The port is stringified because Ansible's native types make a bare lookup an int, and compose rejects a non-string in a command array. Keep the surface internal. The public vhost answers a bearerless probe with an SSO redirect, so the guest spec pins maxRedirects to 0 and asserts no MCP response is ever served; following the redirect would land on a login page and pass for the wrong reason. Calls run with administrator rights, so the tool policy is pinned read-only and the sidecar starts with the read-only flag and a scope list. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
// Shared Gitea Playwright spec state: env vars, persona helpers and the
|
|
// `beforeEach` env-presence guard. `playwright.spec.js` wires the lifecycle
|
|
// hook and `require()`s one test module per scenario so each test stays
|
|
// atomar and individually inspectable.
|
|
|
|
const { expect } = require("@playwright/test");
|
|
|
|
const { decodeDotenvQuotedValue, runAdminFlow, runBiberFlow, runGuestFlow } = require("./personas");
|
|
|
|
// `docker --env-file` preserves the quotes emitted by `dotenv_quote`,
|
|
// so normalize these values before building URLs or typing credentials.
|
|
const gitEaBaseUrl = decodeDotenvQuotedValue(process.env.GITEA_BASE_URL);
|
|
|
|
function healthzReadyUrl() {
|
|
return `${gitEaBaseUrl.replace(/\/$/, "")}/healthz/ready`;
|
|
}
|
|
|
|
function mcpEndpointUrl() {
|
|
return `${gitEaBaseUrl.replace(/\/$/, "")}/mcp`;
|
|
}
|
|
|
|
function beforeEach() {
|
|
expect(gitEaBaseUrl, "GITEA_BASE_URL must be set in the Playwright env file").toBeTruthy();
|
|
}
|
|
|
|
module.exports = {
|
|
env: { gitEaBaseUrl },
|
|
healthzReadyUrl,
|
|
mcpEndpointUrl,
|
|
runAdminFlow,
|
|
runBiberFlow,
|
|
runGuestFlow,
|
|
beforeEach,
|
|
};
|