Add default value for 'DATABASE' env var
This commit is contained in:
parent
c5b4499b79
commit
d5d8c41a17
|
@ -7,7 +7,6 @@ services:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
ALLOWED_ROOMS:
|
ALLOWED_ROOMS:
|
||||||
DATABASE: /data/db.sqlite3
|
|
||||||
DEVICE_NAME: $HOSTNAME
|
DEVICE_NAME: $HOSTNAME
|
||||||
HOMESERVER: 'https://matrix.org'
|
HOMESERVER: 'https://matrix.org'
|
||||||
PASSWORD:
|
PASSWORD:
|
||||||
|
|
|
@ -20,7 +20,6 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
func FromEnv() Config {
|
func FromEnv() Config {
|
||||||
db := requireEnv("DATABASE")
|
|
||||||
deviceName := requireEnv("DEVICE_NAME")
|
deviceName := requireEnv("DEVICE_NAME")
|
||||||
homeserver := requireEnv("HOMESERVER")
|
homeserver := requireEnv("HOMESERVER")
|
||||||
userId := requireEnv("USER_ID")
|
userId := requireEnv("USER_ID")
|
||||||
|
@ -29,6 +28,11 @@ func FromEnv() Config {
|
||||||
|
|
||||||
allowedRooms := os.Getenv("ALLOWED_ROOMS")
|
allowedRooms := os.Getenv("ALLOWED_ROOMS")
|
||||||
|
|
||||||
|
db := os.Getenv("DATABASE")
|
||||||
|
if db == "" {
|
||||||
|
db = "/data/db.sqlite3"
|
||||||
|
}
|
||||||
|
|
||||||
greeting := os.Getenv("GREETING")
|
greeting := os.Getenv("GREETING")
|
||||||
if greeting == "" {
|
if greeting == "" {
|
||||||
greeting = defaultGreeting
|
greeting = defaultGreeting
|
||||||
|
|
Loading…
Reference in New Issue