mirror of
http://git.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/nihilist/darknet-lantern.git
synced 2025-05-16 12:16:57 +00:00
issue #36 - env variables: now a default value is set at .env.sample if the user wants to add custom config they can create a .env file
This commit is contained in:
parent
4dd9ed0c80
commit
31037597ad
4 changed files with 16 additions and 4 deletions
3
.env.sample
Normal file
3
.env.sample
Normal file
|
@ -0,0 +1,3 @@
|
|||
TOR_HOST=socks5h://127.0.0.1
|
||||
TOR_PORT=9050
|
||||
WEBSOCKET_PORT=3030
|
|
@ -5,7 +5,10 @@ import json
|
|||
import random
|
||||
import os
|
||||
|
||||
load_dotenv()
|
||||
if os.path.exists('.env'):
|
||||
load_dotenv(".env")
|
||||
else:
|
||||
load_dotenv(".env.sample")
|
||||
|
||||
websocket_port = os.environ.get("WEBSOCKET_PORT")
|
||||
|
||||
|
|
|
@ -9,7 +9,10 @@ import time
|
|||
import urllib
|
||||
import sys
|
||||
|
||||
load_dotenv()
|
||||
if os.path.exists('.env'):
|
||||
load_dotenv(".env")
|
||||
else:
|
||||
load_dotenv(".env.sample")
|
||||
|
||||
tor_host = os.environ.get("TOR_HOST")
|
||||
tor_port = os.environ.get("TOR_PORT")
|
||||
|
@ -1196,4 +1199,4 @@ Maintenance:
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
main()
|
|
@ -7,7 +7,10 @@ import json
|
|||
import pandas as pd
|
||||
import glob
|
||||
|
||||
load_dotenv()
|
||||
if os.path.exists('.env'):
|
||||
load_dotenv(".env")
|
||||
else:
|
||||
load_dotenv(".env.sample")
|
||||
|
||||
tor_host = os.environ.get("TOR_HOST")
|
||||
tor_port = os.environ.get("TOR_PORT")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue