mirror of
https://github.com/opencloud-eu/opencloud-compose.git
synced 2026-06-08 12:10:05 +08:00
fix(keycloak): prevent env vars from being printed in logs
The problem is credentials are displayed in the console, which poses a security risk in production. Printing the environment variables for log levels 'trace/debug' would help when debugging.
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
printenv
|
# print env variables for trace/debug log levels
|
||||||
|
log_level=$(printf '%s' "$KC_LOG_LEVEL" | tr '[:upper:]' '[:lower:]')
|
||||||
|
case "$log_level" in trace|debug) printenv ;; *) ;; esac
|
||||||
|
|
||||||
# replace openCloud domain and LDAP password in keycloak realm import
|
# replace openCloud domain and LDAP password in keycloak realm import
|
||||||
mkdir /opt/keycloak/data/import
|
mkdir /opt/keycloak/data/import
|
||||||
sed -e "s/cloud.opencloud.test/${OC_DOMAIN}/g" -e "s/ldap-admin-password/${LDAP_ADMIN_PASSWORD:-admin}/g" /opt/keycloak/data/import-dist/openCloud-realm.json > /opt/keycloak/data/import/openCloud-realm.json
|
sed -e "s/cloud.opencloud.test/${OC_DOMAIN}/g" -e "s/ldap-admin-password/${LDAP_ADMIN_PASSWORD:-admin}/g" /opt/keycloak/data/import-dist/openCloud-realm.json > /opt/keycloak/data/import/openCloud-realm.json
|
||||||
|
|||||||
Reference in New Issue
Block a user