Ensure we can also use the email to login via LDAP
This commit is contained in:
5
start.sh
5
start.sh
@@ -19,6 +19,7 @@ if [[ ! -f /app/data/traccar.xml ]]; then
|
||||
disable_registration &
|
||||
fi
|
||||
|
||||
echo "=> Ensure database settings"
|
||||
# database (https://www.traccar.org/mysql/)
|
||||
xmlstarlet ed --inplace \
|
||||
--update '//properties/entry[@key="database.url"]' -v "jdbc:mysql://${CLOUDRON_MYSQL_HOST}:${CLOUDRON_MYSQL_PORT}/${CLOUDRON_MYSQL_DATABASE}?serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''" \
|
||||
@@ -31,12 +32,13 @@ xmlstarlet ed --inplace --update '//properties/entry[@key="web.url"]' -v "${CLOU
|
||||
|
||||
# ldap
|
||||
if [[ -n "${CLOUDRON_LDAP_URL:-}" ]]; then
|
||||
echo "=> Ensure LDAP settings"
|
||||
xmlstarlet ed --inplace \
|
||||
--update '//properties/entry[@key="ldap.enable"]' -v "true" \
|
||||
--update '//properties/entry[@key="ldap.url"]' -v "${CLOUDRON_LDAP_URL}" \
|
||||
--update '//properties/entry[@key="ldap.base"]' -v "${CLOUDRON_LDAP_USERS_BASE_DN}" \
|
||||
--update '//properties/entry[@key="ldap.idAttribute"]' -v "username" \
|
||||
--update '//properties/entry[@key="ldap.searchFilter"]' -v 'username=:login' \
|
||||
--update '//properties/entry[@key="ldap.searchFilter"]' -v '(|(username=:login)(mail=:login))' \
|
||||
--update '//properties/entry[@key="ldap.user"]' -v "${CLOUDRON_LDAP_BIND_DN}" \
|
||||
--update '//properties/entry[@key="ldap.password"]' -v "${CLOUDRON_LDAP_BIND_PASSWORD}" \
|
||||
/app/data/traccar.xml
|
||||
@@ -45,6 +47,7 @@ else
|
||||
fi
|
||||
|
||||
# email
|
||||
echo "=> Ensure mail settings"
|
||||
xmlstarlet ed --inplace \
|
||||
--update '//properties/entry[@key="mail.smtp.host"]' -v "${CLOUDRON_MAIL_SMTP_SERVER}" \
|
||||
--update '//properties/entry[@key="mail.smtp.port"]' -v "${CLOUDRON_MAIL_SMTP_PORT}" \
|
||||
|
Reference in New Issue
Block a user