add basicauth service #16

Merged
stevensting merged 2 commits from basicauth into main 2026-07-07 07:56:01 +00:00
2 changed files with 18 additions and 0 deletions
+4
View File
@@ -36,6 +36,10 @@ DB_DOCKER_IMAGE=ghcr.io/baosystems/postgis:${DB_DOCKER_VERSION}
# TODO: maybe to use for Upgrading to a new Postgres version? (NOTE: does not work with postgis data)
# DB_DOCKER_IMAGE=pgautoupgrade/pgautoupgrade:16-alpine
## BASIC_AUTH
## Use 'echo $(htpasswd -nB username)' to generate the secret and store it in secret 'usersfile', multiple user/hashedpassword combinations can be added as comma separated list
#COMPOSE_FILE="$COMPOSE_FILE:compose.basicauth.yml"
#SECRET_USERSFILE_VERSION=v1
# enter your instance's domain name
DOMAIN=bonfire.example.com
+14
View File
@@ -0,0 +1,14 @@
version: "3.8"
services:
app:
secrets:
- usersfile
deploy:
labels:
- "traefik.http.middlewares.${STACK_NAME}_basicauth.basicauth.usersFile=/run/secrets/usersfile"
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}_basicauth"
secrets:
usersfile:
name: ${STACK_NAME}_usersfile_${SECRET_USERSFILE_VERSION}
external: true