mirror of
https://github.com/jc21/nginx-proxy-manager.git
synced 2024-08-30 18:22:48 +00:00
Fix instances where config file exists and env vars don't
This commit is contained in:
parent
657ee73ff1
commit
05a940e732
@ -13,7 +13,6 @@ async function appStart () {
|
|||||||
const internalCertificate = require('./internal/certificate');
|
const internalCertificate = require('./internal/certificate');
|
||||||
const internalIpRanges = require('./internal/ip_ranges');
|
const internalIpRanges = require('./internal/ip_ranges');
|
||||||
|
|
||||||
|
|
||||||
return migrate.latest()
|
return migrate.latest()
|
||||||
.then(setup)
|
.then(setup)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@ -45,11 +44,12 @@ async function appStart () {
|
|||||||
|
|
||||||
async function createDbConfigFromEnvironment() {
|
async function createDbConfigFromEnvironment() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const envMysqlHost = process.env.DB_MYSQL_HOST;
|
const envMysqlHost = process.env.DB_MYSQL_HOST || null;
|
||||||
const envMysqlPort = process.env.DB_MYSQL_PORT;
|
const envMysqlPort = process.env.DB_MYSQL_PORT || null;
|
||||||
const envMysqlUser = process.env.DB_MYSQL_USER;
|
const envMysqlUser = process.env.DB_MYSQL_USER || null;
|
||||||
const envMysqlName = process.env.DB_MYSQL_NAME;
|
const envMysqlName = process.env.DB_MYSQL_NAME || null;
|
||||||
const envSqliteFile = process.env.DB_SQLITE_FILE;
|
const envSqliteFile = process.env.DB_SQLITE_FILE || null;
|
||||||
|
|
||||||
if ((envMysqlHost && envMysqlPort && envMysqlUser && envMysqlName) || envSqliteFile) {
|
if ((envMysqlHost && envMysqlPort && envMysqlUser && envMysqlName) || envSqliteFile) {
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const filename = (process.env.NODE_CONFIG_DIR || './config') + '/' + (process.env.NODE_ENV || 'default') + '.json';
|
const filename = (process.env.NODE_CONFIG_DIR || './config') + '/' + (process.env.NODE_ENV || 'default') + '.json';
|
||||||
@ -119,7 +119,7 @@ async function createDbConfigFromEnvironment(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -130,3 +130,4 @@ try {
|
|||||||
logger.error(err.message, err);
|
logger.error(err.message, err);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user