This repository has been archived on 2021-09-23. You can view files and clone it, but cannot push or open issues or pull requests.
hidden-service/entrypoint.sh
samuel-p 4646bee397
All checks were successful
continuous-integration/drone/push Build is passing
added first files
2021-01-27 18:13:48 +01:00

19 lines
439 B
Bash

#!/bin/bash
echo '[+] Starting tor'
cat > /etc/tor/torrc << EOF
DataDirectory /tmp/tor
HiddenServiceDir /web/
Log notice stdout
EOF
if [[ -n "${PRIVATE_KEY}" && -n "${REDIRECT}" ]]; then
echo "[+] Starting the listener at port ${LISTEN_PORT:-80}, redirecting to ${REDIRECT}"
echo "${PRIVATE_KEY}" > /web/private_key
cat >> /etc/tor/torrc << EOF
HiddenServicePort ${LISTEN_PORT:-80} ${REDIRECT}
EOF
fi
tor -f /etc/tor/torrc