Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1963cb0f authored by Nicolas Gelot's avatar Nicolas Gelot
Browse files

Expose proxy settings as env. variables

On dev mode we dont want use tor as proxy by default. With
env. variables these settings are only available on prod.
parent c7083bb3
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,8 @@ services:
      SEARX_SECRET: ":@)%NN0+OqNdy:{prWQlZ{p9|oO9p-UyJq@%V!~G:arrSx6fXz.{jd%=XF44ncj"
      SEARX_SECRET: ":@)%NN0+OqNdy:{prWQlZ{p9|oO9p-UyJq@%V!~G:arrSx6fXz.{jd%=XF44ncj"
      SEARX_MORTY_URL: "${SPOT_MORTY_URL}"
      SEARX_MORTY_URL: "${SPOT_MORTY_URL}"
      SEARX_MORTY_KEY: "${SEARX_MORTY_KEY:-KHN0ZGluKT0gNWNmNzQ0Y2JlNjI4MDRjODAwZGUyMGY5ZjZlZTFmZWI1NTg2YTg5OAo=}"
      SEARX_MORTY_KEY: "${SEARX_MORTY_KEY:-KHN0ZGluKT0gNWNmNzQ0Y2JlNjI4MDRjODAwZGUyMGY5ZjZlZTFmZWI1NTg2YTg5OAo=}"
      SEARX_PROXY_HTTP: "socks5://tor:9050"
      SEARX_PROXY_HTTPS: "socks5://tor:9050"
      GUNICORN_LOGGER: 1
      GUNICORN_LOGGER: 1
      GUNICORN_LEVEL: INFO
      GUNICORN_LEVEL: INFO


+4 −0
Original line number Original line Diff line number Diff line
@@ -104,3 +104,7 @@ if 'SEARX_MORTY_URL' in environ:
    settings.setdefault('result_proxy', {})['url'] = environ['SEARX_MORTY_URL']
    settings.setdefault('result_proxy', {})['url'] = environ['SEARX_MORTY_URL']
if 'SEARX_MORTY_KEY' in environ:
if 'SEARX_MORTY_KEY' in environ:
    settings.setdefault('result_proxy', {})['key'] = bytes(environ['SEARX_MORTY_KEY'], 'utf-8')
    settings.setdefault('result_proxy', {})['key'] = bytes(environ['SEARX_MORTY_KEY'], 'utf-8')
if 'SEARX_PROXY_HTTP' in environ:
    settings['outgoing'].setdefault('proxies', {})['http'] = environ['SEARX_PROXY_HTTP']
if 'SEARX_PROXY_HTTPS' in environ:
    settings['outgoing'].setdefault('proxies', {})['https'] = environ['SEARX_PROXY_HTTPS']
+3 −3
Original line number Original line Diff line number Diff line
@@ -41,9 +41,9 @@ outgoing: # communication with search engines
# uncomment below section if you want to use a proxy
# uncomment below section if you want to use a proxy
# see http://docs.python-requests.org/en/latest/user/advanced/#proxies
# see http://docs.python-requests.org/en/latest/user/advanced/#proxies
# SOCKS proxies are also supported: see http://docs.python-requests.org/en/master/user/advanced/#socks
# SOCKS proxies are also supported: see http://docs.python-requests.org/en/master/user/advanced/#socks
    proxies:
#    proxies :
      http: socks5://tor:9050
#        http : http://127.0.0.1:8080
      https:  socks5://tor:9050
#        https: http://127.0.0.1:8080
# uncomment below section only if you have more than one network interface
# uncomment below section only if you have more than one network interface
# which can be the source of outgoing search requests
# which can be the source of outgoing search requests
#    source_ips:
#    source_ips: