ソースを参照

Check size of homeserver config

Bob Mottram 8 年 前
コミット
e478d0d0a2
共有1 個のファイルを変更した10 個の追加5 個の削除を含む
  1. 10
    5
      src/freedombone-app-matrix

+ 10
- 5
src/freedombone-app-matrix ファイルの表示

@@ -104,7 +104,7 @@ function matrix_generate {
104 104
         echo "STOP! REPORT_STATS needs to be 'no' or 'yes'" && breakup="1"
105 105
 
106 106
     matrix_generate_synapse_file ${MATRIX_DATA_DIR}/homeserver.tmp
107
-    matrix_configure_homeserver_yaml $turnkey ${MATRIX_DATA_DIR}/homeserver.tmp
107
+    matrix_configure_homeserver_yaml "${turnkey}" ${MATRIX_DATA_DIR}/homeserver.tmp
108 108
 
109 109
     mv ${MATRIX_DATA_DIR}/homeserver.tmp ${MATRIX_DATA_DIR}/homeserver.yaml
110 110
 }
@@ -124,7 +124,7 @@ function add_user_matrix {
124 124
     ${PROJECT_NAME}-pass -u $new_username -a matrix -p "$new_user_password"
125 125
 
126 126
     read_config_param 'MATRIX_SECRET'
127
-    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
127
+    register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml https://localhost:${MATRIX_PORT} -u "${new_username}" -p "${new_user_password}" -a
128 128
     if [ ! "$?" = "0" ]; then
129 129
         echo '1'
130 130
     else
@@ -320,9 +320,6 @@ function install_matrix {
320 320
     groupadd matrix
321 321
     useradd -c "Matrix system account" -d /var/lib/matrix -m -r -g matrix matrix
322 322
 
323
-    chown -R matrix:matrix /etc/matrix
324
-    chown -R matrix:matrix /var/lib/matrix
325
-
326 323
     function_check install_turn
327 324
     install_turn
328 325
     MATRIX_SECRET="${turnkey}"
@@ -330,6 +327,14 @@ function install_matrix {
330 327
     function_check matrix_generate
331 328
     matrix_generate
332 329
 
330
+    if [ -z ${MATRIX_DATA_DIR}/homeserver.yaml ]; then
331
+        echo $'homeserver.yaml is zero size'
332
+        exit 783724
333
+    fi
334
+
335
+    chown -R matrix:matrix /etc/matrix
336
+    chown -R matrix:matrix /var/lib/matrix
337
+
333 338
     echo '[Unit]' > /etc/systemd/system/matrix.service
334 339
     echo 'Description=Matrix federated messaging' >> /etc/systemd/system/matrix.service
335 340
     echo 'After=network.target nginx.target' >> /etc/systemd/system/matrix.service