ldap_sync.sh 588 Bytes
Newer Older
1 2 3
#! /bin/bash
set -e

4 5 6 7 8 9 10 11 12 13 14 15 16
export ADMIN_TOKEN=$(cat /app/data/admin_token)

# Generate ldap sync config from template
sed -e "s/##LDAP_SERVER/${LDAP_SERVER}/"\
    -e "s/##LDAP_PORT/${LDAP_PORT}/"\
    -e "s/##LDAP_USERS_BASE_DN/${LDAP_USERS_BASE_DN}/"\
    -e "s/##LDAP_BIND_DN/${LDAP_BIND_DN}/"\
    -e "s/##LDAP_BIND_PASSWORD/${LDAP_BIND_PASSWORD}/"\
    -e "s/##BITWARDEN_HOSTNAME/${CLOUDRON_APP_HOSTNAME}/"\
    -e "s/##ADMIN_TOKEN/${ADMIN_TOKEN}/"\
    /app/code/ldap_config.template.toml > /run/ldap_config.toml

export CONFIG_PATH=/run/ldap_config.toml
17
exec /app/code/bitwarden_rs_ldap