You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
648 B

  1. Rails.application.configure do
  2. config.x.http_client_proxy = {}
  3. if ENV['http_proxy'].present?
  4. proxy = URI.parse(ENV['http_proxy'])
  5. raise "Unsupported proxy type: #{proxy.scheme}" unless %w(http https).include? proxy.scheme
  6. raise "No proxy host" unless proxy.host
  7. host = proxy.host
  8. host = host[1...-1] if host[0] == '[' # for IPv6 address
  9. config.x.http_client_proxy[:proxy] = {
  10. proxy_address: host,
  11. proxy_port: proxy.port,
  12. proxy_username: proxy.user,
  13. proxy_password: proxy.password,
  14. }.compact
  15. end
  16. config.x.access_to_hidden_service = ENV['ALLOW_ACCESS_TO_HIDDEN_SERVICE'] == 'true'
  17. end