Skip to content

Commit

Permalink
Update .env.example and improve config.py, related to #4
Browse files Browse the repository at this point in the history
  • Loading branch information
eloravpn committed Aug 5, 2023
1 parent 30ccdf6 commit fe7e48a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
25 changes: 23 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# You can override all configs in src/config.py here
SUDO_USERNAME = "admin"
SUDO_PASSWORD = "admin"

UVICORN_HOST = "0.0.0.0"
UVICORN_PORT = 8000
# Unicorn Configurations
#UVICORN_HOST = "0.0.0.0"
UVICORN_PORT = 8000

#DEBUG = True
#DOCS = True

#TELEGRAM_API_TOKEN=YOUR_BOT_TOKEN_HERE
#TELEGRAM_PROXY_URL=http://localhost:1090

#TELEGRAM_ADMIN_ID=23456

# Postgresql configuration example
SQLALCHEMY_DATABASE_URL="postgresql+psycopg2://postgres:123456@localhost:5432/eloravpn"

SUBSCRIPTION_BASE_URL="https://yoursub.domain/api/sub"

AVAILABLE_SERVICES="
1:basic:20:60:https://online.pay/1,
1:standard:50:130:https://online.pay/2,
1:pro:80:190:https://online.pay/3,
"
3 changes: 1 addition & 2 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

load_dotenv()


# Disable IPv6
requests.packages.urllib3.util.connection.HAS_IPV6 = False

Expand Down Expand Up @@ -48,7 +47,7 @@
config("SUDO_USERNAME", default="admin"): config("SUDO_PASSWORD", default="admin")
}

SUBSCRIPTION_BASE_URL = config('SUBSCRIPTION_BASE_URL')
SUBSCRIPTION_BASE_URL = config('SUBSCRIPTION_BASE_URL', default="https://localhost:8000/api/sub")

AVAILABLE_SERVICES = config("AVAILABLE_SERVICES", default='').split(",")

Expand Down

0 comments on commit fe7e48a

Please sign in to comment.