Disable auth for certbot webroot challenge.

This commit is contained in:
Brad Treloar 2025-04-26 00:15:20 +09:30
parent a1ee2f85f8
commit 40a91f6d66
4 changed files with 21 additions and 1 deletions

4
docker/build.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
docker container rm notes-server
docker build --no-cache -t notes-server .

View file

@ -6,7 +6,7 @@ docker build --no-cache -t notes-server .
# Run the notes-server image.
docker run -d \
--name notes-server \
-v "/var/www/html/notes/hugo/public:/usr/share/nginx/html" \
-v "${PWD}/../hugo/public:/usr/share/nginx/html" \
-p 42069:80 \
notes-server

View file

@ -2,8 +2,15 @@ server {
listen 80 default_server;
root "/usr/share/nginx/html";
error_page 404 404.html;
location / {
auth_basic "Restricted";
auth_basic_user_file auth.htpasswd;
}
# Disable authentication for certbot challenge dir.
location /.well-known/acme-challenge/ {
auth_basic off;
}
}

9
docker/run.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
# Run the notes-server image.
docker run \
--name notes-server \
-v "${PWD}/../hugo/public:/usr/share/nginx/html" \
-p 42069:80 \
notes-server