From 73397491f5f59cb663a747d1eda91b816fe9a33b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 28 Jul 2017 22:52:38 +0100 Subject: [PATCH] Onion servive for keyserver --- src/freedombone-app-keyserver | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/freedombone-app-keyserver b/src/freedombone-app-keyserver index 6b5c39b5..1bcb381c 100755 --- a/src/freedombone-app-keyserver +++ b/src/freedombone-app-keyserver @@ -141,6 +141,7 @@ function remove_keyserver { remove_config_param KEYSERVER_CODE function_check remove_onion_service remove_onion_service keyserver ${KEYSERVER_ONION_PORT} + remove_onion_service sks 11370 11371 11372 remove_completion_param "install_keyserver" firewall_remove 11370 tcp @@ -287,6 +288,22 @@ function install_keyserver { echo 'max_matches: 500' >> $sksconf_file chown debian-sks: $sksconf_file + if ! grep -q "hidden_service_sks" /etc/tor/torrc; then + echo 'HiddenServiceDir /var/lib/tor/hidden_service_sks/' >> /etc/tor/torrc + echo "HiddenServicePort 11370 127.0.0.1:11370" >> /etc/tor/torrc + echo "HiddenServicePort 11371 127.0.0.1:11371" >> /etc/tor/torrc + echo "HiddenServicePort 11372 127.0.0.1:11372" >> /etc/tor/torrc + echo $'Added onion site for sks' + fi + + onion_update + wait_for_onion_service 'sks' + + if [ ! -f /var/lib/tor/hidden_service_xmpp/hostname ]; then + echo $'xmpp onion site hostname not found' + exit 65349 + fi + KEYSERVER_ONION_HOSTNAME=$(add_onion_service keyserver 80 ${KEYSERVER_ONION_PORT}) keyserver_nginx_site=/etc/nginx/sites-available/$KEYSERVER_DOMAIN_NAME