Fixed nginx crashes and Email
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
[0.1.4]
|
||||||
|
* Changed log location of synapse due to backup crashes
|
||||||
|
* Updated some configs
|
||||||
|
|
||||||
[0.1.3]
|
[0.1.3]
|
||||||
* Changed log location of nginx due to backup crashes
|
* Changed log location of nginx due to backup crashes
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,16 @@ FROM cloudron/base:0.10.0
|
|||||||
MAINTAINER Authors name <support@cloudron.io>
|
MAINTAINER Authors name <support@cloudron.io>
|
||||||
|
|
||||||
RUN mkdir -p /app/code
|
RUN mkdir -p /app/code
|
||||||
RUN mkdir -p /app/data
|
|
||||||
RUN mkdir -p /app/data/templates
|
RUN mkdir -p /app/data/templates
|
||||||
|
|
||||||
WORKDIR /app/code
|
WORKDIR /app/code
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
# Nginx
|
# nginx
|
||||||
RUN rm /etc/nginx/sites-enabled/*
|
RUN rm /etc/nginx/sites-enabled/*
|
||||||
ADD nginx_matrix.conf /etc/nginx/sites-enabled/
|
ADD nginx_matrix.conf /etc/nginx/sites-enabled/
|
||||||
RUN rm -rf /var/lib/nginx && ln -sf /app/data/nginx /var/lib/nginx
|
RUN mv /var/lib/nginx /app/data/nginx && ln -sf /app/data/nginx /var/lib/nginx
|
||||||
RUN rm -rf /var/log/nginx && ln -sf /run/nginx_log /var/log/nginx
|
RUN rm -rf /var/log/nginx && ln -sf /run/nginx_log /var/log/nginx
|
||||||
|
|
||||||
# TURN
|
# TURN
|
||||||
@@ -40,7 +39,7 @@ RUN pip install https://github.com/matrix-org/synapse/tarball/master
|
|||||||
# copy index.html
|
# copy index.html
|
||||||
COPY index.html /app/code
|
COPY index.html /app/code
|
||||||
|
|
||||||
RUN chown -R www-data.www-data /app/code
|
RUN chown -R www-data.www-data /app/code /app/data
|
||||||
|
|
||||||
ADD start_matrix.sh /app/
|
ADD start_matrix.sh /app/
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,18 @@ set -eux
|
|||||||
if [[ ! -d /app/data/synapse ]]; then
|
if [[ ! -d /app/data/synapse ]]; then
|
||||||
echo "=> Detected first run"
|
echo "=> Detected first run"
|
||||||
|
|
||||||
|
# create dirs (for whatever reason the nginx dir couldn't get created by nginx)
|
||||||
|
mkdir -p /app/data/synapse \
|
||||||
|
/app/data/nginx/fastcgi \
|
||||||
|
/run/nginx_log \
|
||||||
|
/run/synapse \
|
||||||
|
/run/turn_log
|
||||||
|
|
||||||
|
# fix permissions
|
||||||
|
chown -R www-data.www-data /run/synapse \
|
||||||
|
/run/turn_log \
|
||||||
|
/app/data
|
||||||
|
|
||||||
# copy turn config
|
# copy turn config
|
||||||
cp /usr/share/coturn/examples/etc/turnserver.conf /app/data/turnserver.conf
|
cp /usr/share/coturn/examples/etc/turnserver.conf /app/data/turnserver.conf
|
||||||
|
|
||||||
@@ -17,15 +29,11 @@ if [[ ! -d /app/data/synapse ]]; then
|
|||||||
mkdir -p /app/data/synapse
|
mkdir -p /app/data/synapse
|
||||||
cd /app/data/synapse
|
cd /app/data/synapse
|
||||||
python -m synapse.app.homeserver \
|
python -m synapse.app.homeserver \
|
||||||
--server-name ${APP_DOMAIN#*.} \
|
--server-name ${APP_DOMAIN} \
|
||||||
--config-path homeserver.yaml \
|
--config-path homeserver.yaml \
|
||||||
--report-stats=no \
|
--report-stats=no \
|
||||||
--generate-config
|
--generate-config
|
||||||
|
|
||||||
# python -m sydent.sydent \
|
|
||||||
# --config-path sydent.yaml \
|
|
||||||
# --generate-config
|
|
||||||
|
|
||||||
# synapse config
|
# synapse config
|
||||||
sed -i "s/server_name:.*/server_name: ${APP_DOMAIN}/" homeserver.yaml
|
sed -i "s/server_name:.*/server_name: ${APP_DOMAIN}/" homeserver.yaml
|
||||||
sed -i "s/web_client:.*/web_client: False/" homeserver.yaml
|
sed -i "s/web_client:.*/web_client: False/" homeserver.yaml
|
||||||
@@ -54,7 +62,11 @@ if [[ ! -d /app/data/synapse ]]; then
|
|||||||
sed -i "s/enable_group_creation:.*/enable_group_creation: True/" homeserver.yaml
|
sed -i "s/enable_group_creation:.*/enable_group_creation: True/" homeserver.yaml
|
||||||
sed -i "s/#user_directory:/user_directory:/" homeserver.yaml
|
sed -i "s/#user_directory:/user_directory:/" homeserver.yaml
|
||||||
sed -i "s/# search_all_users:.*/ search_all_users: True/" homeserver.yaml
|
sed -i "s/# search_all_users:.*/ search_all_users: True/" homeserver.yaml
|
||||||
sed -i "s/log_file: .*/log_file: \"\/app\/data\/synapse\/homeserver.log\"/" homeserver.yaml
|
|
||||||
|
# get synapse log name and set path
|
||||||
|
LOG_CONFIG=$(ls *.log.config)
|
||||||
|
sed -i "s/log_file: .*/log_file: \"\/run\/synapse\/homeserver.log\"/" homeserver.yaml
|
||||||
|
sed -i "s/ filename:.*/ filename: \/run\/synapse\/homeserver.log/" ${LOG_CONFIG}
|
||||||
|
|
||||||
|
|
||||||
# coturn
|
# coturn
|
||||||
@@ -68,7 +80,7 @@ if [[ ! -d /app/data/synapse ]]; then
|
|||||||
sed -i "s/turn_uris: .*/turn_uris: [\"turn:${APP_DOMAIN}:${TURN_TLS_PORT}?transport=udp\", \"turn:${APP_DOMAIN}:${TURN_TLS_PORT}?transport=tcp\"]/" homeserver.yaml
|
sed -i "s/turn_uris: .*/turn_uris: [\"turn:${APP_DOMAIN}:${TURN_TLS_PORT}?transport=udp\", \"turn:${APP_DOMAIN}:${TURN_TLS_PORT}?transport=tcp\"]/" homeserver.yaml
|
||||||
sed -i "s/turn_shared_secret: .*/turn_shared_secret: \"${TURNPWD}\"/" homeserver.yaml
|
sed -i "s/turn_shared_secret: .*/turn_shared_secret: \"${TURNPWD}\"/" homeserver.yaml
|
||||||
sed -i "s/#cipher-list=.*/cipher-list=\"HIGH\"/" /app/data/turnserver.conf
|
sed -i "s/#cipher-list=.*/cipher-list=\"HIGH\"/" /app/data/turnserver.conf
|
||||||
sed -i "s/#log-file=.*/log-file=\/run\/\/turn_log\/turn.log/" /app/data/turnserver.conf
|
sed -i "s/#log-file=.*/log-file=\/run\/turn_log\/turn.log/" /app/data/turnserver.conf
|
||||||
|
|
||||||
|
|
||||||
# get cert names from synapse
|
# get cert names from synapse
|
||||||
@@ -82,10 +94,10 @@ if [[ ! -d /app/data/synapse ]]; then
|
|||||||
# set up email
|
# set up email
|
||||||
sed -i 's/#email:/email:/' homeserver.yaml
|
sed -i 's/#email:/email:/' homeserver.yaml
|
||||||
sed -i 's/# enable_notifs: false/ enable_notifs: false/' homeserver.yaml
|
sed -i 's/# enable_notifs: false/ enable_notifs: false/' homeserver.yaml
|
||||||
sed -i "s/# smtp_host: "localhost"/ smtp_host: \"${MAIL_SMTP_SERVER}\"/" homeserver.yaml
|
sed -i 's/# smtp_host: \"localhost\"/ smtp_host: \"${MAIL_SMTP_SERVER}\"/' homeserver.yaml
|
||||||
sed -i "s/# smtp_port: 25/ smtp_port: ${MAIL_SMTP_PORT}/" homeserver.yaml
|
sed -i 's/# smtp_port: .*/ smtp_port: ${MAIL_SMTP_PORT}/' homeserver.yaml
|
||||||
sed -i "s/# smtp_user: "exampleusername"/ smtp_user: \"${MAIL_SMTP_USERNAME}\"/" homeserver.yaml
|
sed -i 's/# smtp_user: \"exampleusername\"/ smtp_user: \"${MAIL_SMTP_USERNAME}\"/' homeserver.yaml
|
||||||
sed -i "s/# smtp_pass: "examplepassword"/ smtp_pass: \"${MAIL_SMTP_PASSWORD}\"/" homeserver.yaml
|
sed -i 's/# smtp_pass: \"examplepassword\"/ smtp_pass: \"${MAIL_SMTP_PASSWORD}\"/' homeserver.yaml
|
||||||
sed -i 's/# require_transport_security: False/ require_transport_security: True/' homeserver.yaml
|
sed -i 's/# require_transport_security: False/ require_transport_security: True/' homeserver.yaml
|
||||||
sed -i "s/# notif_from: .*/ notif_from: \"Your Friendly Matrix Home Server <${MAIL_FROM}>\"/" homeserver.yaml
|
sed -i "s/# notif_from: .*/ notif_from: \"Your Friendly Matrix Home Server <${MAIL_FROM}>\"/" homeserver.yaml
|
||||||
sed -i 's/# app_name: Matrix/ app_name: Matrix/' homeserver.yaml
|
sed -i 's/# app_name: Matrix/ app_name: Matrix/' homeserver.yaml
|
||||||
@@ -96,11 +108,6 @@ if [[ ! -d /app/data/synapse ]]; then
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
mkdir -p /run/nginx
|
|
||||||
mkdir -p /run/nginx_log
|
|
||||||
mkdir -p /run/turn_log
|
|
||||||
|
|
||||||
chown -R www-data.www-data /app/data
|
chown -R www-data.www-data /app/data
|
||||||
|
|
||||||
cd /app/data/synapse
|
cd /app/data/synapse
|
||||||
|
|||||||
Reference in New Issue
Block a user