feat: http basic auth

Closes #1
This commit is contained in:
decentral1se 2024-03-14 17:25:51 +01:00
parent ddb89cbe62
commit 856ef36969
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
3 changed files with 25 additions and 0 deletions

View File

@ -1,3 +1,9 @@
TYPE=sextant
DOMAIN=sextant.example.com
LETS_ENCRYPT_ENV=production
# HTTP basic auth
#COMPOSE_FILE="compose.yml:compose.basicauth.yml"
#HTTP_BASIC_AUTH_ENABLED=1
#HTTP_BASIC_AUTH_USERNAME=foo
#SECRET_AUTH_PASSWORD_VERSION=v1

15
compose.basicauth.yml Normal file
View File

@ -0,0 +1,15 @@
---
version: "3.8"
services:
app:
environment:
- HTTP_BASIC_AUTH_ENABLED
- HTTP_BASIC_AUTH_USERNAME
secrets:
- auth_password
secrets:
auth_password:
name: ${STACK_NAME}_auth_password_${SECRET_AUTH_PASSWORD_VERSION}
external: true

View File

@ -4,3 +4,7 @@ nominatim_url = "https://nominatim.openstreetmap.org/search.php"
vroom_url = "https://routing.eotl.supply/osmr"
dsn = "~/.sextant.db"
ssrauth_filepath = "/var/www/htdocs/default/.ssr/auth"
{{ if eq (env "HTTP_BASIC_AUTH_ENABLED") "1" }}
http_basic_auth_username = "{{ env "HTTP_BASIC_AUTH_USERNAME" }}"
http_basic_auth_password = "{{ secret "auth_password" }}"
{{ end }}