mirror of
https://git.cloudron.io/cloudron/mastodon-app.git
synced 2024-11-22 07:41:00 +00:00
Enable ldap support
This commit is contained in:
parent
2a276924dd
commit
756f203006
2 changed files with 20 additions and 8 deletions
16
env.template
16
env.template
|
@ -22,14 +22,14 @@ SMTP_PASSWORD=
|
|||
SMTP_AUTH_METHOD=plain
|
||||
SMTP_OPENSSL_VERIFY_MODE=none
|
||||
|
||||
# LDAP_ENABLED=$([ -z "${CLOUDRON_LDAP_SERVER}" ] && echo "false" || echo "true")
|
||||
# LDAP_HOST=${CLOUDRON_LDAP_SERVER}
|
||||
# LDAP_PORT=${CLOUDRON_LDAP_PORT}
|
||||
# LDAP_BASE=${CLOUDRON_LDAP_USERS_BASE_DN}
|
||||
# LDAP_BIND_DN=${CLOUDRON_LDAP_BIND_DN}
|
||||
# LDAP_PASSWORD=${CLOUDRON_LDAP_BIND_PASSWORD}
|
||||
# LDAP_UID=username
|
||||
# LDAP_SEARCH_FILTER=(|(%{uid}=%{email})(mail=%{email}))
|
||||
LDAP_ENABLED=
|
||||
LDAP_HOST=
|
||||
LDAP_PORT=
|
||||
LDAP_BASE=
|
||||
LDAP_BIND_DN=
|
||||
LDAP_PASSWORD=
|
||||
LDAP_UID=username
|
||||
LDAP_SEARCH_FILTER=(|(%{uid}=%{email})(mail=%{email}))
|
||||
|
||||
SECRET_KEY_BASE=
|
||||
OTP_SECRET=
|
||||
|
|
12
start.sh
12
start.sh
|
@ -26,6 +26,18 @@ sed -e "s/DB_HOST=.*/DB_HOST=${CLOUDRON_POSTGRESQL_HOST}/g" \
|
|||
-e "s/LOCAL_DOMAIN=.*/LOCAL_DOMAIN=${CLOUDRON_APP_DOMAIN}/g" \
|
||||
-i /app/data/env.production
|
||||
|
||||
if [[ -n "${CLOUDRON_LDAP_SERVER:-}" ]]; then
|
||||
sed -e "s/LDAP_ENABLED=.*/LDAP_ENABLED=true/g" \
|
||||
-e "s/LDAP_HOST=.*/LDAP_HOST=${CLOUDRON_LDAP_SERVER}/g" \
|
||||
-e "s/LDAP_PORT=.*/LDAP_PORT=${CLOUDRON_LDAP_PORT}/g" \
|
||||
-e "s/LDAP_BASE=.*/LDAP_HOST=${CLOUDRON_LDAP_USERS_BASE_DN}/g" \
|
||||
-e "s/LDAP_BIND_DN=.*/LDAP_BIND_DN=${CLOUDRON_LDAP_BIND_DN}/g" \
|
||||
-e "s/LDAP_BIND_PASSWORD=.*/LDAP_BIND_DN=${CLOUDRON_LDAP_BIND_PASSWORD}/g"
|
||||
-i /app/data/env.production
|
||||
else
|
||||
sed -e "s/LDAP_ENABLED=.*/LDAP_ENABLED=false/g" -i /app/data/env.production
|
||||
fi
|
||||
|
||||
if grep -q "^SECRET_KEY_BASE=$" /app/data/env.production; then
|
||||
echo "==> Generating secrets"
|
||||
export RANDFILE=/tmp/.rnd
|
||||
|
|
Loading…
Reference in a new issue