File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ maria_db = {
3939app = {
4040 "DB_HOST" : "mariadb-app" ,
4141 "DB_PORT" : "3306" ,
42- "DB_USER " : MARIADB_USER ,
43- "DB_PASS " : MARIADB_PASSWORD ,
42+ "DB_USERNAME " : MARIADB_USER ,
43+ "DB_PASSWORD " : MARIADB_PASSWORD ,
4444 "DB_DATABASE" : MARIADB_DATABASE ,
4545 "APP_KEY" : generate_random_password (64 ),
4646}
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+
3+ #
4+ # Copyright (C) 2022 Nethesis S.r.l.
5+ # SPDX-License-Identifier: GPL-3.0-or-later
6+ #
7+
8+ import os
9+ import agent
10+
11+ if os .path .exists ("app-db.env" ):
12+ dt = agent .read_envfile ("app-db.env" )
13+ if "DB_USERNAME" not in dt and "DB_USER" in dt :
14+ dt ["DB_USERNAME" ] = dt .pop ("DB_USER" )
15+ if "DB_PASSWORD" not in dt and "DB_PASS" in dt :
16+ dt ["DB_PASSWORD" ] = dt .pop ("DB_PASS" )
17+ agent .write_envfile ("app-db.env" , dt )
You can’t perform that action at this time.
0 commit comments