test(caddy): fix automated testing

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso
2025-07-19 04:44:34 +00:00
parent 06122fcd89
commit a47e781d91
7 changed files with 10 additions and 15 deletions

View File

@@ -21,7 +21,8 @@
"golang.go", "golang.go",
"unifiedjs.vscode-mdx", "unifiedjs.vscode-mdx",
"a-h.templ", "a-h.templ",
"redhat.vscode-yaml" "redhat.vscode-yaml",
"matthewpi.caddyfile-support"
] ]
} }
} }

View File

@@ -5,6 +5,7 @@
"golang.go", "golang.go",
"unifiedjs.vscode-mdx", "unifiedjs.vscode-mdx",
"a-h.templ", "a-h.templ",
"redhat.vscode-yaml" "redhat.vscode-yaml",
"matthewpi.caddyfile-support"
] ]
} }

View File

@@ -1,12 +1,5 @@
:80 { caddy.local.cetacean.club {
reverse_proxy http://anubis:3000 { tls internal
header_up X-Real-Ip {remote_host}
header_up X-Http-Version {http.request.proto}
}
}
:443 {
tls /etc/techaro/pki/caddy.local.cetacean.club/cert.pem /etc/techaro/pki/caddy.local.cetacean.club/key.pem
reverse_proxy http://anubis:3000 { reverse_proxy http://anubis:3000 {
header_up X-Real-Ip {remote_host} header_up X-Real-Ip {remote_host}

View File

@@ -5,8 +5,6 @@ services:
ports: ports:
- 8080:80 - 8080:80
- 8443:443 - 8443:443
volumes:
- "../pki/caddy.local.cetacean.club:/etc/techaro/pki/caddy.local.cetacean.club/"
anubis: anubis:
image: ko.local/anubis image: ko.local/anubis

View File

@@ -1,6 +1,6 @@
async function testWithUserAgent(userAgent) { async function testWithUserAgent(userAgent) {
const statusCode = const statusCode =
await fetch("https://relayd.local.cetacean.club:8443/reqmeta", { await fetch("https://caddy.local.cetacean.club:8443/reqmeta", {
headers: { headers: {
"User-Agent": userAgent, "User-Agent": userAgent,
} }

View File

@@ -10,4 +10,6 @@ docker compose up -d --build
export NODE_TLS_REJECT_UNAUTHORIZED=0 export NODE_TLS_REJECT_UNAUTHORIZED=0
sleep 2
backoff-retry node test.mjs backoff-retry node test.mjs

View File

@@ -14,7 +14,7 @@ trap cleanup EXIT SIGINT
function build_anubis_ko() { function build_anubis_ko() {
( (
cd ../.. && cd ../.. &&
VERSION=devel ko build \ KO_DOCKER_REPO=ko.local/anubis VERSION=devel ko build \
--platform=all \ --platform=all \
--base-import-paths \ --base-import-paths \
--tags="latest" \ --tags="latest" \