diff --git a/.changeset/tricky-buckets-rush.md b/.changeset/tricky-buckets-rush.md new file mode 100644 index 0000000..5b6118f --- /dev/null +++ b/.changeset/tricky-buckets-rush.md @@ -0,0 +1,5 @@ +--- +"docker-torproxy": patch +--- + +fix: file permissions and default tor user diff --git a/Dockerfile b/Dockerfile index 8239060..c379f3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/internal/tor.sh b/internal/tor.sh index adab869..e1258ce 100644 --- a/internal/tor.sh +++ b/internal/tor.sh @@ -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} @@ -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/