fix tor dir permissions
parent
75bc830def
commit
d61e70e96d
|
@ -1,6 +1,9 @@
|
|||
FROM alpine:3.13
|
||||
|
||||
RUN addgroup --gid 10001 tor && \
|
||||
COPY entrypoint.sh /entrypoint
|
||||
|
||||
RUN chmod +x /entrypoint
|
||||
addgroup --gid 10001 tor && \
|
||||
adduser \
|
||||
--uid 10000 \
|
||||
--home /var/lib/tor \
|
||||
|
@ -8,7 +11,7 @@ RUN addgroup --gid 10001 tor && \
|
|||
--disabled-password \
|
||||
--shell /sbin/nologin \
|
||||
tor && \
|
||||
apk add --no-cache tor
|
||||
apk add --no-cache tor su-exec
|
||||
|
||||
USER tor
|
||||
CMD tor
|
||||
ENTRYPOINT ["/entrypoint"]
|
||||
CMD ["tor"]
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -xe
|
||||
|
||||
if [ -f /etc/tor/torrc ]
|
||||
then
|
||||
awk '{if ($1 == "HiddenServiceDir") print $2}' /etc/tor/torrc | while IFS= read -r dir
|
||||
do
|
||||
mkdir -p "${dir}"
|
||||
chown tor "${dir}"
|
||||
chmod 700 "${dir}"
|
||||
done
|
||||
fi
|
||||
|
||||
su-exec tor "$@"
|
Loading…
Reference in New Issue