Quellcode durchsuchen

Remove individual cert files

Bob Mottram vor 8 Jahren
Ursprung
Commit
1d5edecce3

+ 1
- 0
src/freedombone-app-dokuwiki Datei anzeigen

@@ -173,6 +173,7 @@ function remove_dokuwiki {
173 173
     function_check remove_onion_service
174 174
     remove_onion_service dokuwiki ${DOKUWIKI_ONION_PORT}
175 175
     nginx_dissite $DOKUWIKI_DOMAIN_NAME
176
+    remove_certs $DOKUWIKI_DOMAIN_NAME
176 177
     if [ -f /etc/nginx/sites-available/$DOKUWIKI_DOMAIN_NAME ]; then
177 178
         rm /etc/nginx/sites-available/$DOKUWIKI_DOMAIN_NAME
178 179
     fi

+ 1
- 0
src/freedombone-app-gnusocial Datei anzeigen

@@ -469,6 +469,7 @@ function remove_gnusocial {
469 469
     read_config_param "MY_USERNAME"
470 470
     echo "Removing $GNUSOCIAL_DOMAIN_NAME"
471 471
     nginx_dissite $GNUSOCIAL_DOMAIN_NAME
472
+    remove_certs $GNUSOCIAL_DOMAIN_NAME
472 473
     if [ -d /var/www/$GNUSOCIAL_DOMAIN_NAME ]; then
473 474
         rm -rf /var/www/$GNUSOCIAL_DOMAIN_NAME
474 475
     fi

+ 1
- 0
src/freedombone-app-gogs Datei anzeigen

@@ -337,6 +337,7 @@ function remove_gogs {
337 337
     systemctl stop gogs
338 338
     systemctl disable gogs
339 339
     nginx_dissite ${GIT_DOMAIN_NAME}
340
+    remove_certs ${GIT_DOMAIN_NAME}
340 341
     if [ -d /var/www/${GIT_DOMAIN_NAME} ]; then
341 342
         rm -rf /var/www/${GIT_DOMAIN_NAME}
342 343
     fi

+ 1
- 0
src/freedombone-app-htmly Datei anzeigen

@@ -322,6 +322,7 @@ function remove_htmly {
322 322
 
323 323
     read_config_param "HTMLY_DOMAIN_NAME"
324 324
     nginx_dissite $HTMLY_DOMAIN_NAME
325
+    remove_certs ${HTMLY_DOMAIN_NAME}
325 326
     if [ -f /etc/nginx/sites-available/$HTMLY_DOMAIN_NAME ]; then
326 327
         rm -f /etc/nginx/sites-available/$HTMLY_DOMAIN_NAME
327 328
     fi

+ 1
- 0
src/freedombone-app-hubzilla Datei anzeigen

@@ -279,6 +279,7 @@ function remove_hubzilla {
279 279
         return
280 280
     fi
281 281
     nginx_dissite $HUBZILLA_DOMAIN_NAME
282
+    remove_certs ${HUBZILLA_DOMAIN_NAME}
282 283
     if [ -d /var/www/$HUBZILLA_DOMAIN_NAME ]; then
283 284
         rm -rf /var/www/$HUBZILLA_DOMAIN_NAME
284 285
     fi

+ 1
- 1
src/freedombone-app-mediagoblin Datei anzeigen

@@ -170,7 +170,7 @@ function restore_remote_mediagoblin {
170 170
 }
171 171
 
172 172
 function remove_mediagoblin {
173
-    echo -n ''
173
+    remove_certs ${MEDIAGOBLIN_DOMAIN_NAME}
174 174
 }
175 175
 
176 176
 function install_mediagoblin {

+ 1
- 0
src/freedombone-app-mumble Datei anzeigen

@@ -166,6 +166,7 @@ function remove_mumble {
166 166
     if [ -f /etc/mumble-server.ini ]; then
167 167
         rm /etc/mumble-server.ini
168 168
     fi
169
+    remove_certs mumble
169 170
     function_check remove_onion_service
170 171
     remove_onion_service mumble ${MUMBLE_PORT}
171 172
     sed -i '/mumble/d' $COMPLETION_FILE

+ 1
- 0
src/freedombone-app-pelican Datei anzeigen

@@ -82,6 +82,7 @@ function remove_pelican {
82 82
         rm -rf /var/www/$STATIC_BLOG_DOMAIN/htdocs
83 83
     fi
84 84
     pip uninstall pelican
85
+    remove_certs $STATIC_BLOG_DOMAIN
85 86
 }
86 87
 
87 88
 function create_pelican_conf {

+ 1
- 0
src/freedombone-app-xmpp Datei anzeigen

@@ -266,6 +266,7 @@ function configure_firewall_for_xmpp {
266 266
 function remove_xmpp_client {
267 267
     apt-get -y remove --purge profanity
268 268
     remove_completion_param install_xmpp_client
269
+    remove_certs xmpp
269 270
 }
270 271
 
271 272
 function remove_xmpp {

+ 24
- 0
src/freedombone-utils-web Datei anzeigen

@@ -567,4 +567,28 @@ function install_web_server {
567 567
     mark_completed $FUNCNAME
568 568
 }
569 569
 
570
+function remove_certs {
571
+    domain_name=$1
572
+
573
+    if [ ! $domain_name ]; then
574
+        return
575
+    fi
576
+
577
+    if [ -f /etc/ssl/certs/${domain_name}.dhparam ]; then
578
+        rm /etc/ssl/certs/${domain_name}.dhparam
579
+    fi
580
+
581
+    if [ -f /etc/ssl/certs/${domain_name}.pem ]; then
582
+        rm /etc/ssl/certs/${domain_name}.pem
583
+    fi
584
+
585
+    if [ -f /etc/ssl/certs/${domain_name}.crt ]; then
586
+        rm /etc/ssl/certs/${domain_name}.crt
587
+    fi
588
+
589
+    if [ -f /etc/ssl/private/${domain_name}.key ]; then
590
+        rm /etc/ssl/private/${domain_name}.key
591
+    fi
592
+}
593
+
570 594
 # NOTE: deliberately no exit 0