diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b11a7622..983ae6e6 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -21,7 +21,8 @@ "golang.go", "unifiedjs.vscode-mdx", "a-h.templ", - "redhat.vscode-yaml" + "redhat.vscode-yaml", + "matthewpi.caddyfile-support" ] } } diff --git a/.vscode/extensions.json b/.vscode/extensions.json index c85abc80..4d213bb7 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -5,6 +5,7 @@ "golang.go", "unifiedjs.vscode-mdx", "a-h.templ", - "redhat.vscode-yaml" + "redhat.vscode-yaml", + "matthewpi.caddyfile-support" ] } \ No newline at end of file diff --git a/test/caddy/Caddyfile b/test/caddy/Caddyfile index a80a93a6..c99999eb 100644 --- a/test/caddy/Caddyfile +++ b/test/caddy/Caddyfile @@ -1,12 +1,5 @@ -:80 { - reverse_proxy http://anubis:3000 { - 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 +caddy.local.cetacean.club { + tls internal reverse_proxy http://anubis:3000 { header_up X-Real-Ip {remote_host} diff --git a/test/caddy/docker-compose.yaml b/test/caddy/docker-compose.yaml index a7456ff2..65fbe4cb 100644 --- a/test/caddy/docker-compose.yaml +++ b/test/caddy/docker-compose.yaml @@ -5,8 +5,6 @@ services: ports: - 8080:80 - 8443:443 - volumes: - - "../pki/caddy.local.cetacean.club:/etc/techaro/pki/caddy.local.cetacean.club/" anubis: image: ko.local/anubis diff --git a/test/caddy/test.mjs b/test/caddy/test.mjs index 1e53a23c..c1ec5370 100644 --- a/test/caddy/test.mjs +++ b/test/caddy/test.mjs @@ -1,6 +1,6 @@ async function testWithUserAgent(userAgent) { const statusCode = - await fetch("https://relayd.local.cetacean.club:8443/reqmeta", { + await fetch("https://caddy.local.cetacean.club:8443/reqmeta", { headers: { "User-Agent": userAgent, } diff --git a/test/caddy/test.sh b/test/caddy/test.sh index 489418c9..c6d86026 100755 --- a/test/caddy/test.sh +++ b/test/caddy/test.sh @@ -10,4 +10,6 @@ docker compose up -d --build export NODE_TLS_REJECT_UNAUTHORIZED=0 +sleep 2 + backoff-retry node test.mjs diff --git a/test/lib/lib.sh b/test/lib/lib.sh index 37dcc898..4838d9dc 100644 --- a/test/lib/lib.sh +++ b/test/lib/lib.sh @@ -14,7 +14,7 @@ trap cleanup EXIT SIGINT function build_anubis_ko() { ( cd ../.. && - VERSION=devel ko build \ + KO_DOCKER_REPO=ko.local/anubis VERSION=devel ko build \ --platform=all \ --base-import-paths \ --tags="latest" \