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