浏览代码

Remove unused files

Bob Mottram 8 年前
父节点
当前提交
cdf9fb1cf2
共有 1 个文件被更改,包括 12 次插入3 次删除
  1. 12
    3
      src/freedombone-app-matrix

+ 12
- 3
src/freedombone-app-matrix 查看文件

@@ -40,10 +40,11 @@ MATRIX_PORT=8448
40 40
 MATRIX_REPO="https://github.com/matrix-org/synapse"
41 41
 MATRIX_COMMIT='f5a4001bb116c468cc5e8e0ae04a1c570e2cb171'
42 42
 REPORT_STATS="no"
43
+MATRIX_SECRET=
43 44
 
44 45
 matrix_variables=(ONION_ONLY
45 46
                   MY_USERNAME
46
-                  MATRIX_PASSWORD
47
+                  MATRIX_SECRET
47 48
                   DEFAULT_DOMAIN_NAME)
48 49
 
49 50
 function matrix_generate_synapse_file {
@@ -122,8 +123,8 @@ function add_user_matrix {
122 123
 
123 124
     ${PROJECT_NAME}-pass -u $new_username -a matrix -p "$new_user_password"
124 125
 
125
-    cd /etc/matrix/scripts
126
-    register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml https://localhost:${MATRIX_PORT} -u "${new_username}" -p "${new_user_password}" -a
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 128
     if [ ! "$?" = "0" ]; then
128 129
         echo '1'
129 130
     else
@@ -324,6 +325,7 @@ function install_matrix {
324 325
 
325 326
     function_check install_turn
326 327
     install_turn
328
+    MATRIX_SECRET="${turnkey}"
327 329
 
328 330
     function_check matrix_generate
329 331
     matrix_generate
@@ -359,6 +361,13 @@ function install_matrix {
359 361
         fi
360 362
     fi
361 363
 
364
+    rm -rf ${MATRIX_DATA_DIR}/Maildir
365
+    rm -rf ${MATRIX_DATA_DIR}/.mutt
366
+    rm -f ${MATRIX_DATA_DIR}/.muttrc
367
+    rm -f ${MATRIX_DATA_DIR}/.mutt-alias
368
+    rm -f ${MATRIX_DATA_DIR}/.procmailrc
369
+    rm -f ${MATRIX_DATA_DIR}/.emacs-mutt
370
+
362 371
     if [[ $(add_user_matrix "${MY_USERNAME}" "${MATRIX_PASSWORD}") != "0" ]]; then
363 372
         echo $'Failed to add matrix admin user';
364 373
         exit 879352