Skip to content

Instantly share code, notes, and snippets.

@xnyhps
Created July 4, 2014 14:29
Show Gist options
  • Save xnyhps/33f7de50cf91a70acf93 to your computer and use it in GitHub Desktop.
Save xnyhps/33f7de50cf91a70acf93 to your computer and use it in GitHub Desktop.
mod_onions: Install instructions on Debian
# Add the Prosody repository, because we want the latest version
echo deb http://packages.prosody.im/debian $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list
wget https://prosody.im/files/prosody-debian-packages.key -O- | sudo apt-key add -
sudo apt-get update
# Install tor and prosody, and lua-bitop, which is required for mod_onions
sudo apt-get install prosody tor lua-bitop
# Prepare the directories where Tor will store the hidden service's private key
sudo mkdir /var/lib/tor/prosody_hidden_service/
sudo chown debian-tor /var/lib/tor/prosody_hidden_service/
# Configure Tor to make a hidden service
echo "HiddenServiceDir /var/lib/tor/prosody_hidden_service/" | sudo tee -a /etc/tor/torrc
echo "HiddenServicePort 5222 127.0.0.1:5222" | sudo tee -a /etc/tor/torrc
echo "HiddenServicePort 5269 127.0.0.1:5269" | sudo tee -a /etc/tor/torrc
# Let Tor initialize the hidden service
sudo /etc/init.d/tor restart
HOSTNAME=`sudo cat /var/lib/tor/prosody_hidden_service/hostname`
# Grab the latest version of mod_onions
sudo curl -o "/usr/lib/prosody/modules/mod_onions.lua" "https://prosody-modules.googlecode.com/hg/mod_onions/mod_onions.lua"
# Add the new host to Prosody
echo "VirtualHost \"$HOSTNAME\"" | sudo tee -a /etc/prosody/prosody.cfg.lua
echo " modules_enabled = {\"onions\"}" | sudo tee -a /etc/prosody/prosody.cfg.lua
echo " onions_only = true" | sudo tee -a /etc/prosody/prosody.cfg.lua
# Restart Prosody to enable it
sudo /etc/init.d/prosody restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment