Compare commits

...

8 Commits

7 changed files with 41 additions and 3 deletions

View File

@ -63,6 +63,7 @@ COMPOSE_FILE="compose.yml"
## Enable prometheus metrics collection
## used used by the coop-cloud monitoring stack
#COMPOSE_FILE="$COMPOSE_FILE:compose.metrics.yml"
#METRICS_ENABLED=1
#####################################################################
@ -110,3 +111,9 @@ COMPOSE_FILE="compose.yml"
## Matrix
#COMPOSE_FILE="$COMPOSE_FILE:compose.matrix.yml"
#MATRIX_FEDERATION_ENABLED=1
## BASIC_AUTH
## Use httpasswd to generate the secret
#COMPOSE_FILE="$COMPOSE_FILE:compose.basicauth.yml"
#BASIC_AUTH=1
#SECRET_USERSFILE_VERSION=v1

View File

@ -1,3 +1,3 @@
export TRAEFIK_YML_VERSION=v15
export FILE_PROVIDER_YML_VERSION=v7
export TRAEFIK_YML_VERSION=v17
export FILE_PROVIDER_YML_VERSION=v8
export ENTRYPOINT_VERSION=v2

12
compose.basicauth.yml Normal file
View File

@ -0,0 +1,12 @@
version: "3.8"
services:
app:
environment:
- BASIC_AUTH
secrets:
- usersfile
secrets:
usersfile:
name: ${STACK_NAME}_usersfile_${SECRET_USERSFILE_VERSION}
external: true

9
compose.metrics.yml Normal file
View File

@ -0,0 +1,9 @@
version: "3.8"
services:
app:
environment:
- METRICS_ENABLED
ports:
- target: 8082
published: 8082
mode: host

View File

@ -47,7 +47,7 @@ services:
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}.service=api@internal"
- "traefik.http.routers.${STACK_NAME}.middlewares=security@file"
- "coop-cloud.${STACK_NAME}.version=2.2.0+v2.10.1"
- "coop-cloud.${STACK_NAME}.version=2.3.1+v2.10.2"
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}"
networks:

View File

@ -17,6 +17,11 @@ http:
authResponseHeaders:
- X-Forwarded-User
{{ end }}
{{ if eq (env "BASIC_AUTH") "1" }}
basicauth:
basicAuth:
usersFile: "/run/secrets/usersfile"
{{ end }}
security:
headers:
frameDeny: true

View File

@ -67,6 +67,9 @@ entrypoints:
{{ if eq (env "METRICS_ENABLED") "1" }}
metrics:
address: ":8082"
http:
middlewares:
- basicauth@file
{{ end }}
{{ if eq (env "MATRIX_FEDERATION_ENABLED") "1" }}
matrix-federation:
@ -80,6 +83,8 @@ ping:
metrics:
prometheus:
entryPoint: metrics
addRoutersLabels: true
addServicesLabels: true
{{ end }}
certificatesResolvers: