Removed add_bc_user.sh

This commit is contained in:
p.delpy@dkfz-heidelberg.de 2022-11-03 09:26:01 +01:00
parent ce386f5a2a
commit 7ea5e928fc
4 changed files with 8 additions and 31 deletions

View File

@ -215,23 +215,9 @@ This will install the systemd units to run and update the bridghead. Also, this
### Basic Auth ### Basic Auth
For Data protection we use basic authenfication for some services. To access those services you need an username and password combination. For Data protection we use basic authentification for some services. To access those services you need an username and password combination.
Cation: If you start the bridgehead without the authenfication, then those services are not accesbile. Caution: If you start the bridgehead without the authentification, then those services are not accessible.
We generate such a combination at the first install. Also, we provide a script which generates such a combination for you. We generate such a combination at the first install (`/etc/bridgehead/<Project>.local.conf`).
``` shell
add_user.sh
```
The script will print the hashed user password combination. Please put the combination to the ```/etc/bridgehead/<project>.local.conf</project>```
It should look like this
```conf
LDM_Password='<project>:$...$.....$...............'
```
You can use the ```add_bc_auth_user.sh``` script to generate an another user and add it to the ```<project>.local.conf``` wiht comma seperation.
## Configuration ## Configuration

View File

@ -21,7 +21,7 @@ services:
- "traefik.http.routers.dashboard.service=api@internal" - "traefik.http.routers.dashboard.service=api@internal"
- "traefik.http.routers.dashboard.tls=true" - "traefik.http.routers.dashboard.tls=true"
- "traefik.http.routers.dashboard.middlewares=auth" - "traefik.http.routers.dashboard.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=${bc_auth_users}" - "traefik.http.middlewares.auth.basicauth.users=${LDM_LOGIN}"
ports: ports:
- 80:80 - 80:80
- 443:443 - 443:443
@ -65,7 +65,7 @@ services:
- "blaze-data:/app/data" - "blaze-data:/app/data"
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.middlewares.ccp-auth.basicauth.users=${bc_auth_users}" - "traefik.http.middlewares.ccp-auth.basicauth.users=${LDM_LOGIN}"
- "traefik.http.routers.blaze_ccp.rule=PathPrefix(`/bbmri-localdatamanagement`)" - "traefik.http.routers.blaze_ccp.rule=PathPrefix(`/bbmri-localdatamanagement`)"
- "traefik.http.middlewares.ccp_b_strip.stripprefix.prefixes=/bbmri-localdatamanagement" - "traefik.http.middlewares.ccp_b_strip.stripprefix.prefixes=/bbmri-localdatamanagement"
- "traefik.http.services.blaze_ccp.loadbalancer.server.port=8080" - "traefik.http.services.blaze_ccp.loadbalancer.server.port=8080"

View File

@ -1,10 +0,0 @@
#!/bin/bash -e
source lib/functions.sh
log "INFO" "This script add's a user with password to the bridghead"
read -p 'Username: ' bc_user
read -sp 'Password: ' bc_password
log "INFO" "\nPlease export the line in the your environment. Please replace the dollar signs with with \\\$"
docker run --rm -it httpd:latest htpasswd -nb $bc_user $bc_password

View File

@ -39,10 +39,11 @@ if [ -z "$LDM_LOGIN" ]; then
generated_passwd="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)" generated_passwd="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)"
log "INFO" "Your generated credentials are:\n user: $PROJECT\n password: $generated_passwd" log "INFO" "Your generated credentials are:\n user: $PROJECT\n password: $generated_passwd"
parsed_passwd=$(docker run --rm -it httpd:latest htpasswd -nb $PROJECT $generated_passwd | tr -d '\n') parsed_passwd=$(docker run --rm -it httpd:latest htpasswd -nb $PROJECT $generated_passwd | tr -d '\n' | tr -d '\r')
printf "##Localdatamanagement basic auth\n#User: $PROJECT\n#Password: $generated_passwd\n" >> /etc/bridgehead/${PROJECT}.local.conf;
log "INFO" "These credentials are now written to /etc/bridgehead/${PROJECT}.local.conf" log "INFO" "These credentials are now written to /etc/bridgehead/${PROJECT}.local.conf"
echo "LDM_LOGIN='${parsed_passwd}'" >> /etc/bridgehead/${PROJECT}.local.conf; echo -n "LDM_LOGIN='${parsed_passwd}'" >> /etc/bridgehead/${PROJECT}.local.conf;
fi fi
log "INFO" "Register system units for bridgehead and bridgehead-update" log "INFO" "Register system units for bridgehead and bridgehead-update"