refactor: Consolidate staging routing with TCP passthrough, relocate E2E tests to production workflow, and remove legacy Nginx configurations.
All checks were successful
Remote Deployment Pipeline / Prepare Context (pull_request) Successful in 3s
Remote Deployment Pipeline / Deploy (Staging) (pull_request) Has been skipped
Remote Deployment Pipeline / Deploy (Dev/Preview) (pull_request) Successful in 56s
Remote Deployment Pipeline / Cleanup Preview (pull_request) Has been skipped
Remote Deployment Pipeline / Deploy (Production) (pull_request) Has been skipped
All checks were successful
Remote Deployment Pipeline / Prepare Context (pull_request) Successful in 3s
Remote Deployment Pipeline / Deploy (Staging) (pull_request) Has been skipped
Remote Deployment Pipeline / Deploy (Dev/Preview) (pull_request) Successful in 56s
Remote Deployment Pipeline / Cleanup Preview (pull_request) Has been skipped
Remote Deployment Pipeline / Deploy (Production) (pull_request) Has been skipped
This commit is contained in:
@@ -67,15 +67,6 @@ jobs:
|
|||||||
cd ${{ needs.prepare_context.outputs.pr_path }}
|
cd ${{ needs.prepare_context.outputs.pr_path }}
|
||||||
docker compose --env-file dev.env -f docker-compose.yaml up -d --build --remove-orphans --wait
|
docker compose --env-file dev.env -f docker-compose.yaml up -d --build --remove-orphans --wait
|
||||||
|
|
||||||
# Run E2E Tests
|
|
||||||
echo "Running E2E tests..."
|
|
||||||
export CI=true
|
|
||||||
# Create venv to avoid polluting system python
|
|
||||||
python3 -m venv .venv
|
|
||||||
. .venv/bin/activate
|
|
||||||
pip install -r tests/e2e/requirements.txt
|
|
||||||
pytest tests/e2e/
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
# STAGE 3: DEPLOY STAGING
|
# STAGE 3: DEPLOY STAGING
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
@@ -100,7 +91,7 @@ jobs:
|
|||||||
SCRIPT_AFTER: |
|
SCRIPT_AFTER: |
|
||||||
set -e
|
set -e
|
||||||
cd ${{ env.REMOTE_STAGING_PATH }}
|
cd ${{ env.REMOTE_STAGING_PATH }}
|
||||||
docker compose --env-file staging.env -f docker-compose.yaml up -d --build --remove-orphans
|
docker compose --env-file staging.env -f docker-compose.yaml up -d --build --remove-orphans --wait
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
# STAGE 4: DEPLOY PRODUCTION
|
# STAGE 4: DEPLOY PRODUCTION
|
||||||
@@ -127,7 +118,16 @@ jobs:
|
|||||||
SCRIPT_AFTER: |
|
SCRIPT_AFTER: |
|
||||||
set -e
|
set -e
|
||||||
cd ${{ env.REMOTE_PROD_PATH }}
|
cd ${{ env.REMOTE_PROD_PATH }}
|
||||||
docker compose --env-file prod.env -f docker-compose.yaml -f docker-compose.prod.yaml up -d --build --remove-orphans
|
docker compose --env-file prod.env -f docker-compose.yaml -f docker-compose.prod.yaml up -d --build --remove-orphans --wait
|
||||||
|
|
||||||
|
# Run E2E Tests
|
||||||
|
echo "Running E2E tests..."
|
||||||
|
export CI=true
|
||||||
|
# Create venv to avoid polluting system python
|
||||||
|
python3 -m venv .venv
|
||||||
|
. .venv/bin/activate
|
||||||
|
pip install -r tests/e2e/requirements.txt
|
||||||
|
pytest tests/e2e/
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
# CLEANUP (Using appleboy/ssh-action for pure command execution)
|
# CLEANUP (Using appleboy/ssh-action for pure command execution)
|
||||||
|
|||||||
4
dev.env
4
dev.env
@@ -5,5 +5,5 @@ NETWORK_NAME=proxy
|
|||||||
CERTBOT_CA_RESOLVER=https://acme-staging-v02.api.letsencrypt.org/directory
|
CERTBOT_CA_RESOLVER=https://acme-staging-v02.api.letsencrypt.org/directory
|
||||||
DOMAIN=dev.kovagoadi.hu
|
DOMAIN=dev.kovagoadi.hu
|
||||||
ACME_BYPASS=false
|
ACME_BYPASS=false
|
||||||
# TRAEFIK_LEGACY_OPT=
|
TRAEFIK_LEGACY_OPT=
|
||||||
TRAEFIK_LEGACY_OPT="--providers.file.directory=/etc/traefik"
|
# TRAEFIK_LEGACY_OPT="--providers.file.directory=/etc/traefik"
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
# ./traefik/forward-to-legacy-nginx.yaml
|
|
||||||
|
|
||||||
tcp:
|
|
||||||
routers:
|
|
||||||
# Router for HTTPS (Passthrough)
|
|
||||||
nginx-legacy-router-secure:
|
|
||||||
rule: "HostSNI(`*`)"
|
|
||||||
service: nginx-legacy-service-secure
|
|
||||||
# Passthrough must be true for SSL to reach Nginx encrypted
|
|
||||||
tls:
|
|
||||||
passthrough: true
|
|
||||||
priority: 10
|
|
||||||
entryPoints:
|
|
||||||
- "https"
|
|
||||||
|
|
||||||
services:
|
|
||||||
# Service defining the external IP
|
|
||||||
nginx-legacy-service-secure:
|
|
||||||
loadBalancer:
|
|
||||||
servers:
|
|
||||||
# This is the actual external IP and Port of your Nginx
|
|
||||||
- address: "webserver:443"
|
|
||||||
|
|
||||||
http:
|
|
||||||
routers:
|
|
||||||
# 1. TRAEFIK-MANAGED ACME HANDLER (Removed manual router)
|
|
||||||
traefik-acme-handler:
|
|
||||||
rule: "Host(`test-whoami.kovagoadi.hu`) && PathPrefix(`/.well-known/acme-challenge/`)"
|
|
||||||
entryPoints:
|
|
||||||
- "web"
|
|
||||||
service: "acme-http@internal" # This is the internal service name
|
|
||||||
priority: 1000 # High priority to ensure it wins
|
|
||||||
|
|
||||||
# 2. THE HTTP CATCH-ALL (Sends other ACME and HTTP to Nginx)
|
|
||||||
nginx-legacy-router:
|
|
||||||
rule: "HostRegexp(`^.+$`)"
|
|
||||||
service: nginx-legacy-service
|
|
||||||
# Low priority ensures specific containers are handled first, but before the default acme-handler
|
|
||||||
priority: 90
|
|
||||||
entryPoints:
|
|
||||||
- "web"
|
|
||||||
|
|
||||||
services:
|
|
||||||
nginx-legacy-service:
|
|
||||||
loadBalancer:
|
|
||||||
servers:
|
|
||||||
- url: "http://webserver:80"
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
http:
|
|
||||||
routers:
|
|
||||||
# Router for HTTP (Port 80)
|
|
||||||
staging:
|
|
||||||
rule: "HostRegexp(`^.+\\.staging\\.kovagoadi\\.hu$`) || HostRegexp(`^.+\\.dev\\.kovagoadi\\.hu$`)"
|
|
||||||
entryPoints:
|
|
||||||
- "web"
|
|
||||||
service: "dev-staging"
|
|
||||||
priority: 1000
|
|
||||||
services:
|
|
||||||
dev-staging:
|
|
||||||
loadBalancer:
|
|
||||||
servers:
|
|
||||||
- url: "http://staging:8080"
|
|
||||||
|
|
||||||
tcp:
|
|
||||||
routers:
|
|
||||||
# Router for HTTPS (Passthrough)
|
|
||||||
dev-staging-secure:
|
|
||||||
rule: "HostSNIRegexp(`^.+\\.staging\\.kovagoadi\\.hu$`) || HostSNIRegexp(`^.+\\.dev\\.kovagoadi\\.hu$`)"
|
|
||||||
service: "dev-staging-secure"
|
|
||||||
# Passthrough must be true for SSL to reach Nginx encrypted
|
|
||||||
tls:
|
|
||||||
passthrough: true
|
|
||||||
priority: 1000
|
|
||||||
entryPoints:
|
|
||||||
- "https"
|
|
||||||
services:
|
|
||||||
dev-staging-secure:
|
|
||||||
loadBalancer:
|
|
||||||
servers:
|
|
||||||
# Note: Ensure Traefik trusts the cert at .85 or set insecureSkipVerify
|
|
||||||
- address: "staging:445"
|
|
||||||
@@ -6,7 +6,6 @@ services:
|
|||||||
- no-new-privileges:true
|
- no-new-privileges:true
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
- legacy-nginx
|
|
||||||
command:
|
command:
|
||||||
- "--log.level=DEBUG"
|
- "--log.level=DEBUG"
|
||||||
- "--providers.docker=true"
|
- "--providers.docker=true"
|
||||||
@@ -53,8 +52,5 @@ services:
|
|||||||
- traefik.http.routers.https.tls.certresolver=letsencrypt
|
- traefik.http.routers.https.tls.certresolver=letsencrypt
|
||||||
networks:
|
networks:
|
||||||
proxy:
|
proxy:
|
||||||
legacy-nginx:
|
|
||||||
name: proxy
|
|
||||||
external: true
|
|
||||||
volumes:
|
volumes:
|
||||||
letsencrypt:
|
letsencrypt:
|
||||||
@@ -2,29 +2,32 @@ http:
|
|||||||
routers:
|
routers:
|
||||||
# Router for HTTP (Port 80)
|
# Router for HTTP (Port 80)
|
||||||
staging:
|
staging:
|
||||||
rule: "HostRegexp({subdomain:.+}.staging.kovagoadi.hu`) || Host(`staging.kovagoadi.hu`) || Host(`dev.kovagoadi.hu`)"
|
rule: "HostRegexp(`^.+\\.staging\\.kovagoadi\\.hu$`) || HostRegexp(`^.+\\.dev\\.kovagoadi\\.hu$`)"
|
||||||
entryPoints:
|
entryPoints:
|
||||||
- "web"
|
- "web"
|
||||||
service: "dev-staging"
|
service: "dev-staging"
|
||||||
priority: 1_000_000
|
priority: 1000
|
||||||
|
|
||||||
# Router for HTTPS (Port 443)
|
|
||||||
staging-secure:
|
|
||||||
rule: "Host(`staging.kovagoadi.hu`) || Host(`dev.kovagoadi.hu`)"
|
|
||||||
entryPoints:
|
|
||||||
- "https"
|
|
||||||
service: "dev-staging-secure"
|
|
||||||
priority: 100
|
|
||||||
tls: {} # <--- This enables TLS for this router
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
dev-staging:
|
dev-staging:
|
||||||
loadBalancer:
|
loadBalancer:
|
||||||
servers:
|
servers:
|
||||||
- url: "http://192.168.1.85:8080"
|
- url: "http://staging:8080"
|
||||||
|
|
||||||
|
tcp:
|
||||||
|
routers:
|
||||||
|
# Router for HTTPS (Passthrough)
|
||||||
|
dev-staging-secure:
|
||||||
|
rule: "HostSNIRegexp(`^.+\\.staging\\.kovagoadi\\.hu$`) || HostSNIRegexp(`^.+\\.dev\\.kovagoadi\\.hu$`)"
|
||||||
|
service: "dev-staging-secure"
|
||||||
|
# Passthrough must be true for SSL to reach Nginx encrypted
|
||||||
|
tls:
|
||||||
|
passthrough: true
|
||||||
|
priority: 1000
|
||||||
|
entryPoints:
|
||||||
|
- "https"
|
||||||
|
services:
|
||||||
dev-staging-secure:
|
dev-staging-secure:
|
||||||
loadBalancer:
|
loadBalancer:
|
||||||
servers:
|
servers:
|
||||||
# Note: Ensure Traefik trusts the cert at .85 or set insecureSkipVerify
|
# Note: Ensure Traefik trusts the cert at .85 or set insecureSkipVerify
|
||||||
- url: "https://192.168.1.85:445"
|
- address: "staging:445"
|
||||||
Reference in New Issue
Block a user