Merge branch 'dev' into reformat

This commit is contained in:
Erwin de Haan 2019-01-19 14:45:02 +01:00
commit 1e94023927
3 changed files with 146 additions and 126 deletions

View File

@ -15,11 +15,9 @@ insert_final_newline = true
end_of_line = lf end_of_line = lf
max_line_length = null max_line_length = null
# Code files # XML indentation
[*.{cs,csx,vb,vbx}] [*.{csproj,xml}]
indent_size = 4 indent_size = 2
insert_final_newline = true
charset = utf-8
############################### ###############################
# .NET Coding Conventions # # .NET Coding Conventions #
############################### ###############################

View File

@ -26,9 +26,11 @@ COPY --from=builder /jellyfin /jellyfin
COPY --from=ffmpeg /ffmpeg-bin/* /usr/bin/ COPY --from=ffmpeg /ffmpeg-bin/* /usr/bin/
EXPOSE 8096 EXPOSE 8096
VOLUME /config /media VOLUME /config /media
# libfontconfig1 is required for Skia
RUN apt-get update \ RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y \ && apt-get install --no-install-recommends --no-install-suggests -y \
libfontconfig1 # Required for Skia \ libfontconfig1 \
&& apt-get clean autoclean \ && apt-get clean autoclean \
&& apt-get autoremove \ && apt-get autoremove \
&& rm -rf /var/lib/{apt,dpkg,cache,log} && rm -rf /var/lib/{apt,dpkg,cache,log}

View File

@ -45,7 +45,8 @@ namespace Jellyfin.Server
Console.WriteLine(version.ToString()); Console.WriteLine(version.ToString());
} }
ServerApplicationPaths appPaths = createApplicationPaths(options); ServerApplicationPaths appPaths = CreateApplicationPaths(options);
// $JELLYFIN_LOG_DIR needs to be set for the logger configuration manager // $JELLYFIN_LOG_DIR needs to be set for the logger configuration manager
Environment.SetEnvironmentVariable("JELLYFIN_LOG_DIR", appPaths.LogDirectoryPath); Environment.SetEnvironmentVariable("JELLYFIN_LOG_DIR", appPaths.LogDirectoryPath);
await createLogger(appPaths); await createLogger(appPaths);
@ -130,7 +131,7 @@ namespace Jellyfin.Server
} }
} }
private static ServerApplicationPaths createApplicationPaths(StartupOptions options) private static ServerApplicationPaths CreateApplicationPaths(StartupOptions options)
{ {
string programDataPath = Environment.GetEnvironmentVariable("JELLYFIN_DATA_PATH"); string programDataPath = Environment.GetEnvironmentVariable("JELLYFIN_DATA_PATH");
if (string.IsNullOrEmpty(programDataPath)) if (string.IsNullOrEmpty(programDataPath))
@ -155,12 +156,21 @@ namespace Jellyfin.Server
programDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share"); programDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share");
} }
} }
programDataPath = Path.Combine(programDataPath, "jellyfin"); programDataPath = Path.Combine(programDataPath, "jellyfin");
// Ensure the dir exists
Directory.CreateDirectory(programDataPath);
} }
} }
if (string.IsNullOrEmpty(programDataPath))
{
Console.WriteLine("Cannot continue without path to program data folder (try -programdata)");
Environment.Exit(1);
}
else
{
Directory.CreateDirectory(programDataPath);
}
string configDir = Environment.GetEnvironmentVariable("JELLYFIN_CONFIG_DIR"); string configDir = Environment.GetEnvironmentVariable("JELLYFIN_CONFIG_DIR");
if (string.IsNullOrEmpty(configDir)) if (string.IsNullOrEmpty(configDir))
{ {
@ -175,6 +185,11 @@ namespace Jellyfin.Server
} }
} }
if (configDir != null)
{
Directory.CreateDirectory(configDir);
}
string logDir = Environment.GetEnvironmentVariable("JELLYFIN_LOG_DIR"); string logDir = Environment.GetEnvironmentVariable("JELLYFIN_LOG_DIR");
if (string.IsNullOrEmpty(logDir)) if (string.IsNullOrEmpty(logDir))
{ {
@ -189,6 +204,11 @@ namespace Jellyfin.Server
} }
} }
if (logDir != null)
{
Directory.CreateDirectory(logDir);
}
string appPath = AppContext.BaseDirectory; string appPath = AppContext.BaseDirectory;
return new ServerApplicationPaths(programDataPath, appPath, appPath, logDir, configDir); return new ServerApplicationPaths(programDataPath, appPath, appPath, logDir, configDir);