Get certbot to work and make mastodon serve without conflict

This commit is contained in:
Erik Stambaugh 2024-01-21 08:02:49 -08:00
parent fe897152f5
commit 716d0f1dc8
3 changed files with 6 additions and 5 deletions

View file

@ -9,8 +9,7 @@ services:
- /srv/certbot/www:/var/www/certbot
entrypoint: >
/bin/sh -c 'trap exit TERM;
certbot certonly --noninteractive --register-unsafely-without-email --agree-tos --reinstall --cert-name {{domain_name}} -d {{domain_name}} --webroot --webroot-path=/var/www/certbot
; while :; do certbot renew --noninteractive --webroot --webroot-path=/var/www/certbot --cert-name {{domain_name}}
while :; do certbot renew --noninteractive --webroot --webroot-path=/var/www/certbot --cert-name {{domain_name}}
; sleep 12h & wait $${!}; done;'
networks:
- nginx

View file

@ -17,6 +17,7 @@
git:
repo: "https://tea.entar.net/teh/mastodon.git"
dest: /srv/mastodon/src
version: deploy
- name: docker-compose file
template:

View file

@ -9,7 +9,7 @@ http {
charset utf-8;
server {
listen 80;
server_name {{domain_name}};
server_name {{domain_name}}_base;
server_tokens off;
location /.well-known/acme-challenge/ {
@ -28,7 +28,7 @@ http {
listen 443 ssl default_server;
server_name {{domain_name}};
server_name {{domain_name}}_base;
root /usr/share/nginx/html;
include /etc/nginx/mime.types;
@ -37,7 +37,6 @@ http {
ssl_certificate_key /etc/letsencrypt/live/{{domain_name}}/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
# ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
try_files $uri $uri/ /index.html;
@ -71,3 +70,5 @@ http {
include /etc/nginx/conf.d/*.conf;
}