Skip to content
Snippets Groups Projects
Commit e478d0d0 authored by Bob Mottram's avatar Bob Mottram
Browse files

Check size of homeserver config

parent cdf9fb1c
No related branches found
No related tags found
No related merge requests found
......@@ -104,7 +104,7 @@ function matrix_generate {
echo "STOP! REPORT_STATS needs to be 'no' or 'yes'" && breakup="1"
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
}
......@@ -124,7 +124,7 @@ function add_user_matrix {
${PROJECT_NAME}-pass -u $new_username -a matrix -p "$new_user_password"
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
echo '1'
else
......@@ -320,9 +320,6 @@ function install_matrix {
groupadd 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
install_turn
MATRIX_SECRET="${turnkey}"
......@@ -330,6 +327,14 @@ function install_matrix {
function_check 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 'Description=Matrix federated messaging' >> /etc/systemd/system/matrix.service
echo 'After=network.target nginx.target' >> /etc/systemd/system/matrix.service
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment