Skip to content

Commit

Permalink
Change in-container Tor UID and GID to 803
Browse files Browse the repository at this point in the history
  • Loading branch information
gbenson committed Jan 1, 2024
1 parent 50684a1 commit 46f44ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ansible/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
uid: 802

p2pool-tor:
uid: 803
volume:
name: p2pool-tor-service
mode: "02700"
Expand Down Expand Up @@ -159,14 +160,15 @@
ansible.builtin.copy:
dest: "{{ (dirname, filename) | path_join }}"
content: "{{ p2pool_tor_service[filename] }}"
owner: 101
group: 103
owner: "{{ service.uid }}"
group: "{{ service.gid | default(service.uid) }}"
mode: "0600"
loop: "{{ p2pool_tor_service | list }}"
loop_control:
loop_var: filename
vars:
dirname: /var/lib/docker/volumes/p2pool-tor-service/_data/hidden_service
service: "{{ services['p2pool-tor'] }}"
become: yes
tags:
- services
Expand Down
7 changes: 7 additions & 0 deletions tor-node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@ RUN set -eux \

FROM base as builder
COPY entrypoint.sh /

ARG m_USER=debian-tor
ARG m_UID=803
ARG m_GID=$m_UID

RUN set -eux \
\
&& groupmod --gid $m_GID $m_USER \
&& usermod --uid $m_UID $m_USER \
&& grep '^ExecStartPre' /lib/systemd/system/[email protected] \
| sed 's/^[^=]*=//' >> /entrypoint.sh \
&& grep '^ExecStart=' /lib/systemd/system/[email protected] \
Expand Down

0 comments on commit 46f44ca

Please sign in to comment.