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 d882277df7
All checks were successful
continuous-integration/drone/push Build is passing
updated README.md and entrypoint.sh
2021-01-27 23:32:19 +01:00

23 lines
478 B
Bash

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