Official cwtch.im peer and server implementations. https://cwtch.im
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

docker-entrypoint 824B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. set -o errexit
  3. chmod_files() { find $2 -type f -exec chmod -v $1 {} \;
  4. }
  5. chmod_dirs() { find $2 -type d -exec chmod -v $1 {} \;
  6. }
  7. chown ${TOR_USER}:${TOR_USER} /run/tor/
  8. chmod 770 /run/tor
  9. chown -Rv ${TOR_USER}:${TOR_USER} /var/lib/tor
  10. chmod_dirs 700 /var/lib/tor
  11. chmod_files 600 /var/lib/tor
  12. echo -e "\n========================================================"
  13. # Display OS version, Tor version & torrc in log
  14. echo -e "Alpine Version: \c" && cat /etc/alpine-release
  15. tor --version
  16. #cat /etc/tor/torrc
  17. echo -e "========================================================\n"
  18. tor -f /etc/tor/torrc
  19. #Cwtch will crash and burn if 9051 isn't ready
  20. sleep 15
  21. if [ -z "${CWTCH_CONFIG_DIR}" ]; then
  22. CWTCH_CONFIG_DIR=/etc/cwtch/
  23. fi
  24. #Run cwtch (or whatever the user passed)
  25. CWTCH_CONFIG_DIR=$CWTCH_CONFIG_DIR exec "$@"