Skip to content
Snippets Groups Projects
Commit 980dcf01 authored by Bob Mottram's avatar Bob Mottram
Browse files

Create a tor onion service for mesh peers if they are connected via ethernet

parent 7e23ab7b
No related branches found
No related tags found
No related merge requests found
......@@ -990,6 +990,11 @@ if [ -f $MESH_INSTALL_SETUP ]; then
rm -rf /etc/openvpn/easy-rsa/keys/*
fi
# Remove hidden service
if [ -d /var/lib/tor/hidden_service_mesh ]; then
rm -rf /var/lib/tor/hidden_service_mesh
fi
# Remove any existing vpn client keys
if [ -f /home/$MY_USERNAME/vpn.tar.gz ]; then
rm /home/$MY_USERNAME/vpn.tar.gz
......
......@@ -416,6 +416,30 @@ function start {
fi
fi
# if we have an ethernet connection to an internet router then create
# an onion address for this peer
if [[ "$ethernet_connected" != "0" ]]; then
systemctl enable tor
systemctl start tor
HIDDEN_SERVICE_PATH=/var/lib/tor/hidden_service_
if [ ! -f ${HIDDEN_SERVICE_PATH}mesh/hostname ]; then
echo "HiddenServiceDir ${HIDDEN_SERVICE_PATH}mesh/" >> /etc/tor/torrc
echo "HiddenServicePort 8008 127.0.0.1:8008" >> /etc/tor/torrc
echo "HiddenServicePort 8010 127.0.0.1:8010" >> /etc/tor/torrc
echo "HiddenServicePort ${TOX_PORT} 127.0.0.1:${TOX_PORT}" >> /etc/tor/torrc
echo "HiddenServicePort ${IPFS_PORT} 127.0.0.1:${IPFS_PORT}" >> /etc/tor/torrc
echo "HiddenServicePort ${ZERONET_PORT} 127.0.0.1:${ZERONET_PORT}" >> /etc/tor/torrc
echo "HiddenServicePort 5353 127.0.0.1:5353" >> /etc/tor/torrc
echo "HiddenServicePort 5354 127.0.0.1:5354" >> /etc/tor/torrc
echo "HiddenServicePort 548 127.0.0.1:548" >> /etc/tor/torrc
echo "HiddenServiceAuthorizeClient stealth mesh" >> /etc/tor/torrc
systemctl restart tor
fi
else
systemctl stop tor
systemctl disable tor
fi
verify
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment