| -rw-r--r-- | .github/workflows/build-and-deploy-prod.yml | 6 | ||||
| -rw-r--r-- | .github/workflows/build-and-deploy-stage.yml | 6 | ||||
| -rw-r--r-- | Caddyfile | 50 | ||||
| -rw-r--r-- | caddy.Dockerfile | 10 | ||||
| -rw-r--r-- | deploy/inventory.yml | 20 | ||||
| -rw-r--r-- | deploy/playbook.yml | 2 |
6 files changed, 17 insertions, 77 deletions
diff --git a/.github/workflows/build-and-deploy-prod.yml b/.github/workflows/build-and-deploy-prod.yml index d89cc76..76012c6 100644 --- a/.github/workflows/build-and-deploy-prod.yml +++ b/.github/workflows/build-and-deploy-prod.yml @@ -54,7 +54,7 @@ jobs: - name: Checkout uses: actions/checkout@v6 - - name: Set up SSH connection for uz.saya.casa + - name: Set up SSH connection for pl.saya.today run: | mkdir -p ~/.ssh (cat <<EOF @@ -63,11 +63,11 @@ jobs: ) > ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519 sed -i 's/\r$//' ~/.ssh/id_ed25519 - ssh-keyscan -H uz.saya.casa >> ~/.ssh/known_hosts + ssh-keyscan -H pl.saya.today >> ~/.ssh/known_hosts - name: Test SSH connection run: | - ssh -o ConnectTimeout=10 -i ~/.ssh/id_ed25519 svc_github@uz.saya.casa "echo 'SSH connection successful'" + ssh -o ConnectTimeout=10 -i ~/.ssh/id_ed25519 svc_github@pl.saya.today "echo 'SSH connection successful'" - name: Install Ansible shell: bash diff --git a/.github/workflows/build-and-deploy-stage.yml b/.github/workflows/build-and-deploy-stage.yml index e699856..89000d0 100644 --- a/.github/workflows/build-and-deploy-stage.yml +++ b/.github/workflows/build-and-deploy-stage.yml @@ -56,7 +56,7 @@ jobs: - name: Checkout uses: actions/checkout@v6 - - name: Set up SSH connection for uz.saya.casa + - name: Set up SSH connection for pl.saya.today run: | mkdir -p ~/.ssh (cat <<EOF @@ -65,11 +65,11 @@ jobs: ) > ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519 sed -i 's/\r$//' ~/.ssh/id_ed25519 - ssh-keyscan -H uz.saya.casa >> ~/.ssh/known_hosts + ssh-keyscan -H pl.saya.today >> ~/.ssh/known_hosts - name: Test SSH connection run: | - ssh -o ConnectTimeout=10 -i ~/.ssh/id_ed25519 svc_github@uz.saya.casa "echo 'SSH connection successful'" + ssh -o ConnectTimeout=10 -i ~/.ssh/id_ed25519 svc_github@pl.saya.today "echo 'SSH connection successful'" - name: Install Ansible shell: bash diff --git a/Caddyfile b/Caddyfile deleted file mode 100644 index 5781d74..0000000 --- a/Caddyfile +++ /dev/null @@ -1,50 +0,0 @@ -{ - email saya.andy@posteo.com - - order rate_limit before reverse_proxy - - servers { - timeouts { - read_body 10s - read_header 5s - write 30s - idle 2m - } - } -} - -(saya-web) { - header { - Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" - X-Xss-Protection "1; mode=block" - X-Content-Type-Options "nosniff" - X-Frame-Options "DENY" - Content-Security-Policy "upgrade-insecure-requests" - Referrer-Policy "strict-origin-when-cross-origin" - Cache-Control "public, max-age=15, must-revalidate" - Feature-Policy "accelerometer 'none'; ambient-light-sensor 'none'; autoplay 'self'; camera 'none'; encrypted-media 'none'; fullscreen 'self'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; midi 'none'; payment 'none'; picture-in-picture *; speaker 'none'; sync-xhr 'none'; usb 'none'; vr 'none'" - Server "No." - } - - request_body { - max_size 1MB - } - - rate_limit { - zone per_ip { - key {remote_host} - events 600 - window 1m - } - } -} - -stage.saya.uz { - import saya-web - reverse_proxy sayauz-stage:3000 -} - -saya.uz { - import saya-web - reverse_proxy sayauz-prod:3000 -} diff --git a/caddy.Dockerfile b/caddy.Dockerfile deleted file mode 100644 index 9f90d8b..0000000 --- a/caddy.Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM docker.io/library/caddy:2.11.2-builder-alpine AS builder - -RUN --mount=type=cache,target=/go/pkg/mod \ - --mount=type=cache,target=/root/.cache/go-build \ - xcaddy build v2.11.2 \ - --with github.com/mholt/caddy-ratelimit - -FROM docker.io/library/caddy:2.11.2-alpine - -COPY --from=builder /usr/bin/caddy /usr/bin/caddy diff --git a/deploy/inventory.yml b/deploy/inventory.yml index d3acab8..a1ecf5d 100644 --- a/deploy/inventory.yml +++ b/deploy/inventory.yml @@ -3,17 +3,17 @@ all: prod: hosts: node_prod: - ansible_host: uz.saya.casa - saya_today_web_name: sayauz-prod - saya_today_web_hostname: sayauz-prod - saya_today_web_ipv4_address: 172.16.0.17 - saya_today_web_listen_address: saya.uz + ansible_host: pl.saya.today + saya_today_web_name: sayana-web + saya_today_web_hostname: sayana-web + saya_today_web_ipv4_address: 172.16.0.18 + saya_today_web_listen_address: saya.today stage: hosts: node_stage: - ansible_host: uz.saya.casa - saya_today_web_name: sayauz-stage - saya_today_web_hostname: sayauz-stage - saya_today_web_ipv4_address: 172.16.0.18 - saya_today_web_listen_address: stage.saya.uz + ansible_host: pl.saya.today + saya_today_web_name: sayana-demo + saya_today_web_hostname: sayana-demo + saya_today_web_ipv4_address: 172.16.0.17 + saya_today_web_listen_address: demo.saya.today diff --git a/deploy/playbook.yml b/deploy/playbook.yml index 8fb9088..b0202bd 100644 --- a/deploy/playbook.yml +++ b/deploy/playbook.yml @@ -2,7 +2,7 @@ - name: Deploy saya-today-web Docker Container hosts: all remote_user: svc_github - + tasks: - name: Create a volume community.docker.docker_volume: |