Browse Source

Onion support in for app removals

Bob Mottram 8 years ago
parent
commit
6c59300271

+ 2
- 0
src/freedombone-app-blog View File

@@ -53,6 +53,8 @@ function remove_blog {
53 53
 			sed -i "/$FULLBLOG_CODE/d" /usr/bin/dynamicdns
54 54
 		fi
55 55
 	fi
56
+	function_check remove_onion_service
57
+	remove_onion_service blog ${FULLBLOG_ONION_PORT}
56 58
 	sed -i '/install_blog/d' $COMPLETION_FILE
57 59
 	sed -i '/Blog .*/d' $COMPLETION_FILE
58 60
 }

+ 2
- 0
src/freedombone-app-gnusocial View File

@@ -60,6 +60,8 @@ function remove_gnu_social {
60 60
 	fi
61 61
 	function_check drop_database
62 62
 	drop_database gnusocial
63
+	function_check remove_onion_service
64
+	remove_onion_service microblog ${MICROBLOG_ONION_PORT}
63 65
 	sed -i '/install_gnu_social/d' $COMPLETION_FILE
64 66
 	sed -i '/GNU Social /d' $COMPLETION_FILE
65 67
 }

+ 1
- 0
src/freedombone-app-gogs View File

@@ -55,6 +55,7 @@ function remove_gogs {
55 55
 	drop_database gogs
56 56
 	rm /etc/systemd/system/gogs.service
57 57
 	rm -rf $GOPATH/src/github.com/gogits
58
+	remove_onion_service gogs ${GIT_ONION_PORT} 9418
58 59
 	sed -i '/install_gogs/d' $COMPLETION_FILE
59 60
 	sed -i '/Gogs /d' $COMPLETION_FILE
60 61
 }

+ 2
- 0
src/freedombone-app-hubzilla View File

@@ -51,6 +51,8 @@ function remove_hubzilla {
51 51
 	fi
52 52
 	function_check drop_database
53 53
 	drop_database hubzilla
54
+	function_check remove_onion_service
55
+	remove_onion_service hubzilla ${HUBZILLA_ONION_PORT}
54 56
 	sed -i '/install_hubzilla/d' $COMPLETION_FILE
55 57
 	sed -i '/Hubzilla /d' $COMPLETION_FILE
56 58
 }

+ 1
- 0
src/freedombone-app-irc View File

@@ -47,6 +47,7 @@ function remove_irc_server {
47 47
 	iptables -D INPUT -p tcp --dport 1024:65535 --sport $IRC_PORT -j ACCEPT
48 48
 	function_check save_firewall_settings
49 49
 	save_firewall_settings
50
+	remove_onion_service irc ${IRC_ONION_PORT}
50 51
 	sed -i '/install_irc_server/d' $COMPLETION_FILE
51 52
 	sed -i '/IRC /d' $COMPLETION_FILE
52 53
 	sed -i '/configure_firewall_for_irc/d' $COMPLETION_FILE

+ 2
- 0
src/freedombone-app-mumble View File

@@ -51,6 +51,8 @@ function remove_mumble {
51 51
 	if [ -f /etc/mumble-server.ini ]; then
52 52
 		rm /etc/mumble-server.ini
53 53
 	fi
54
+	function_check remove_onion_service
55
+	remove_onion_service voip ${VOIP_PORT}
54 56
 	sed -i '/install_mumble/d' $COMPLETION_FILE
55 57
 	sed -i '/install_voip/d' $COMPLETION_FILE
56 58
 	sed -i '/configure_firewall_for_voip/d' $COMPLETION_FILE

+ 2
- 0
src/freedombone-app-rss View File

@@ -45,6 +45,8 @@ function remove_rss_reader {
45 45
 		return
46 46
 	fi
47 47
 	nginx_dissite $RSS_READER_DOMAIN_NAME
48
+	function_check remove_onion_service
49
+	remove_onion_service ttrss ${RSS_READER_ONION_PORT} ${RSS_MOBILE_READER_ONION_PORT}
48 50
 	if [ -f /etc/nginx/sites-available/$RSS_READER_DOMAIN_NAME ]; then
49 51
 		rm /etc/nginx/sites-available/$RSS_READER_DOMAIN_NAME
50 52
 	fi

+ 9
- 0
src/freedombone-utils-onion View File

@@ -59,6 +59,15 @@ function remove_onion_service {
59 59
 	onion_service_port_to=$2
60 60
 	sed -i "/hidden_service_${onion_service_name}/d" /etc/tor/torrc
61 61
 	sed -i "/127.0.0.1:${onion_service_port_to}/d" /etc/tor/torrc
62
+	if [ $3 ]; then
63
+		sed -i "/127.0.0.1:${3}/d" /etc/tor/torrc
64
+		if [ $4 ]; then
65
+			sed -i "/127.0.0.1:${4}/d" /etc/tor/torrc
66
+			if [ $5 ]; then
67
+				sed -i "/127.0.0.1:${5}/d" /etc/tor/torrc
68
+			fi
69
+		fi
70
+	fi
62 71
 	systemctl restart tor
63 72
 }
64 73