| 
				
			 | 
			
			
				@@ -175,19 +175,6 @@ function matrix_nginx { 
			 | 
		
	
		
			
			| 
				175
			 | 
			
				175
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				176
			 | 
			
				176
			 | 
			
			
				     function_check add_ddns_domain 
			 | 
		
	
		
			
			| 
				177
			 | 
			
				177
			 | 
			
			
				     add_ddns_domain $MATRIX_DOMAIN_NAME 
			 | 
		
	
		
			
			| 
				178
			 | 
			
				
			 | 
			
			
				- 
			 | 
		
	
		
			
			| 
				179
			 | 
			
				
			 | 
			
			
				-    if [[ $ONION_ONLY == "no" ]]; then 
			 | 
		
	
		
			
			| 
				180
			 | 
			
				
			 | 
			
			
				-        function_check create_site_certificate 
			 | 
		
	
		
			
			| 
				181
			 | 
			
				
			 | 
			
			
				-        create_site_certificate $MATRIX_DOMAIN_NAME 'yes' 
			 | 
		
	
		
			
			| 
				182
			 | 
			
				
			 | 
			
			
				-        chmod 755 /etc/ssl/certs/${MATRIX_DOMAIN_NAME}.dhparam 
			 | 
		
	
		
			
			| 
				183
			 | 
			
				
			 | 
			
			
				-    fi 
			 | 
		
	
		
			
			| 
				184
			 | 
			
				
			 | 
			
			
				- 
			 | 
		
	
		
			
			| 
				185
			 | 
			
				
			 | 
			
			
				-    systemctl restart nginx 
			 | 
		
	
		
			
			| 
				186
			 | 
			
				
			 | 
			
			
				-    systemctl restart turn 
			 | 
		
	
		
			
			| 
				187
			 | 
			
				
			 | 
			
			
				-    systemctl restart matrix 
			 | 
		
	
		
			
			| 
				188
			 | 
			
				
			 | 
			
			
				- 
			 | 
		
	
		
			
			| 
				189
			 | 
			
				
			 | 
			
			
				-    # wait for nginx to start otherwise user add fails later 
			 | 
		
	
		
			
			| 
				190
			 | 
			
				
			 | 
			
			
				-    sleep 5 
			 | 
		
	
		
			
			| 
				191
			 | 
			
				178
			 | 
			
			
				 } 
			 | 
		
	
		
			
			| 
				192
			 | 
			
				179
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				193
			 | 
			
				180
			 | 
			
			
				 function matrix_generate_homeserver_file { 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -569,7 +556,6 @@ function install_home_server { 
			 | 
		
	
		
			
			| 
				569
			 | 
			
				556
			 | 
			
			
				     echo 'Type=simple' >> /etc/systemd/system/matrix.service 
			 | 
		
	
		
			
			| 
				570
			 | 
			
				557
			 | 
			
			
				     echo 'User=matrix' >> /etc/systemd/system/matrix.service 
			 | 
		
	
		
			
			| 
				571
			 | 
			
				558
			 | 
			
			
				     echo "WorkingDirectory=/etc/matrix" >> /etc/systemd/system/matrix.service 
			 | 
		
	
		
			
			| 
				572
			 | 
			
				
			 | 
			
			
				-    echo "ExecStartPre=/usr/bin/python -m synapse.app.homeserver --config-path ${MATRIX_DATA_DIR}/homeserver.yaml --generate-keys" >> /etc/systemd/system/matrix.service 
			 | 
		
	
		
			
			| 
				573
			 | 
			
				559
			 | 
			
			
				     echo "ExecStart=/usr/bin/python -m synapse.app.homeserver --config-path ${MATRIX_DATA_DIR}/homeserver.yaml" >> /etc/systemd/system/matrix.service 
			 | 
		
	
		
			
			| 
				574
			 | 
			
				560
			 | 
			
			
				     echo 'Restart=on-failure' >> /etc/systemd/system/matrix.service 
			 | 
		
	
		
			
			| 
				575
			 | 
			
				561
			 | 
			
			
				     echo 'RestartSec=10' >> /etc/systemd/system/matrix.service 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -642,16 +628,30 @@ function install_matrix { 
			 | 
		
	
		
			
			| 
				642
			 | 
			
				628
			 | 
			
			
				     pip install --upgrade python-ldap 
			 | 
		
	
		
			
			| 
				643
			 | 
			
				629
			 | 
			
			
				     pip install --upgrade lxml 
			 | 
		
	
		
			
			| 
				644
			 | 
			
				630
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				
			 | 
			
				631
			 | 
			
			
				+    function_check matrix_nginx 
			 | 
		
	
		
			
			| 
				
			 | 
			
				632
			 | 
			
			
				+    matrix_nginx 
			 | 
		
	
		
			
			| 
				
			 | 
			
				633
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				634
			 | 
			
			
				+    function_check create_site_certificate 
			 | 
		
	
		
			
			| 
				
			 | 
			
				635
			 | 
			
			
				+    create_site_certificate $MATRIX_DOMAIN_NAME 'yes' 
			 | 
		
	
		
			
			| 
				
			 | 
			
				636
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				637
			 | 
			
			
				+    if [[ $ONION_ONLY == "no" ]]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				638
			 | 
			
			
				+        chmod 755 /etc/ssl/certs/${MATRIX_DOMAIN_NAME}.dhparam 
			 | 
		
	
		
			
			| 
				
			 | 
			
				639
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				640
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				645
			 | 
			
				641
			 | 
			
			
				     function_check install_home_server 
			 | 
		
	
		
			
			| 
				646
			 | 
			
				642
			 | 
			
			
				     install_home_server 
			 | 
		
	
		
			
			| 
				647
			 | 
			
				643
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				
			 | 
			
				644
			 | 
			
			
				+    systemctl restart nginx 
			 | 
		
	
		
			
			| 
				
			 | 
			
				645
			 | 
			
			
				+    systemctl restart turn 
			 | 
		
	
		
			
			| 
				
			 | 
			
				646
			 | 
			
			
				+    systemctl restart matrix 
			 | 
		
	
		
			
			| 
				
			 | 
			
				647
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				648
			 | 
			
				648
			 | 
			
			
				     function_check update_default_domain 
			 | 
		
	
		
			
			| 
				649
			 | 
			
				649
			 | 
			
			
				     update_default_domain 
			 | 
		
	
		
			
			| 
				650
			 | 
			
				650
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				651
			 | 
			
				
			 | 
			
			
				-    pip install --upgrade --force "pynacl==0.3.0" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				651
			 | 
			
			
				+    # wait for nginx to start otherwise user add fails later 
			 | 
		
	
		
			
			| 
				
			 | 
			
				652
			 | 
			
			
				+    sleep 5 
			 | 
		
	
		
			
			| 
				652
			 | 
			
				653
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				653
			 | 
			
				
			 | 
			
			
				-    function_check matrix_nginx 
			 | 
		
	
		
			
			| 
				654
			 | 
			
				
			 | 
			
			
				-    matrix_nginx 
			 | 
		
	
		
			
			| 
				
			 | 
			
				654
			 | 
			
			
				+    pip install --upgrade --force "pynacl==0.3.0" 
			 | 
		
	
		
			
			| 
				655
			 | 
			
				655
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				656
			 | 
			
				656
			 | 
			
			
				     if [[ $(add_user_matrix "${MY_USERNAME}" "${MATRIX_PASSWORD}" | tail -n 1) != "0" ]]; then 
			 | 
		
	
		
			
			| 
				657
			 | 
			
				657
			 | 
			
			
				         echo $'Failed to add matrix admin user'; 
			 |