diff --git a/docker-compose.yml b/docker-compose.yml index 80404ed..d8ce898 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,6 @@ services: restart: unless-stopped environment: ALLOWED_ROOMS: - DATABASE: /data/db.sqlite3 DEVICE_NAME: $HOSTNAME HOMESERVER: 'https://matrix.org' PASSWORD: diff --git a/internal/config/env.go b/internal/config/env.go index 43e2ccf..adb991d 100644 --- a/internal/config/env.go +++ b/internal/config/env.go @@ -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