mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-14 11:26:24 +00:00
Add tor proxy setting to envvars
This commit is contained in:
parent
5d711467e5
commit
5ed4245298
@ -20,6 +20,9 @@ POSTGRES_PASSWORD='example'
|
|||||||
POSTGRES_HOST='127.0.0.1'
|
POSTGRES_HOST='127.0.0.1'
|
||||||
POSTGRES_PORT='5432'
|
POSTGRES_PORT='5432'
|
||||||
|
|
||||||
|
# Tor proxy for remote calls (e.g. fetching prices or sending Telegram messages)
|
||||||
|
TOR_PROXY='127.0.0.1:9050'
|
||||||
|
|
||||||
# Auto unlock LND password. Only used in development docker-compose environment.
|
# Auto unlock LND password. Only used in development docker-compose environment.
|
||||||
# It will fail starting up the node without it.
|
# It will fail starting up the node without it.
|
||||||
# To disable auto unlock, comment out 'wallet-unlock-password-file=/tmp/pwd' from 'docker/lnd/lnd.conf'
|
# To disable auto unlock, comment out 'wallet-unlock-password-file=/tmp/pwd' from 'docker/lnd/lnd.conf'
|
||||||
|
@ -9,11 +9,13 @@ from api.models import Order
|
|||||||
|
|
||||||
logger = logging.getLogger('api.utils')
|
logger = logging.getLogger('api.utils')
|
||||||
|
|
||||||
|
TOR_PROXY = config('TOR_PROXY', default='127.0.0.1:9050')
|
||||||
|
|
||||||
def get_tor_session():
|
def get_tor_session():
|
||||||
session = requests.session()
|
session = requests.session()
|
||||||
# Tor uses the 9050 port as the default socks port
|
# Tor uses the 9050 port as the default socks port
|
||||||
session.proxies = {'http': 'socks5://127.0.0.1:9050',
|
session.proxies = {'http': 'socks5://' + TOR_PROXY,
|
||||||
'https': 'socks5://127.0.0.1:9050'}
|
'https': 'socks5://' + TOR_PROXY}
|
||||||
return session
|
return session
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user