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:
@@ -25,18 +25,21 @@ namespace Emby.Server.Implementations.AppBase
|
||||
/// <param name="configurationDirectoryPath">The configuration directory path.</param>
|
||||
/// <param name="cacheDirectoryPath">The cache directory path.</param>
|
||||
/// <param name="webDirectoryPath">The web directory path.</param>
|
||||
/// <param name="tempDirectoryPath">The temp directory path.</param>
|
||||
protected BaseApplicationPaths(
|
||||
string programDataPath,
|
||||
string logDirectoryPath,
|
||||
string configurationDirectoryPath,
|
||||
string cacheDirectoryPath,
|
||||
string webDirectoryPath)
|
||||
string webDirectoryPath,
|
||||
string? tempDirectoryPath = null)
|
||||
{
|
||||
ProgramDataPath = programDataPath;
|
||||
LogDirectoryPath = logDirectoryPath;
|
||||
ConfigurationDirectoryPath = configurationDirectoryPath;
|
||||
CachePath = cacheDirectoryPath;
|
||||
WebPath = webDirectoryPath;
|
||||
TempDirectory = tempDirectoryPath ?? Path.Join(Path.GetTempPath(), "jellyfin");
|
||||
DataPath = Directory.CreateDirectory(Path.Combine(ProgramDataPath, "data")).FullName;
|
||||
}
|
||||
|
||||
@@ -77,7 +80,7 @@ namespace Emby.Server.Implementations.AppBase
|
||||
public string CachePath { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string TempDirectory => Path.Join(Path.GetTempPath(), "jellyfin");
|
||||
public string TempDirectory { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public string TrickplayPath => Path.Combine(DataPath, "trickplay");
|
||||
|
||||
Reference in New Issue
Block a user