Improved script for user

This commit is contained in:
Patrick Skowronek 2022-04-04 14:02:03 +02:00
parent 2bab2edf43
commit a3f9dc64b7
4 changed files with 8 additions and 12 deletions

View File

@ -286,9 +286,8 @@ It is not recommended to use this script in production!
### Basic Auth ### Basic Auth
Some services we use authfication to protect the data. For example for local data managemnt like the blaze. use add_user.sh
The /auth direcotry contians for each project a file with user and password combination. If it is not present please create a file with just the project name. To add a combination use [htpasswdgenerator](https://htpasswdgenerator.de/) or use htpasswd on your maschine.
### HTTPS Access ### HTTPS Access

View File

@ -9,10 +9,9 @@ services:
- --entrypoints.web.address=:80 - --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443 - --entrypoints.websecure.address=:443
- --providers.docker=true - --providers.docker=true
- --providers.file.directory=/configuration/ - --providers.file.watch=true
- --entrypoints.web.http.redirections.entrypoint.to=websecure - --entrypoints.web.http.redirections.entrypoint.to=websecure
- --entrypoints.web.http.redirections.entrypoint.scheme=https - --entrypoints.web.http.redirections.entrypoint.scheme=https
- --providers.file.watch=true
ports: ports:
- 80:80 - 80:80
- 443:443 - 443:443
@ -48,13 +47,14 @@ services:
- "blaze-data:/app/data" - "blaze-data:/app/data"
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.middlewares.test-auth.basicauth.usersfile=/auth/dktk" - "traefik.http.middlewares.test-auth.basicauth.users=${bc_auth_users}"
- "traefik.http.routers.blaze_dktk.rule=PathPrefix(`/dktk-localdatamanagement`)" - "traefik.http.routers.blaze_dktk.rule=PathPrefix(`/dktk-localdatamanagement`)"
- "traefik.http.middlewares.dktk_b_strip.stripprefix.prefixes=/dktk-localdatamanagement" - "traefik.http.middlewares.dktk_b_strip.stripprefix.prefixes=/dktk-localdatamanagement"
- "traefik.http.services.blaze_dktk.loadbalancer.server.port=8080" - "traefik.http.services.blaze_dktk.loadbalancer.server.port=8080"
- "traefik.http.routers.blaze_dktk.middlewares=dktk_b_strip,test-auth" - "traefik.http.routers.blaze_dktk.middlewares=dktk_b_strip,test-auth"
- "traefik.http.routers.blaze_dktk.tls=true" - "traefik.http.routers.blaze_dktk.tls=true"
# dktk-fed-search-share: # dktk-fed-search-share:
# image: "ghcr.io/samply/dktk-fed-search-share:pr-1" # image: "ghcr.io/samply/dktk-fed-search-share:pr-1"
# container_name: bridgehead_dktk_share # container_name: bridgehead_dktk_share

View File

@ -9,10 +9,7 @@ echo
bc=$(docker run --rm -ti xmartlabs/htpasswd $bc_user $bc_password) bc=$(docker run --rm -ti xmartlabs/htpasswd $bc_user $bc_password)
if [ -z $bc_auth_users ]; then if [ -z $bc_auth_users ]; then
export bc_auth_users=$bc printf "Please run: export bc_auth_users=\"%q\"" $bc
echo $bc_auth_users
else else
export bc_auth_users="$bc_auth_users,$bc" echo "Please run: export bc_auth_users=\"${bc},$bc_auth_users\""
echo $bc_auth_users
fi fi

View File

@ -4,7 +4,7 @@
## Check if user is a su ## Check if user is a su
echo "Welcome to the starting a bridgehead. We will get your instance up and running in no time" echo "Welcome to the starting a bridgehead. We will get your instance up and running in no time"
echo "First we will check if all prerequisites are met ..." echo "First we will check if all prerequisites are met ..."
prerequisites="git docker docker-compose cat" prerequisites="git docker docker-compose"
for prerequisite in $prerequisites; do for prerequisite in $prerequisites; do
$prerequisite --version 2>&1 $prerequisite --version 2>&1
is_available=$? is_available=$?