Dockerfile for synapse
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

32 lines
899 B

#!/usr/bin/env bash
COMMAND="${1}"
prepare() {
chown ${UID}:${GID} /data
cd /synapse
source bin/activate
}
case ${COMMAND} in
"start")
prepare
su-exec ${UID}:${GID} python2 -m synapse.app.homeserver \
--config-path /data/config/homeserver.yaml
;;
"generate")
breakup="0"
[[ -z "${SERVER_NAME}" ]] && echo "STOP! environment variable SERVER_NAME must be set" && breakup="1"
[[ -z "${REPORT_STATS}" ]] && echo "STOP! environment variable REPORT_STATS must be set to 'no' or 'yes'" && breakup="1"
[[ "${breakup}" == "1" ]] && exit 1
[[ "${REPORT_STATS}" != "yes" ]] && [[ "${REPORT_STATS}" != "no" ]] && \
echo "STOP! REPORT_STATS needs to be 'no' or 'yes'" && breakup="1"
prepare
su-exec ${UID}:${GID} python2 -m synapse.app.homeserver \
-c /data/config/homeserver.yaml \
--generate-config \
-H ${SERVER_NAME} \
--report-stats ${REPORT_STATS}
;;
esac