generated from geniusdynamics/ns8-kickstart-mariadb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from geniusdynamics/dev
Fix db config parameters
- Loading branch information
Showing
2 changed files
with
17 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,24 +18,7 @@ data = json.load(sys.stdin) | |
# we read a json stdin {"vars1":true, "var2":"foo", "vars3": 3} and we writ it to .config/state/environment | ||
# Upper case to set environment variable and minor case to read from stdin | ||
|
||
# Configure database configurations | ||
|
||
MARIADB_DATABASE = data.get("MARIADB_DATABASE","bigcapitalhq") | ||
MARIADB_USER = data.get("MARIADB_USER","bigcapital") | ||
MARIADB_ROOT_PASSWORD = data.get("MARIADB_ROOT_PASSWORD","Bigcapital,1234") | ||
MARIADB_AUTO_UPGRADE = data.get("MARIADB_AUTO_UPGRADE","1") | ||
MARIADB_PASSWORD = data.get("MARIADB_PASSWORD","Bigcapital,1234") | ||
|
||
db_config = { | ||
"MARIADB_DATABASE": MARIADB_DATABASE, | ||
"MARIADB_USER": MARIADB_USER, | ||
"MARIADB_ROOT_PASSWORD": f'{MARIADB_ROOT_PASSWORD}', | ||
"MARIADB_AUTO_UPGRADE": MARIADB_AUTO_UPGRADE, | ||
"MARIADB_PASSWORD": f'{MARIADB_PASSWORD}', | ||
} | ||
agent.write_envfile('database.env', db_config) | ||
|
||
# Configure the application configurations | ||
# Configure email configurations | ||
rdb = agent.redis_connect(use_replica=True) | ||
smtp_settings = agent.get_smarthost_settings(rdb) | ||
|
@@ -58,37 +41,12 @@ email_config = { | |
"MAIL_FROM_ADDRESS": data.get("MAIL_FROM_ADDRESS", f"{smtp_settings['username']}"), | ||
} | ||
agent.write_envfile('email.env', email_config) | ||
# # Database | ||
# - DB_HOST=mysql | ||
# - DB_USER=${DB_USER} | ||
# - DB_PASSWORD=${DB_PASSWORD} | ||
# - DB_CHARSET=${DB_CHARSET} | ||
# # System database | ||
# - SYSTEM_DB_NAME=${SYSTEM_DB_NAME} | ||
# | ||
# # Tenants databases | ||
# - TENANT_DB_NAME_PERFIX=${TENANT_DB_NAME_PERFIX} | ||
# | ||
# # Authentication | ||
# - JWT_SECRET=${JWT_SECRET} | ||
# | ||
# # MongoDB | ||
# - MONGODB_DATABASE_URL=mongodb://mongo/bigcapital | ||
# | ||
database_config = { | ||
"DB_HOST": "mysql", | ||
"DB_USER": MARIADB_USER, | ||
"DB_PASSWORD": f'{MARIADB_PASSWORD}', | ||
"DB_CHARSET": "utf8mb4", | ||
"SYSTEM_DB_NAME": f'{MARIADB_DATABASE}', | ||
"TENANT_DB_NAME_PERFIX": "bigcapital", | ||
"MONGODB_DATABASE_URL": "mongodb://localhost:27017/bigcapital", | ||
} | ||
jwt_secret = secrets.token_hex(32) | ||
|
||
|
||
|
||
HOST = data.get("host", "") | ||
app_config = { | ||
"JWT_SECRET": jwt_secret, | ||
"BASE_URL": HOST, | ||
"BASE_URL": "https://" +HOST, | ||
"NEW_RELIC_APP_NAME":"BIGCAPITALHQ", | ||
"NEW_RELIC_DISTRIBUTED_TRACING_ENABLED": "false", | ||
"NEW_RELIC_LOG": "stdout", | ||
|
@@ -100,7 +58,10 @@ app_config = { | |
"GOTENBERG_DOCS_URL": "http//server:3000/public/", | ||
"ADMIN_EMAIL":"[email protected]", | ||
"ADMIN_PASSWORD":"BigCapital", | ||
**database_config, | ||
"SIGNUP_DISABLED":"false", | ||
"SIGNUP_ALLOWED_DOMAINS":"", | ||
"SIGNUP_ALLOWED_EMAILS":"", | ||
"SIGNUP_EMAIL_CONFIRMATION":"true", | ||
**email_config, | ||
} | ||
agent.write_envfile('app.env', app_config) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters