aboutsummaryrefslogtreecommitdiffstats
path: root/entrypoint-tor.sh
diff options
context:
space:
mode:
Diffstat (limited to 'entrypoint-tor.sh')
-rw-r--r--entrypoint-tor.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/entrypoint-tor.sh b/entrypoint-tor.sh
new file mode 100644
index 0000000..0aaa030
--- /dev/null
+++ b/entrypoint-tor.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -eu
+
+TORRC="/var/lib/tor/torrc"
+
+# Generate a minimal torrc if none is mounted
+if [ ! -f "$TORRC" ]; then
+ echo "[tor] No torrc found, generating default..."
+ cat > "$TORRC" <<EOF
+SocksPort 0.0.0.0:9050
+DataDirectory /var/lib/tor
+Log notice file /var/log/tor/notices.log
+EOF
+fi
+
+echo "[tor] Starting Tor..."
+exec tor -f "$TORRC"