Commit 9915ced5 authored by Ian Fijolek's avatar Ian Fijolek

Update config generation

parent 4774b880
FROM "bitwardenrs/server:1.9.1" as bitwarden
FROM "vividboarder/bitwarden_rs_ldap:alpine" as bitwarden_ldap
FROM cloudron/base:1.0.0@sha256:147a648a068a2e746644746bbfb42eb7a50d682437cead3c67c933c546357617
......@@ -30,7 +31,8 @@ COPY --from=bitwarden /web-vault /app/code/web-vault
COPY --from=bitwarden /bitwarden_rs /app/code/
COPY --from=bitwarden /Rocket.toml /app/code/
# Copy ldap sync utility
COPY --from=vividboarder/bitwarden_rs_ldap:v0.1.0 /usr/local/cargo/bin/bitwarden_rs_ldap /app/code/
COPY --from=bitwarden_ldap /usr/local/bin/bitwarden_rs_ldap /app/code/
ENV RUST_BACKTRACE=1
WORKDIR /app/code
COPY start.sh /app/code/start.sh
......
......@@ -7,7 +7,7 @@ export SMTP_HOST=$MAIL_SMTP_SERVER
export SMTP_FROM=$MAIL_FROM
export SMTP_FROM_NAME=Bitwarden
export SMTP_PORT=$MAIL_SMTPS_PORT
export SMTP_SSL=true
# export SMTP_SSL=true
export SMTP_USERNAME=$MAIL_SMTP_USERNAME
export SMTP_PASSWORD=$MAIL_SMTP_PASSWORD
......@@ -23,5 +23,16 @@ APACHE_CONFDIR="" source /etc/apache2/envvars
rm -f "${APACHE_PID_FILE}"
/usr/sbin/apache2 -DFOREGROUND &
echo "=> Generate LDAP config"
# 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
echo "=> Starting bitwarden_rs"
exec /app/code/bitwarden_rs
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment