Explorar el Código

Update matrix certs

Bob Mottram hace 8 años
padre
commit
6ea77bde31
Se han modificado 2 ficheros con 19 adiciones y 0 borrados
  1. 5
    0
      src/freedombone-app-matrix
  2. 14
    0
      src/freedombone-utils-web

+ 5
- 0
src/freedombone-app-matrix Ver fichero

81
         }' "${filepath}" > "${ymltemp}"
81
         }' "${filepath}" > "${ymltemp}"
82
 
82
 
83
     mv ${ymltemp} "${filepath}"
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
 function matrix_diff {
91
 function matrix_diff {

+ 14
- 0
src/freedombone-utils-web Ver fichero

732
             systemctl reload prosody
732
             systemctl reload prosody
733
         fi
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
         if [ -d /var/lib/mumble-server ]; then
749
         if [ -d /var/lib/mumble-server ]; then
736
             if [[ "$(cert_exists ${DEFAULT_DOMAIN_NAME} pem)" == "1" ]]; then
750
             if [[ "$(cert_exists ${DEFAULT_DOMAIN_NAME} pem)" == "1" ]]; then
737
                 cp /etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.pem /var/lib/mumble-server/mumble.pem
751
                 cp /etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.pem /var/lib/mumble-server/mumble.pem