authelia-cloudron/start.sh

28 lines
894 B
Bash
Executable File

#! /bin/bash
set -eu
mkdir -p /run/authelia
# Generate base config from template
sed -e "s/##DEFAULT_REDIRECT_URL/${REDIRECT_URL}/" \
-e "s/##TOTP_ISSUER/${}/"\
-e "s/##LDAP_URL/${LDAP_URL}/"\
-e "s/##LDAP_USERS_BASE_DN/${LDAP_USERS_BASE_DN}/"\
-e "s/##LDAP_GROUPS_BASE_DN/${LDAP_GROUPS_BASE_DN}/"\
-e "s/##LDAP_BIND_DN/${LDAP_BIND_DN}/"\
-e "s/##LDAP_BIND_PASSWORD/${LDAP_BIND_PASSWORD}/"\
/app/code/config.template.yml > /run/authelia/config.yml
# Create override config.yml file if not exists
if [[ ! -f /app/data/config.yml ]]; then
echo "# Add additional customizations in this file" > /app/data/config.yml
fi
# merge yaml files
/app/code/yaml-override.js /run/authelia/config.yml /app/data/config.yml
chown -R cloudron:cloudron /app/data /run/authelia
exec /usr/local/bin/gosu cloudron:cloudron ./node_modules/.bin/authelia /run/authelia/config.yml