]> cat aescling's git repositories - mastodon.git/commitdiff
Merge `HIDDEN_SERVICE_VIA_TRANSPARENT_PROXY` into `ALLOW_ACCESS_TO_HIDDEN_SERVICE...
authorMIYAGI Hikaru <hcmiya@users.noreply.github.com>
Fri, 29 Jun 2018 13:36:02 +0000 (22:36 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Fri, 29 Jun 2018 13:36:02 +0000 (15:36 +0200)
If Mastodon accesses to the hidden service via transparent proxy, it's needed to avoid checking whether it's a private address, since `.onion` is resolved to a private address.
I was previously using the `HIDDEN_SERVICE_VIA_TRANSPARENT_PROXY` to provide that function. However, I realized that using `HIDDEN_SERVICE_VIA_TRANSPARENT_PROXY` is redundant, since this specification is always used with `ALLOW_ACCESS_TO_HIDDEN_SERVICE`. Therefore, I decided to integrate the setting of `HIDDEN_SERVICE_VIA_TRANSPARENT_PROXY` into` ALLOW_ACCESS_TO_HIDDEN_SERVICE`.

.env.production.sample
app/lib/request.rb
config/initializers/http_client_proxy.rb
docker-compose.yml

index 3047f759501854bd0c7025de39de425f49fad953..ebb0788781d59a7dc0705cbdf298359eee60e282 100644 (file)
@@ -229,5 +229,3 @@ STREAMING_CLUSTER_NUM=1
 # http_proxy=http://gateway.local:8118
 # Access control for hidden service.
 # ALLOW_ACCESS_TO_HIDDEN_SERVICE=true
-# If you use transparent proxy to access to hidden service, uncomment following for skipping private address check.
-# HIDDEN_SERVICE_VIA_TRANSPARENT_PROXY=true
index 397614fac9d48766f77e76a5f63860040ec0bb8a..576ed23ca0c21561c81147f642523e74dba1805b 100644 (file)
@@ -154,7 +154,7 @@ class Request
       alias new open
 
       def thru_hidden_service?(host)
-        Rails.configuration.x.hidden_service_via_transparent_proxy && /\.(onion|i2p)$/.match(host)
+        Rails.configuration.x.access_to_hidden_service && /\.(onion|i2p)$/.match(host)
       end
     end
   end
index 52c595c5d96dabd2ce26950c9d48cf6c7f844217..e607aff3c406addd93413f8954d95defc4c52cb6 100644 (file)
@@ -11,7 +11,6 @@ Rails.application.configure do
   end
 
   config.x.access_to_hidden_service = ENV['ALLOW_ACCESS_TO_HIDDEN_SERVICE'] == 'true'
-  config.x.hidden_service_via_transparent_proxy = ENV['HIDDEN_SERVICE_VIA_TRANSPARENT_PROXY'] == 'true'
 end
 
 module Goldfinger
index b31095a54074b202bb1aa47f32c6f986d1fbf8f1..c54c73e44a064cfddb0ac82b7024ed00a44a75c2 100644 (file)
@@ -83,7 +83,6 @@ services:
 ## Uncomment to enable federation with tor instances along with adding the following ENV variables
 ## http_proxy=http://privoxy:8118
 ## ALLOW_ACCESS_TO_HIDDEN_SERVICE=true
-## HIDDEN_SERVICE_VIA_TRANSPARENT_PROXY=true
 #  tor:
 #    build: https://github.com/usbsnowcrash/docker-tor.git
 #    networks: