From 040db58672d71e6f16c3898b1459cfd74a694f73 Mon Sep 17 00:00:00 2001 From: Carl Pearson Date: Thu, 5 Dec 2024 06:04:29 -0700 Subject: [PATCH] Respect YTDLP_SITE_CONFIG_DIR --- README.md | 4 ++-- config/config.go | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d127c63..9e0ecd4 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ docker run --rm -it \ docker run --rm -it \ -p 3000:8080 \ --env YTDLP_SITE_DATA_DIR=/data \ - --env YTDLP_SITE_CONFIG_DIR=/config \ + --env YTDLP_SITE_CONFIG_DIR=/data/config \ --env YTDLP_SITE_ADMIN_INITIAL_PASSWORD=abc123 \ -v $(realpath data):/data \ server @@ -71,4 +71,4 @@ Build and push this container to ghcr - [ ] move original video to bottom - [x] sort videos most to least recent - [x] header on playlist page -- [ ] Choose database directory +- [x] Choose database directory diff --git a/config/config.go b/config/config.go index 3875f3f..3ff4013 100644 --- a/config/config.go +++ b/config/config.go @@ -18,7 +18,12 @@ func GetDataDir() string { return "data" } +// defaults to GetDataDir() / config func GetConfigDir() string { + value, exists := os.LookupEnv("YTDLP_SITE_CONFIG_DIR") + if exists { + return value + } return filepath.Join(GetDataDir(), "config") }