forked from hellobloom/bloom-vault
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase.ts
26 lines (24 loc) · 980 Bytes
/
database.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import {udefCoalesce} from './src/utils'
import * as fs from 'fs'
const ca = '/run/secrets/pg_ca'
export const production = {
user: udefCoalesce(process.env.POSTGRES_USER, 'postgres'),
password: process.env.POSTGRES_PASSWORD,
host: udefCoalesce(process.env.POSTGRES_HOST, 'productiondb'),
port: udefCoalesce(process.env.POSTGRES_PORT, 5432),
database: udefCoalesce(process.env.POSTGRES_DATABASE, 'postgres'),
ssl: fs.existsSync(ca) ? {ca: fs.readFileSync(ca)} : undefined,
}
export const mocha = {
user: udefCoalesce(process.env.POSTGRES_USER, 'postgres'),
password: process.env.POSTGRES_PASSWORD,
host: 'localhost',
port: 5434,
database: udefCoalesce(process.env.POSTGRES_DATABASE, 'debug'),
}
export const development = {
user: udefCoalesce(process.env.POSTGRES_USER, 'postgres'),
password: process.env.POSTGRES_PASSWORD,
host: udefCoalesce(process.env.POSTGRES_HOST, 'debugdb'),
database: udefCoalesce(process.env.POSTGRES_DATABASE, 'debug'),
}