mirror of
https://github.com/umami-software/umami.git
synced 2026-02-20 12:35:38 +01:00
Allow Umami to be configured with UMAMI_DATABASE_URL
This commit is contained in:
parent
bce70c1034
commit
acc3f10284
4 changed files with 10 additions and 7 deletions
|
|
@ -10,7 +10,7 @@ if (process.env.SKIP_DB_CHECK) {
|
|||
process.exit(0);
|
||||
}
|
||||
|
||||
function getDatabaseType(url = process.env.DATABASE_URL) {
|
||||
function getDatabaseType(url = process.env.UMAMI_DATABASE_URL || process.env.DATABASE_URL) {
|
||||
const type = url && url.split(':')[0];
|
||||
|
||||
if (type === 'postgres') {
|
||||
|
|
@ -31,10 +31,10 @@ function error(msg) {
|
|||
}
|
||||
|
||||
async function checkEnv() {
|
||||
if (!process.env.DATABASE_URL) {
|
||||
throw new Error('DATABASE_URL is not defined.');
|
||||
if (!process.env.UMAMI_DATABASE_URL && !process.env.DATABASE_URL) {
|
||||
throw new Error('Neither UMAMI_DATABASE_URL nor DATABASE_URL is defined.');
|
||||
} else {
|
||||
success('DATABASE_URL is defined.');
|
||||
success('Database URL is defined.');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue