diff --git a/compose.yml b/compose.yml index fc50a47..075eacb 100644 --- a/compose.yml +++ b/compose.yml @@ -24,10 +24,19 @@ services: - "127.0.0.1:9153:9153" volumes: - ./etc/coredns:/etc/coredns - - caddy_data:/var/lib/caddy/data + - coredns_data:/var/lib/coredns command: "-conf /etc/coredns/Corefile" networks: - fogtype + cron: + image: alpine:3.18@sha256:7144f7bab3d4c2648d7e59409f15ec52a18006a128c733fcff20d3a4a54ba44a + restart: unless-stopped + volumes: + - ./etc/periodic:/etc/periodic:ro + - caddy_data:/var/lib/caddy/data:ro + - coredns_data:/var/lib/coredns + init: true + command: ["/usr/sbin/crond", "-f", "-L", "/dev/stdout"] gts: image: superseriousbusiness/gotosocial:0.10.0@sha256:1e901dae99ef5925b4b43108029a408b1ccf88027f295793f531295c74689fd3 restart: unless-stopped @@ -73,6 +82,7 @@ services: volumes: caddy_data: caddy_config: + coredns_data: gotosocial_data: maddy_data: headscale_data: diff --git a/etc/coredns/Corefile b/etc/coredns/Corefile index c2db39c..21b7a86 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/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 + tls /var/lib/coredns/certificates/acme-v02.api.letsencrypt.org-directory/dns.fogtype.com/dns.fogtype.com.crt /var/lib/coredns/certificates/acme-v02.api.letsencrypt.org-directory/dns.fogtype.com/dns.fogtype.com.key reload prometheus 0.0.0.0:9153 cache 10 diff --git a/etc/periodic/weekly/certificates b/etc/periodic/weekly/certificates new file mode 100755 index 0000000..575ec81 --- /dev/null +++ b/etc/periodic/weekly/certificates @@ -0,0 +1,7 @@ +#!/bin/sh +set -eu +install \ + -D \ + -m 644 \ + -t /var/lib/coredns/certificates/acme-v02.api.letsencrypt.org-directory/dns.fogtype.com/ \ + /var/lib/caddy/data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/dns.fogtype.com/dns.fogtype.com.*