Check size of homeserver config

This commit is contained in:
Bob Mottram 2016-12-30 17:42:52 +00:00
parent cdf9fb1cf2
commit e478d0d0a2
1 changed files with 10 additions and 5 deletions

View File

@ -104,7 +104,7 @@ function matrix_generate {
echo "STOP! REPORT_STATS needs to be 'no' or 'yes'" && breakup="1" echo "STOP! REPORT_STATS needs to be 'no' or 'yes'" && breakup="1"
matrix_generate_synapse_file ${MATRIX_DATA_DIR}/homeserver.tmp matrix_generate_synapse_file ${MATRIX_DATA_DIR}/homeserver.tmp
matrix_configure_homeserver_yaml $turnkey ${MATRIX_DATA_DIR}/homeserver.tmp matrix_configure_homeserver_yaml "${turnkey}" ${MATRIX_DATA_DIR}/homeserver.tmp
mv ${MATRIX_DATA_DIR}/homeserver.tmp ${MATRIX_DATA_DIR}/homeserver.yaml mv ${MATRIX_DATA_DIR}/homeserver.tmp ${MATRIX_DATA_DIR}/homeserver.yaml
} }
@ -124,7 +124,7 @@ function add_user_matrix {
${PROJECT_NAME}-pass -u $new_username -a matrix -p "$new_user_password" ${PROJECT_NAME}-pass -u $new_username -a matrix -p "$new_user_password"
read_config_param 'MATRIX_SECRET' read_config_param 'MATRIX_SECRET'
register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml https://localhost:${MATRIX_PORT} -u "${new_username}" -p "${new_user_password}" -k "${MATRIX_SECRET}" -a register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml https://localhost:${MATRIX_PORT} -u "${new_username}" -p "${new_user_password}" -a
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
echo '1' echo '1'
else else
@ -320,9 +320,6 @@ function install_matrix {
groupadd matrix groupadd matrix
useradd -c "Matrix system account" -d /var/lib/matrix -m -r -g matrix matrix useradd -c "Matrix system account" -d /var/lib/matrix -m -r -g matrix matrix
chown -R matrix:matrix /etc/matrix
chown -R matrix:matrix /var/lib/matrix
function_check install_turn function_check install_turn
install_turn install_turn
MATRIX_SECRET="${turnkey}" MATRIX_SECRET="${turnkey}"
@ -330,6 +327,14 @@ function install_matrix {
function_check matrix_generate function_check matrix_generate
matrix_generate matrix_generate
if [ -z ${MATRIX_DATA_DIR}/homeserver.yaml ]; then
echo $'homeserver.yaml is zero size'
exit 783724
fi
chown -R matrix:matrix /etc/matrix
chown -R matrix:matrix /var/lib/matrix
echo '[Unit]' > /etc/systemd/system/matrix.service echo '[Unit]' > /etc/systemd/system/matrix.service
echo 'Description=Matrix federated messaging' >> /etc/systemd/system/matrix.service echo 'Description=Matrix federated messaging' >> /etc/systemd/system/matrix.service
echo 'After=network.target nginx.target' >> /etc/systemd/system/matrix.service echo 'After=network.target nginx.target' >> /etc/systemd/system/matrix.service