From bb1aa7275429fe74933e109b0dc99a193a59b26c Mon Sep 17 00:00:00 2001 From: Stavros Date: Thu, 16 Jul 2026 19:38:19 +0300 Subject: [PATCH] refactor: replace traefik with caddy --- .github/workflows/e2e.yml | 37 ++++++++++++++----------------------- e2e/conf/Caddyfile | 15 +++++++++++++++ e2e/docker-compose.e2e.yml | 21 ++++----------------- 3 files changed, 33 insertions(+), 40 deletions(-) create mode 100644 e2e/conf/Caddyfile diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 8ec6b495..55f4d852 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -23,30 +23,21 @@ jobs: - name: Set up Docker uses: docker/setup-docker-action@6d7cfa65f60a9dda7b46e5513fa982536f3c9877 # ratchet:docker/setup-docker-action@v5 - - name: Spin up docker-compose - run: docker compose -f docker-compose.e2e.yml up --build --force-recreate --remove-orphans -d + - name: Install dependencies + run: pnpm ci working-directory: e2e - - name: Check if the url is accessible - run: sleep 10s && docker ps && curl -v http://tinyauth.127.0.0.1.sslip.io + - name: Install Playwright Browsers + run: pnpm exec playwright install --with-deps + working-directory: e2e -# - name: Install dependencies -# run: pnpm ci -# working-directory: e2e -# -# - name: Install Playwright Browsers -# run: pnpm exec playwright install --with-deps -# working-directory: e2e + - name: Run Playwright tests + run: pnpm test + working-directory: e2e -# - name: Run Playwright tests -# run: pnpm test -# working-directory: e2e -# env: -# DOCKER_SOCKET_PATH: ${{ steps.docker-socket.outputs.DOCKER_SOCK }} -# -# - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # ratchet:actions/upload-artifact@v4 -# if: ${{ !cancelled() }} -# with: -# name: playwright-report -# path: e2e/playwright-report/ -# retention-days: 5 + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # ratchet:actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: playwright-report + path: e2e/playwright-report/ + retention-days: 5 diff --git a/e2e/conf/Caddyfile b/e2e/conf/Caddyfile new file mode 100644 index 00000000..2c2ddca0 --- /dev/null +++ b/e2e/conf/Caddyfile @@ -0,0 +1,15 @@ +{ + auto_https off +} + +http://whoami.127.0.0.1.sslip.io { + forward_auth tinyauth:3000 { + uri /api/auth/caddy + copy_headers Remote-User Remote-Name Remote-Email Remote-Groups + } + reverse_proxy whoami:80 +} + +http://tinyauth.127.0.0.1.sslip.io { + reverse_proxy tinyauth:3000 +} \ No newline at end of file diff --git a/e2e/docker-compose.e2e.yml b/e2e/docker-compose.e2e.yml index 8e515d1d..358e1741 100644 --- a/e2e/docker-compose.e2e.yml +++ b/e2e/docker-compose.e2e.yml @@ -1,24 +1,15 @@ services: - traefik: - image: traefik:v3.7.8 + caddy: + image: caddy:2.11.4 pull_policy: missing - command: | - --api.insecure=true - --providers.docker - --entrypoints.web.address=:80 - --log.level=INFO ports: - 80:80 volumes: - - /var/run/docker.sock:/var/run/docker.sock + - ./conf:/etc/caddy whoami: image: traefik/whoami:v1.11.0 pull_policy: missing - labels: - traefik.enable: true - traefik.http.routers.whoami.rule: Host(`whoami.127.0.0.1.sslip.io`) - traefik.http.routers.whoami.middlewares: tinyauth tinyauth: build: @@ -30,8 +21,4 @@ services: - LDFLAGS=-s -w command: ["--configfile", "/app/config.yaml"] volumes: - - ./config.e2e.yaml:/app/config.yaml:ro - labels: - traefik.enable: true - traefik.http.routers.tinyauth.rule: Host(`tinyauth.127.0.0.1.sslip.io`) - traefik.http.middlewares.tinyauth.forwardauth.address: http://tinyauth:3000/api/auth/traefik \ No newline at end of file + - ./config.e2e.yaml:/app/config.yaml:ro \ No newline at end of file