From e345ed5415c602e4469a27ec81ea6e26f6dfc8b8 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Sun, 25 Dec 2022 15:19:12 +0900 Subject: [PATCH] =?UTF-8?q?keiu.net=20=E2=86=92=20fogtype.com?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 2 +- README.md | 8 ++++---- compose.yml | 4 +--- etc/caddy/Caddyfile | 19 +++++++++---------- etc/coredns/Corefile | 2 +- 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 516ee39..14e1735 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,4 +8,4 @@ jobs: steps: - run: install -m 700 -d ~/.ssh - run: install -m 600 <(echo '${{ secrets.DEPLOY_KEY }}') ~/.ssh/deploy_key - - run: ssh -i ~/.ssh/deploy_key -o 'StrictHostKeyChecking no' kou029w@keiu.net 'sh -c "cd ~/keiu.net && git pull --rebase && docker compose up --detach --remove-orphans"' + - run: ssh -i ~/.ssh/deploy_key -o 'StrictHostKeyChecking no' kou029w@fogtype.com 'sh -c "cd ~/keiu.net && git pull --rebase && docker compose up --detach --remove-orphans"' diff --git a/README.md b/README.md index 5456a34..4cf2d78 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ほんの少し降る雨 +# Fogtype ## 前提 @@ -9,9 +9,9 @@ Git リポジトリを取得し、設定ファイルを配置 ```bash -ssh kou029w@keiu.net -git clone git@github.com:kou029w/keiu.net.git -cd keiu.net +ssh kou029w@fogtype.com +git clone git@github.com:kou029w/fogtype.com.git +cd fogtype.com sudo install -m 644 {,/}etc/docker/daemon.json sudo systemctl restart docker ``` diff --git a/compose.yml b/compose.yml index 96d80df..71b685f 100644 --- a/compose.yml +++ b/compose.yml @@ -13,7 +13,6 @@ services: - caddy_data:/data - caddy_config:/config networks: - - keiu - fogtype dns: image: coredns/coredns:1.10.0@sha256:017727efcfeb7d053af68e51436ce8e65edbc6ca573720afb4f79c8594036955 @@ -29,7 +28,7 @@ services: - caddy_data:/var/lib/caddy/data command: "-conf /etc/coredns/Corefile" networks: - - keiu + - fogtype gts: image: superseriousbusiness/gotosocial:0.6.0@sha256:c3dbefe684529c7f97eb7d221f64bd9d14bd9c94e6543e6a8afe5a3469a9d77e restart: unless-stopped @@ -49,7 +48,6 @@ volumes: caddy_config: gotosocial_data: networks: - keiu: fogtype: ipam: driver: default diff --git a/etc/caddy/Caddyfile b/etc/caddy/Caddyfile index d668488..766060c 100644 --- a/etc/caddy/Caddyfile +++ b/etc/caddy/Caddyfile @@ -1,13 +1,5 @@ -keiu.net { - file_server - reverse_proxy /dns-query https://dns { - transport http { - tls_server_name keiu.net - } - } -} -www.keiu.net { - redir https://keiu.net{uri} 308 +keiu.net, www.keiu.net { + redir https://fogtype.com{uri} 308 } fogtype.com { reverse_proxy http://gts:8080 @@ -15,3 +7,10 @@ fogtype.com { www.fogtype.com { redir https://fogtype.com{uri} 308 } +dns.fogtype.com { + reverse_proxy /dns-query https://dns { + transport http { + tls_server_name dns.fogtype.com + } + } +} diff --git a/etc/coredns/Corefile b/etc/coredns/Corefile index 93676c3..d73b654 100644 --- a/etc/coredns/Corefile +++ b/etc/coredns/Corefile @@ -1,5 +1,5 @@ https://. tls://. . { - tls /var/lib/caddy/data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/keiu.net/keiu.net.crt /var/lib/caddy/data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/keiu.net/keiu.net.key + tls /var/lib/caddy/data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/dns.fogtype.com/dns.fogtype.com.crt /var/lib/caddy/data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/dns.fogtype.com/dns.fogtype.com.key reload prometheus 0.0.0.0:9153 hosts {