Add file-based startup config & temp dir option

Added support for configuring all major Jellyfin paths (data, config, cache, log, temp, web) via a `startup.json` file, with priority after CLI and environment variables. Introduced a new `TempDir` option, configurable through CLI, env var, or config file, with backward-compatible defaults. Refactored path resolution logic to integrate file-based config and ensure directory creation. Updated constructors and CLI options to support temp directory. Improved EF Core migration error handling and logging. Added comprehensive documentation and example config files. All changes are backward compatible.
This commit is contained in:
2026-02-25 15:18:23 -05:00
parent dad5cbadf5
commit c38adfc0f7
15 changed files with 1764 additions and 22 deletions
+67
View File
@@ -0,0 +1,67 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Jellyfin Startup Configuration",
"description": "Configuration file for Jellyfin startup paths. Copy this file to 'startup.json' and customize the paths for your installation.",
"Paths": {
"DataDir": null,
"ConfigDir": null,
"CacheDir": null,
"LogDir": null,
"TempDir": null,
"WebDir": null
},
"$comment": "Example configurations below - remove this section when using",
"LinuxExample": {
"Paths": {
"DataDir": "/var/lib/jellyfin",
"ConfigDir": "/etc/jellyfin",
"CacheDir": "/var/cache/jellyfin",
"LogDir": "/var/log/jellyfin",
"TempDir": "/var/tmp/jellyfin",
"WebDir": "/usr/share/jellyfin/web"
}
},
"WindowsExample": {
"Paths": {
"DataDir": "C:\\ProgramData\\Jellyfin\\data",
"ConfigDir": "C:\\ProgramData\\Jellyfin\\config",
"CacheDir": "D:\\Cache\\Jellyfin",
"LogDir": "C:\\ProgramData\\Jellyfin\\logs",
"TempDir": "D:\\Temp\\Jellyfin",
"WebDir": "C:\\Program Files\\Jellyfin\\web"
}
},
"PortableExample": {
"Paths": {
"DataDir": "./data",
"ConfigDir": "./config",
"CacheDir": "./cache",
"LogDir": "./logs",
"TempDir": "./temp",
"WebDir": "./web"
}
},
"Notes": {
"priority": "Command-line options > Environment variables > This file > Defaults",
"optional": "All path properties are optional - omit or set to null to use defaults",
"locations": [
"./startup.json (current directory)",
"{AppDir}/startup.json",
"{AppDir}/config/startup.json"
],
"equivalents": {
"DataDir": "--datadir or JELLYFIN_DATA_DIR",
"ConfigDir": "--configdir or JELLYFIN_CONFIG_DIR",
"CacheDir": "--cachedir or JELLYFIN_CACHE_DIR",
"LogDir": "--logdir or JELLYFIN_LOG_DIR",
"TempDir": "--tempdir or JELLYFIN_TEMP_DIR",
"WebDir": "--webdir or JELLYFIN_WEB_DIR"
}
}
}