Unverified Commit 09330e4a authored by Julian Raufelder's avatar Julian Raufelder Committed by GitHub
Browse files

Use environment variables to configure Tor node (#19)



* Use environment variables to configure Tor node

* review: improve env vars and fix tests

Co-authored-by: default avatarTom Moulard <tom.moulard@epita.fr>
parent f09e6354
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -15,6 +15,11 @@ NGINX_IMAGE_VERSION=
ROOT_EMAIL=
SEARX_IMAGE_VERSION=
SITE=
TOR_CONTACT_GPG_FINGERPRINT=
TOR_RELAY_BANDWIDTH_BURST=
TOR_RELAY_BANDWIDTH_RATE=
TOR_RELAY_NICKNAME=
TOR_RELAY_TYPE=
TRAEFIK_CHECK_NEW_VERSION=
TRAEFIK_EXPOSED_BY_DEFAULT=
TRAEFIK_IMAGE_VERSION=
+9 −1
Original line number Diff line number Diff line
@@ -979,7 +979,15 @@ services:
  tor-relay:
    build:
      context: https://github.com/jessfraz/dockerfiles.git#:tor-relay
    command: -f /etc/tor/torrc.middle
    environment:
      CONTACT_EMAIL: changeme@changeme.org
      CONTACT_GPG_FINGERPRINT: ''
      CONTACT_NAME: ''
      RELAY_BANDWIDTH_BURST: 200 KBytes
      RELAY_BANDWIDTH_RATE: 100 KBytes
      RELAY_NICKNAME: hacktheplanet
      RELAY_PORT: '9001'
      RELAY_TYPE: middle
    image: jess/tor-relay
    labels:
      traefik.enable: "false"
+10 −4
Original line number Diff line number Diff line
@@ -7,10 +7,16 @@ services:
  tor-relay:
    image: jess/tor-relay
    build: https://github.com/jessfraz/dockerfiles.git#:tor-relay
    # Choose one of the bellow to set the type of node
    # command: -f /etc/tor/torrc.bridge
    command: -f /etc/tor/torrc.middle
    # command: -f /etc/tor/torrc.exit
    environment:
      # see https://github.com/jessfraz/dockerfiles/tree/master/tor-relay for further information about the values
      - 'RELAY_TYPE=${TOR_RELAY_TYPE:-middle}' # possible values are bridge, middle, or exit
      - 'RELAY_NICKNAME=${TOR_RELAY_NICKNAME:-hacktheplanet}'
      - 'CONTACT_GPG_FINGERPRINT=${TOR_CONTACT_GPG_FINGERPRINT}'
      - 'CONTACT_NAME=${USERNAME}'
      - 'CONTACT_EMAIL=${ROOT_EMAIL:-changeme@changeme.org}'
      - 'RELAY_BANDWIDTH_RATE=${TOR_RELAY_BANDWIDTH_RATE:-100 KBytes}'
      - 'RELAY_BANDWIDTH_BURST=${TOR_RELAY_BANDWIDTH_BURST:-200 KBytes}'
      - 'RELAY_PORT=9001'
    volumes:
      - '/etc/localtime:/etc/localtime'
    networks: