Merge pull request #13 from bivis/develop

Develop
This commit is contained in:
bivis
2023-02-07 12:32:04 +03:00
committed by GitHub
4 changed files with 9 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
DB_NAME="@lcDbName@"
DB_HOST="@lcDbHost@"
DB_USERNAME="@lcDbUsername@"
DB_PASSWORD="@lcDbPassword@"
API_URL="@lcApiUrl@"
API_KEY="@lcApiKey@"

View File

@@ -12,6 +12,8 @@
description="Replace placeholders in config files" >
<replace file="../.env.sample" token="@lcDbName@" value="${lcDbName}"/>
<replace file="../.env.sample" token="@lcDbHost@" value="${lcDbHost}"/>
<replace file="../.env.sample" token="@lcDbUsername@" value="${lcDbUsername}"/>
<replace file="../.env.sample" token="@lcDbPassword@" value="${lcDbPassword}"/>
<replace file="../.env.sample" token="@lcApiUrl@" value="${lcApiUrl}"/>
<replace file="../.env.sample" token="@lcApiKey@" value="${lcApiKey}"/>

View File

@@ -12,6 +12,8 @@ class AppConfig:
self.refresh()
connect(
db=CONFIGS['db']['name'],
username=CONFIGS['db']['username'],
password=CONFIGS['db']['password']
host="mongodb://{host}:27017/{database}".format(host=CONFIGS['db']['host'], database=CONFIGS['db']['name'])
)

View File

@@ -3,7 +3,9 @@ import os
CONFIGS = {
'db' : {
'name' : os.environ['DB_NAME'],
'host' : os.environ['DB_HOST']
'host' : os.environ['DB_HOST'],
'username' : os.environ['DB_USERNAME'],
'password' : os.environ['DB_PASSWORD']
},
'application_credentials' : {
'api_url' : os.environ['API_URL'],