Respect YTDLP_SITE_CONFIG_DIR

This commit is contained in:
Carl Pearson
2024-12-05 06:04:29 -07:00
parent 55930d9460
commit 040db58672
2 changed files with 7 additions and 2 deletions

View File

@@ -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

View File

@@ -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")
}