瀏覽代碼

Update matrix certs

Bob Mottram 8 年之前
父節點
當前提交
6ea77bde31
共有 2 個檔案被更改,包括 19 行新增0 行删除
  1. 5
    0
      src/freedombone-app-matrix
  2. 14
    0
      src/freedombone-utils-web

+ 5
- 0
src/freedombone-app-matrix 查看文件

@@ -81,6 +81,11 @@ function matrix_configure_homeserver_yaml {
81 81
         }' "${filepath}" > "${ymltemp}"
82 82
 
83 83
     mv ${ymltemp} "${filepath}"
84
+
85
+    if [[ $ONION_ONLY != 'no' ]]; then
86
+        sed -i 's|no_tls: .*|no_tls: True|g' "${filepath}"
87
+    fi
88
+    sed -i 's|enable_registration_captcha.*|enable_registration_captcha: False|g' "${filepath}"
84 89
 }
85 90
 
86 91
 function matrix_diff {

+ 14
- 0
src/freedombone-utils-web 查看文件

@@ -732,6 +732,20 @@ function update_default_domain {
732 732
             systemctl reload prosody
733 733
         fi
734 734
 
735
+        if [ -d /var/lib/matrix ]; then
736
+            if [ -f /etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.pem ]; then
737
+                cp /etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.pem /var/lib/matrix/${DEFAULT_DOMAIN_NAME}.tls.crt
738
+                cp /etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.dhparam /var/lib/matrix/${DEFAULT_DOMAIN_NAME}.tls.dh
739
+                cp /etc/ssl/private/${DEFAULT_DOMAIN_NAME}.key /var/lib/matrix/${DEFAULT_DOMAIN_NAME}.tls.key
740
+                chown -R matrix:matrix /var/lib/matrix
741
+                chmod -R 700 /var/lib/matrix/*.pem
742
+                chmod -R 700 /var/lib/matrix/*.key
743
+                chmod -R 700 /var/lib/matrix/*.dhparam
744
+                systemctl restart turn
745
+                systemctl restart matrix
746
+            fi
747
+        fi
748
+
735 749
         if [ -d /var/lib/mumble-server ]; then
736 750
             if [[ "$(cert_exists ${DEFAULT_DOMAIN_NAME} pem)" == "1" ]]; then
737 751
                 cp /etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.pem /var/lib/mumble-server/mumble.pem