Skip to content

Commit

Permalink
fix: file permissions and default tor user
Browse files Browse the repository at this point in the history
  • Loading branch information
shahradelahi committed May 27, 2024
1 parent 5ead86b commit 8993c0f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-buckets-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"docker-torproxy": patch
---

fix: file permissions and default tor user
9 changes: 2 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,12 @@ COPY --from=pluggables /usr/local/bin/meek-client /usr/local/bin/meek-client
COPY --from=pluggables /usr/local/bin/snowflake-client /usr/local/bin/snowflake-client
COPY --from=gost /bin/gost /usr/local/bin/gost

RUN mkdir -p /etc/tor/torrc.d /var/log/gogost

RUN addgroup -S torproxy \
&& adduser -S -G torproxy torproxy \
&& mkdir -p /var/lib/tor \
&& chown -R torproxy:torproxy /var/lib/tor /etc/tor
RUN mkdir -p /etc/tor/torrc.d /var/log/gogost /var/lib/tor /etc/tor

COPY internal /etc/torproxy/internal
COPY scripts/* /usr/local/bin/
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh && chown torproxy:torproxy /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN chmod -R +x /usr/local/bin/

RUN echo '* * * * * /usr/bin/env logrotate /etc/logrotate.d/rotator' >/etc/crontabs/root
Expand Down
7 changes: 3 additions & 4 deletions internal/tor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ ${TOR_LOG_LEVEL:+Log $TOR_LOG_LEVEL}
#RunAsDaemon 1
${TOR_RUN_AS_DAEMON:+RunAsDaemon $TOR_RUN_AS_DAEMON}
User tor
#DataDirectory @LOCALSTATEDIR@/lib/tor
${TOR_DATA_DIRECTORY:+DataDirectory $TOR_DATA_DIRECTORY}
DataDirectory ${TOR_DATA_DIRECTORY:-/var/lib/tor}
#ControlPort 9051
${TOR_CONTROL_PORT:+ControlPort $TOR_CONTROL_PORT}
Expand All @@ -57,9 +59,6 @@ ${TOR_SOCKS5_PROXY:+Socks5Proxy $TOR_SOCKS5_PROXY}
${TOR_SOCKS5_USERNAME:+Socks5Username $TOR_SOCKS5_USERNAME}
${TOR_SOCKS5_PASSWORD:+Socks5Password $TOR_SOCKS5_PASSWORD}
User torproxy
DataDirectory /var/lib/tor
######### Location-hidden Services ##########
#HiddenServiceDir @LOCALSTATEDIR@/lib/tor/hidden_service/
Expand Down

0 comments on commit 8993c0f

Please sign in to comment.