From 07020590443fcad43148476d17b56a15e538be10 Mon Sep 17 00:00:00 2001 From: Timothy Kim Date: Mon, 16 Mar 2026 22:00:16 -0400 Subject: [PATCH] add thekims.family --- .gitea/workflows/deploy-thekims.family.yml | 18 ++++++++ docker/nginx/conf.d/thekims.family.conf | 48 ++++++++++++++++++++++ docker/thekims.family/compose.yml | 11 +++++ 3 files changed, 77 insertions(+) create mode 100644 .gitea/workflows/deploy-thekims.family.yml create mode 100644 docker/nginx/conf.d/thekims.family.conf create mode 100644 docker/thekims.family/compose.yml diff --git a/.gitea/workflows/deploy-thekims.family.yml b/.gitea/workflows/deploy-thekims.family.yml new file mode 100644 index 0000000..4e057db --- /dev/null +++ b/.gitea/workflows/deploy-thekims.family.yml @@ -0,0 +1,18 @@ +name: Deploy thekims.family + +on: + push: + branches: [main] + paths: + - 'docker/thekims.family/**' + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Deploy via SSH + run: | + mkdir -p ~/.ssh + echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/deploy_key + chmod 600 ~/.ssh/deploy_key + ssh -o StrictHostKeyChecking=accept-new -i ~/.ssh/deploy_key deploy@${{ vars.DEPLOY_HOST }} deploy-thekims.family diff --git a/docker/nginx/conf.d/thekims.family.conf b/docker/nginx/conf.d/thekims.family.conf new file mode 100644 index 0000000..ca539d0 --- /dev/null +++ b/docker/nginx/conf.d/thekims.family.conf @@ -0,0 +1,48 @@ +# Redirect HTTP to HTTPS, bare domain to www +server { + listen 80; + listen [::]:80; + server_name thekims.family www.thekims.family; + + location /.well-known/acme-challenge/ { + root /var/www/certbot; + } + + location / { + return 301 https://www.thekims.family$request_uri; + } +} + +# Redirect bare HTTPS domain to www +server { + listen 443 ssl; + listen [::]:443 ssl; + http2 on; + server_name thekims.family; + + ssl_certificate /etc/letsencrypt/live/thekims.family/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/thekims.family/privkey.pem; + + return 301 https://www.thekims.family$request_uri; +} + +# Main site +server { + listen 443 ssl; + listen [::]:443 ssl; + http2 on; + server_name www.thekims.family; + + ssl_certificate /etc/letsencrypt/live/thekims.family/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/thekims.family/privkey.pem; + + add_header Strict-Transport-Security "max-age=63072000; preload" always; + + location / { + proxy_pass http://thekims_family:80; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } +} diff --git a/docker/thekims.family/compose.yml b/docker/thekims.family/compose.yml new file mode 100644 index 0000000..97ac87a --- /dev/null +++ b/docker/thekims.family/compose.yml @@ -0,0 +1,11 @@ +services: + app: + image: git.timothykim.net/hantim/thekims.family:latest + restart: unless-stopped + container_name: thekims_family + networks: + - shared + +networks: + shared: + external: true