Initial version

This commit is contained in:
Joey
2017-03-13 07:59:00 +00:00
commit faba1547ce
9 changed files with 112 additions and 0 deletions

29
start_matrix.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
set -eux
if [[ ! -d /app/data/synapse ]]; then
echo "=> Detected first run"
mkdir -p /app/data/synapse
cd /app/data/synapse
python -m synapse.app.homeserver \
--server-name ${APP_DOMAIN#*.} \
--config-path homeserver.yaml \
--report-stats=no \
--generate-config
fi
if [[ ! -e /app/data/riot_config.json ]]; then
cp /app/code/config.sample.json /app/data/riot_config.json
sed -i "s#https://matrix.org#https://$APP_DOMAIN#" /app/data/riot_config.json
fi
mkdir -p /app/data/nginx
mkdir -p /app/data/nginx_log
chown -R www-data.www-data /app/data
cd /app/data/synapse
gosu www-data python -m synapse.app.homeserver --config-path homeserver.yaml &> /dev/null &
exec /usr/sbin/nginx -g 'daemon off;'