From 95bf8de39abbfd24d6d50f95cd8c366f74d76707 Mon Sep 17 00:00:00 2001 From: Kukks Date: Mon, 2 Sep 2019 14:31:40 +0200 Subject: [PATCH] Add tor relay fragment --- README.md | 3 +++ btcpay-setup.sh | 4 ++++ .../docker-fragments/opt-add-tor-relay.yml | 16 ++++++++++++++++ helpers.sh | 4 +++- 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 docker-compose-generator/docker-fragments/opt-add-tor-relay.yml diff --git a/README.md b/README.md index 617808a..30b89f6 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,8 @@ You can read [the article](https://medium.com/@BtcpayServer/hosting-btcpay-serve * `BTCPAYGEN_DOCKER_IMAGE`: Optional, Specify which generator image to use if you have customized the C# generator. Set to `btcpayserver/docker-compose-generator:local` to build the generator locally at runtime. * `BTCPAY_IMAGE`: Optional, Specify which btcpayserver image to use if you have a customized btcpayserver. * `BTCPAYGEN_EXCLUDE_FRAGMENTS`: Semicolon-separated list of fragments you want to forcefully exclude (eg. `litecoin-clightning`) +* `TOR_RELAY_NICKNAME`: If tor relay is activated with opt-add-tor-relay, the relay nickname +* `TOR_RELAY_EMAIL`: If tor relay is activated with opt-add-tor-relay, the email for Tor to contact you regarding your relay Additionally, there are specific environment variables for some addons: @@ -153,6 +155,7 @@ Available `BTCPAYGEN_ADDITIONAL_FRAGMENTS` currently are: * [opt-add-btctransmuter](docker-compose-generator/docker-fragments/opt-add-btctransmuter.yml), for a self-hosted IFTTT style service for crypto services such as fiat settlement. * [opt-txindex](docker-compose-generator/docker-fragments/opt-txindex.yml), to enable txindex=1 in bitcoin.conf if you require txindexing for Bisq, DOJO, Esplora, etc. * [opt-unsafe-expose](docker-compose-generator/docker-fragments/opt-unsafe-expose.yml), to unsafely expose bitcoind P2P port 8333 if you require P2P for Bisq, DOJO, Esplora, etc. WARNING: ONLY USE ON TRUSTED LAN OR WITH FIREWALL RULES WHITELISTING SPECIFIC HOSTS +* [opt-add-tor-relay,](docker-compose-generator/docker-fragments/opt-add-tor-relay.yml), for a non-exit tor relay You can also create your own [custom fragments](#how-can-i-customize-the-generated-docker-compose-file). diff --git a/btcpay-setup.sh b/btcpay-setup.sh index af3c4f2..d597305 100755 --- a/btcpay-setup.sh +++ b/btcpay-setup.sh @@ -104,6 +104,8 @@ Add-on specific variables: WOOCOMMERCE_HOST: If woocommerce is activated with opt-add-woocommerce, the hostname of your woocommerce website (eg. store.example.com) BTCPAYGEN_EXCLUDE_FRAGMENTS: Semicolon-separated list of fragments you want to forcefully exclude (eg. litecoin-clightning) BTCTRANSMUTER_HOST: If btc transmuter is activated with opt-add-btctransmuter, the hostname of your btc transmuter website (eg. store.example.com) + TOR_RELAY_NICKNAME: If tor relay is activated with opt-add-tor-relay, the relay nickname + TOR_RELAY_EMAIL: If tor relay is activated with opt-add-tor-relay, the email for Tor to contact you regarding your relay END } START="" @@ -301,6 +303,8 @@ BTCPAYGEN_ADDITIONAL_FRAGMENTS:$BTCPAYGEN_ADDITIONAL_FRAGMENTS BTCPAYGEN_EXCLUDE_FRAGMENTS:$BTCPAYGEN_EXCLUDE_FRAGMENTS BTCPAY_IMAGE:$BTCPAY_IMAGE ACME_CA_URI:$ACME_CA_URI +TOR_RELAY_NICKNAME: $TOR_RELAY_NICKNAME +TOR_RELAY_EMAIL: $TOR_RELAY_EMAIL ---------------------- Additional exported variables: BTCPAY_DOCKER_COMPOSE=$BTCPAY_DOCKER_COMPOSE diff --git a/docker-compose-generator/docker-fragments/opt-add-tor-relay.yml b/docker-compose-generator/docker-fragments/opt-add-tor-relay.yml new file mode 100644 index 0000000..e97d9ac --- /dev/null +++ b/docker-compose-generator/docker-fragments/opt-add-tor-relay.yml @@ -0,0 +1,16 @@ +version: "3" +services: + tor-relay: + container_name: tor-relay + image: chriswayg/tor-alpine + restart: unless-stopped + environment: + TOR_NICKNAME: ${TOR_RELAY_NICKNAME} + CONTACT_EMAIL: ${TOR_RELAY_EMAIL} + volumes: + - "relay_tordatadir:/var/lib/tor/" + - "relay_torrc_dir:/etc/tor/" + network_mode: host +volumes: + relay_tordatadir: + relay_torrc_dir: \ No newline at end of file diff --git a/helpers.sh b/helpers.sh index 43a3964..811f10a 100755 --- a/helpers.sh +++ b/helpers.sh @@ -87,7 +87,9 @@ BTCPAY_SSHAUTHORIZEDKEYS=$BTCPAY_SSHAUTHORIZEDKEYS LIBREPATRON_HOST=$LIBREPATRON_HOST BTCTRANSMUTER_HOST=$BTCTRANSMUTER_HOST BTCPAY_CRYPTOS=$BTCPAY_CRYPTOS -WOOCOMMERCE_HOST=$WOOCOMMERCE_HOST" > $BTCPAY_ENV_FILE +WOOCOMMERCE_HOST=$WOOCOMMERCE_HOST +TOR_RELAY_NICKNAME=$TOR_RELAY_NICKNAME +TOR_RELAY_EMAIL=$TOR_RELAY_EMAIL" > $BTCPAY_ENV_FILE } btcpay_up() {