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

20 lines
439 B
Bash
Raw Normal View History

2021-01-27 17:13:48 +00:00
#!/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