diff options
| -rw-r--r-- | .editorconfig | 133 | ||||
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | Dockerfile | 7 | ||||
| -rw-r--r-- | Emby.Server.Implementations/ApplicationHost.cs | 1 | ||||
| -rw-r--r-- | Jellyfin.Server/Program.cs | 28 | ||||
| -rw-r--r-- | MediaBrowser.Api/NewsService.cs | 46 | ||||
| -rw-r--r-- | MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs | 10 | ||||
| -rw-r--r-- | MediaBrowser.Model/News/INewsService.cs | 17 | ||||
| -rw-r--r-- | MediaBrowser.Model/News/NewsItem.cs | 14 | ||||
| -rw-r--r-- | MediaBrowser.Model/News/NewsQuery.cs | 9 | ||||
| -rw-r--r-- | README.md | 49 | ||||
| -rw-r--r-- | debian/changelog | 23 | ||||
| -rw-r--r-- | debian/conf/jellyfin | 8 | ||||
| -rw-r--r-- | debian/conf/logging.json | 29 | ||||
| -rw-r--r-- | debian/control | 3 | ||||
| -rw-r--r-- | debian/install | 1 | ||||
| -rw-r--r-- | debian/jellyfin.service | 2 | ||||
| -rw-r--r-- | debian/postinst | 29 | ||||
| -rw-r--r-- | debian/postrm | 29 | ||||
| -rw-r--r-- | debian/preinst | 20 | ||||
| -rw-r--r-- | debian/prerm | 12 | ||||
| -rw-r--r-- | debian/source/options | 1 |
22 files changed, 270 insertions, 203 deletions
diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..a3b72c9af --- /dev/null +++ b/.editorconfig @@ -0,0 +1,133 @@ +# With more recent updates Visual Studio 2017 supports EditorConfig files out of the box +# Visual Studio Code needs an extension: https://github.com/editorconfig/editorconfig-vscode +# For emacs, vim, np++ and other editors, see here: https://github.com/editorconfig +############################### +# Core EditorConfig Options # +############################### +# All files +[*] +indent_style = space +root = true +indent_size = 4 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +end_of_line = lf +max_line_length = null + +# Code files +[*.{cs,csx,vb,vbx}] +indent_size = 4 +insert_final_newline = true +charset = utf-8 +############################### +# .NET Coding Conventions # +############################### +[*.{cs,vb}] +# Organize usings +dotnet_sort_system_directives_first = true +# this. preferences +dotnet_style_qualification_for_field = false:silent +dotnet_style_qualification_for_property = false:silent +dotnet_style_qualification_for_method = false:silent +dotnet_style_qualification_for_event = false:silent +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true:silent +dotnet_style_predefined_type_for_member_access = true:silent +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent +dotnet_style_readonly_field = true:suggestion +# Expression-level preferences +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent +dotnet_prefer_inferred_tuple_names = true:suggestion +dotnet_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +############################### +# Naming Conventions # +############################### +# Style Definitions +dotnet_naming_style.pascal_case_style.capitalization = pascal_case +# Use PascalCase for constant fields +dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields +dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style +dotnet_naming_symbols.constant_fields.applicable_kinds = field +dotnet_naming_symbols.constant_fields.applicable_accessibilities = * +dotnet_naming_symbols.constant_fields.required_modifiers = const +############################### +# C# Coding Conventions # +############################### +[*.cs] +# var preferences +csharp_style_var_for_built_in_types = true:silent +csharp_style_var_when_type_is_apparent = true:silent +csharp_style_var_elsewhere = true:silent +# Expression-bodied members +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +# Pattern matching preferences +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +# Null-checking preferences +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion +# Modifier preferences +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion +# Expression-level preferences +csharp_prefer_braces = true:silent +csharp_style_deconstructed_variable_declaration = true:suggestion +csharp_prefer_simple_default_expression = true:suggestion +csharp_style_pattern_local_over_anonymous_function = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +############################### +# C# Formatting Rules # +############################### +# New line preferences +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true +# Indentation preferences +csharp_indent_case_contents = true +csharp_indent_switch_labels = true +csharp_indent_labels = flush_left +# Space preferences +csharp_space_after_cast = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_around_binary_operators = before_and_after +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +# Wrapping preferences +csharp_preserve_single_line_statements = true +csharp_preserve_single_line_blocks = true +############################### +# VB Coding Conventions # +############################### +[*.vb] +# Modifier preferences +visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion diff --git a/.gitignore b/.gitignore index 9bbfd9b74..befba5a20 100644 --- a/.gitignore +++ b/.gitignore @@ -247,6 +247,8 @@ MediaBrowser.WebDashboard/dashboard-ui/.idea/ ######################### debian/.debhelper/ +debian/*.debhelper +debian/debhelper-build-stamp debian/files debian/jellyfin.substvars debian/jellyfin/ diff --git a/Dockerfile b/Dockerfile index 47414ad12..9ac8d48e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,8 +17,7 @@ ARG FFMPEG_URL=https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-4.0.3-64 RUN apt update \ && apt install -y xz-utils \ && curl ${FFMPEG_URL} | tar Jxf - -C /usr/bin --wildcards --strip-components=1 ffmpeg*/ffmpeg ffmpeg*/ffprobe \ - && apt remove -y xz-utils + && apt remove -y xz-utils \ + && apt install -y libfontconfig1 # needed for Skia -ENTRYPOINT if [ -n "$PUID$PGUID" ]; \ - then echo "PUID/PGID are deprecated. Use Docker user param." >&2; exit 1; \ - else dotnet /jellyfin/jellyfin.dll -programdata /config; fi +ENTRYPOINT dotnet /jellyfin/jellyfin.dll -programdata /config diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 950ae10c7..54bce70ca 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -80,7 +80,6 @@ using MediaBrowser.Model.Globalization; using MediaBrowser.Model.IO; using MediaBrowser.Model.MediaInfo; using MediaBrowser.Model.Net; -using MediaBrowser.Model.News; using MediaBrowser.Model.Reflection; using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Services; diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index e9f4708c8..d74315755 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -46,6 +46,8 @@ namespace Jellyfin.Server }
ServerApplicationPaths appPaths = createApplicationPaths(options);
+ // $JELLYFIN_LOG_DIR needs to be set for the logger configuration manager
+ Environment.SetEnvironmentVariable("JELLYFIN_LOG_DIR", appPaths.LogDirectoryPath);
await createLogger(appPaths);
_loggerFactory = new SerilogLoggerFactory();
_logger = _loggerFactory.CreateLogger("Main");
@@ -138,23 +140,8 @@ namespace Jellyfin.Server }
else
{
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- configDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
- }
- else
- {
- // $XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored.
- configDir = Environment.GetEnvironmentVariable("XDG_CONFIG_HOME");
- // If $XDG_CONFIG_HOME is either not set or empty, $HOME/.config should be used.
- if (string.IsNullOrEmpty(configDir))
- {
- configDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share");
- }
- }
- configDir = Path.Combine(configDir, "jellyfin");
- // Ensure the dir exists
- Directory.CreateDirectory(configDir);
+ // Let BaseApplicationPaths set up the default value
+ configDir = null;
}
}
@@ -167,12 +154,9 @@ namespace Jellyfin.Server }
else
{
- logDir = Path.Combine(programDataPath, "logs");
- // Ensure the dir exists
- Directory.CreateDirectory(logDir);
+ // Let BaseApplicationPaths set up the default value
+ logDir = null;
}
- // $JELLYFIN_LOG_DIR needs to be set for the logger configuration manager
- Environment.SetEnvironmentVariable("JELLYFIN_LOG_DIR", logDir);
}
string appPath = AppContext.BaseDirectory;
diff --git a/MediaBrowser.Api/NewsService.cs b/MediaBrowser.Api/NewsService.cs deleted file mode 100644 index cbc77bfc9..000000000 --- a/MediaBrowser.Api/NewsService.cs +++ /dev/null @@ -1,46 +0,0 @@ -using MediaBrowser.Model.News; -using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Services; - -namespace MediaBrowser.Api -{ - [Route("/News/Product", "GET", Summary = "Gets the latest product news.")] - public class GetProductNews : IReturn<QueryResult<NewsItem>> - { - /// <summary> - /// Skips over a given number of items within the results. Use for paging. - /// </summary> - /// <value>The start index.</value> - [ApiMember(Name = "StartIndex", Description = "Optional. The record index to start at. All items with a lower index will be dropped from the results.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")] - public int? StartIndex { get; set; } - - /// <summary> - /// The maximum number of items to return - /// </summary> - /// <value>The limit.</value> - [ApiMember(Name = "Limit", Description = "Optional. The maximum number of records to return", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")] - public int? Limit { get; set; } - } - - public class NewsService : BaseApiService - { - private readonly INewsService _newsService; - - public NewsService(INewsService newsService) - { - _newsService = newsService; - } - - public object Get(GetProductNews request) - { - var result = _newsService.GetProductNews(new NewsQuery - { - StartIndex = request.StartIndex, - Limit = request.Limit - - }); - - return ToOptimizedResult(result); - } - } -} diff --git a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs index b68961889..578e9f264 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs @@ -51,7 +51,7 @@ namespace MediaBrowser.MediaEncoding.Encoder return false; } - _logger.LogInformation("ffmpeg info: {0}", output); + _logger.LogDebug("ffmpeg output: {Output}", output); if (output.IndexOf("Libav developers", StringComparison.OrdinalIgnoreCase) != -1) { @@ -160,10 +160,12 @@ namespace MediaBrowser.MediaEncoding.Encoder Arguments = arguments, IsHidden = true, ErrorDialog = false, - RedirectStandardOutput = true + RedirectStandardOutput = true, + // ffmpeg uses stderr to log info, don't show this + RedirectStandardError = true }); - _logger.LogInformation("Running {Path} {Arguments}", path, arguments); + _logger.LogDebug("Running {Path} {Arguments}", path, arguments); using (process) { @@ -175,7 +177,7 @@ namespace MediaBrowser.MediaEncoding.Encoder } catch { - _logger.LogInformation("Killing process {path} {arguments}", path, arguments); + _logger.LogWarning("Killing process {Path} {Arguments}", path, arguments); // Hate having to do this try diff --git a/MediaBrowser.Model/News/INewsService.cs b/MediaBrowser.Model/News/INewsService.cs deleted file mode 100644 index 4c92664d9..000000000 --- a/MediaBrowser.Model/News/INewsService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using MediaBrowser.Model.Querying; - -namespace MediaBrowser.Model.News -{ - /// <summary> - /// Interface INewsFeed - /// </summary> - public interface INewsService - { - /// <summary> - /// Gets the product news. - /// </summary> - /// <param name="query">The query.</param> - /// <returns>QueryResult{NewsItem}.</returns> - QueryResult<NewsItem> GetProductNews(NewsQuery query); - } -} diff --git a/MediaBrowser.Model/News/NewsItem.cs b/MediaBrowser.Model/News/NewsItem.cs deleted file mode 100644 index 2a05c420a..000000000 --- a/MediaBrowser.Model/News/NewsItem.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace MediaBrowser.Model.News -{ - public class NewsItem - { - public string Title { get; set; } - public string Link { get; set; } - public string Description { get; set; } - public string DescriptionHtml { get; set; } - public string Guid { get; set; } - public DateTime Date { get; set; } - } -} diff --git a/MediaBrowser.Model/News/NewsQuery.cs b/MediaBrowser.Model/News/NewsQuery.cs deleted file mode 100644 index 567888921..000000000 --- a/MediaBrowser.Model/News/NewsQuery.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace MediaBrowser.Model.News -{ - public class NewsQuery - { - public int? StartIndex { get; set; } - - public int? Limit { get; set; } - } -}
\ No newline at end of file @@ -1,53 +1,36 @@ <h1 align="center">Jellyfin</h1> <h3 align="center">The Free Software Media System</h3> -<p align="center"> -Jellyfin is a free software media system that puts you in control of managing and streaming your media. -</p> - ------ - -<p align="center"> -<strong>Want to get started?</strong> Choose from <a href="https://github.com/jellyfin/jellyfin/wiki/Prebuilt-Packages">Prebuilt Packages</a>, or <a href="https://github.com/jellyfin/jellyfin/wiki/Building-from-Source">Build from Source</a>. -</p> -<p align="center"> -<strong>Want to contribute?</strong> Check out <a href="https://github.com/jellyfin/jellyfin/wiki/Contributing-to-Jellyfin">our wiki for guidelines</a>. -</p> - --- <p align="center"> +<img alt="Logo banner" src="https://raw.githubusercontent.com/jellyfin/jellyfin-ux/master/branding/SVG/banner-logo-solid.svg?sanitize=true"/> +<br/></br> <a href="https://github.com/jellyfin/jellyfin"><img alt="GPL 2.0 License" src="https://img.shields.io/github/license/jellyfin/jellyfin.svg"></a> <a href="https://cloud.drone.io/jellyfin/jellyfin"><img alt="Build Status" src="https://cloud.drone.io/api/badges/jellyfin/jellyfin/status.svg"></a> <a href="https://hub.docker.com/r/jellyfin/jellyfin"><img alt="Docker Pull Count" src="https://img.shields.io/docker/pulls/jellyfin/jellyfin.svg"></a> -<a href="https://matrix.to/#/#jellyfin:matrix.org"><img alt="Chat on Matrix" src="https://img.shields.io/matrix/jellyfin:matrix.org.svg?logo=matrix"></a> +<a href="https://jellyfin.readthedocs.io"><img alt="Documentation" src="https://img.shields.io/readthedocs/jellyfin.svg"></a> +<a href="https://matrix.to/#/+jellyfin:matrix.org"><img alt="Chat on Matrix" src="https://img.shields.io/matrix/jellyfin:matrix.org.svg?logo=matrix"></a> <a href="https://www.reddit.com/r/jellyfin/"><img alt="Join our Subreddit" src="https://img.shields.io/badge/reddit-r%2Fjellyfin-%23FF5700.svg"></a> </p> -For further details, please see [our wiki](https://github.com/jellyfin/jellyfin/wiki). - -To receive the latest updates, please visit [our public chat on Matrix/Riot](https://matrix.to/#/#jellyfin:matrix.org), our [announce chat](https://matrix.to/#/#jellyfin-announce:matrix.org) for release info, and follow us on [Social Media](https://github.com/jellyfin/jellyfin/wiki/Social-Media). - -## About - -The Jellyfin project was started as a result of Emby's decision to take their code closed-source, as well as various philosophical differences with the core developers. Jellyfin seeks to be the free software alternative to Emby and Plex to provide media management and streaming from a dedicated server to end-user devices. - -Jellyfin is descended from Emby 3.5.2, ported to the .NET Core framework, and aims to contain build facilities for every platform. +--- -## Issues and Feature Requests +Jellyfin is a Free Software Media System that puts you in control of managing and streaming your media. It is an alternative to the proprietary Emby and Plex, to provide media from a dedicated server to end-user devices via multiple apps. Jellyfin is descended from Emby's 3.5.2 release and ported to the .NET Core framework to enable full cross-platform support. There are no strings attached, no premium licenses or features, and no hidden agendas: just a team who want to build something better and work together to achieve it. We welcome anyone who is interested in joining us in our quest! +For further details, please see [our documentation page](https://jellyfin.readthedocs.io). To receive the latest updates, get help with Jellyfin, and join the community, please visit [one of our communication channels on Matrix/Riot or social media](https://jellyfin.readthedocs.io/en/latest/user-docs/getting-help). +For more information about the project, please see our [about page](https://jellyfin.readthedocs.io/en/latest/about/). <p align="center"> - <strong>New idea or improvement?</strong> -<em>Open a <a href="https://github.com/jellyfin/jellyfin/wiki/Feature-Requests">Feature Request</a>.</em> +<strong>Want to get started?</strong> +<em>Choose from <a href="https://jellyfin.readthedocs.io/en/latest/user-docs/installing/">Prebuilt Packages</a> or <a href="https://jellyfin.readthedocs.io/en/latest/user-docs/building/">Build from Source</a>, then see our <a href="https://jellyfin.readthedocs.io/en/latest/user-docs/quick-start/">Quickstart guide</a>.</em> </p> <p align="center"> - <Strong>Something not working right?</strong> -<em>Open an <a href="https://github.com/jellyfin/jellyfin/wiki/Issue-Guidelines">Issue</a>.</em> +<strong>Want to contribute?</strong> +<em>Check out <a href="https://jellyfin.readthedocs.io/en/latest/developer-docs/contributing/">our documentation for guidelines</a>.</em> +</p> +<p align="center"> +<strong>New idea or improvement? Something not working right?</strong> +<em>Open an <a href="https://jellyfin.readthedocs.io/en/latest/developer-docs/issues/">Issue</a>.</em> </p> - - -## Contributing to Jellyfin - -If you're interested in contributing, please see [our wiki for guidelines](https://github.com/jellyfin/jellyfin/wiki/Contributing-to-Jellyfin). diff --git a/debian/changelog b/debian/changelog index 9dc21d467..61223e725 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +jellyfin (10.0.0-1) unstable; urgency=medium + + * The first Jellyfin release under our new versioning scheme + * Numerous bugfixes and code readability improvements + * Updated logging configuration, including flag for it and configdir + * Updated theming including logo + * Dozens of other improvements as documented in GitHub pull request #419 + + -- Joshua Boniface <joshua@boniface.me> Sat, 05 Jan 2019 15:39:25 -0500 + jellyfin (3.5.2-5) unstable; urgency=medium * Fully GPL'd release - remove tainted code from MediaBrowser.Common @@ -34,16 +44,3 @@ jellyfin (3.5.2) unstable; urgency=medium * Rename from emby-server on version 3.5.2 -- Joshua Boniface <joshua@boniface.me> Sun, 9 Dec 2018 15:20:58 -0400 - -emby-server (3.5.2-unlocked) unstable; urgency=medium - - * Taking changes from upstream 3.5.2, beautifying some JS files - - -- Vasily <just.one.man@yandex.ru> Mon, 22 Oct 2018 03:45:13 +0400 - -emby-server (3.4.1.18-unlocked) unstable; urgency=medium - - * Hard fork of Emby 3.4.1.18 including premium unlock - - -- Joshua Boniface <joshua@boniface.me> Thu, 9 Aug 2018 00:33:19 -0400 - diff --git a/debian/conf/jellyfin b/debian/conf/jellyfin index fb00e7f65..861865aae 100644 --- a/debian/conf/jellyfin +++ b/debian/conf/jellyfin @@ -15,8 +15,10 @@ # General options # -# Data directory -JELLYFIN_DATA="/var/lib/jellyfin" +# Program directories +JELLYFIN_DATA_DIRECTORY="/var/lib/jellyfin" +JELLYFIN_CONFIG_DIRECTORY="/etc/jellyfin" +JELLYFIN_LOG_DIRECTORY="/var/log/jellyfin" # Restart script for in-app server control JELLYFIN_RESTART_SCRIPT="/usr/lib/jellyfin/restart.sh" # Additional options for the binary @@ -29,4 +31,4 @@ JELLYFIN_ADD_OPTS="" # Application username JELLYFIN_USER="jellyfin" # Full application command -JELLYFIN_ARGS="-programdata $JELLYFIN_DATA -restartpath $JELLYFIN_RESTART_SCRIPT $JELLYFIN_ADD_OPTS" +JELLYFIN_ARGS="-programdata $JELLYFIN_DATA_DIRECTORY -configdir $JELLYFIN_CONFIG_DIRECTORY -logdir $JELLYFIN_LOG_DIRECTORY -restartpath $JELLYFIN_RESTART_SCRIPT $JELLYFIN_ADD_OPTS" diff --git a/debian/conf/logging.json b/debian/conf/logging.json new file mode 100644 index 000000000..5d98484cd --- /dev/null +++ b/debian/conf/logging.json @@ -0,0 +1,29 @@ +{ + "Serilog": { + "MinimumLevel": "Information", + "WriteTo": [ + { "Name": "Console", + "Args": { + "outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "Async", + "Args": { + "configure": [ + { + "Name": "File", + "Args": { + "path": "%JELLYFIN_LOG_DIR%//jellyfin.log", + "fileSizeLimitBytes": 10485700, + "rollOnFileSizeLimit": true, + "retainedFileCountLimit": 10, + "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message}{NewLine}{Exception}" + } + } + ] + } + } + ] + } +} diff --git a/debian/control b/debian/control index 13c62c806..74bebeaf1 100644 --- a/debian/control +++ b/debian/control @@ -9,6 +9,9 @@ Build-Depends: debhelper (>= 9), libfontconfig1-dev, libfreetype6-dev Standards-Version: 3.9.4 +Homepage: https://jellyfin.media/ +Vcs-Git: https://github.org/jellyfin/jellyfin.git +Vcs-Browser: https://github.org/jellyfin/jellyfin Package: jellyfin Replaces: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server diff --git a/debian/install b/debian/install index bc26f9f09..adaff7b26 100644 --- a/debian/install +++ b/debian/install @@ -1,5 +1,6 @@ usr/lib/jellyfin usr/lib/ debian/conf/jellyfin etc/default/ +debian/conf/logging.json etc/jellyfin/ debian/conf/jellyfin.service.conf etc/systemd/system/jellyfin.service.d/ debian/bin/jellyfin-sudoers etc/sudoers.d/ debian/bin/restart.sh usr/lib/jellyfin/ diff --git a/debian/jellyfin.service b/debian/jellyfin.service index 4c3739909..c17422029 100644 --- a/debian/jellyfin.service +++ b/debian/jellyfin.service @@ -6,7 +6,7 @@ After = network.target Type = simple EnvironmentFile = /etc/default/jellyfin User = jellyfin -ExecStart = /usr/bin/jellyfin -programdata ${JELLYFIN_DATA} -restartpath ${JELLYFIN_RESTART_SCRIPT} ${JELLYFIN_ADD_OPTS} +ExecStart = /usr/bin/jellyfin -programdata ${JELLYFIN_DATA_DIRECTORY} -configdir ${JELLYFIN_CONFIG_DIRECTORY} -logdir ${JELLYFIN_LOG_DIRECTORY} -restartpath ${JELLYFIN_RESTART_SCRIPT} ${JELLYFIN_ADD_OPTS} Restart = on-failure TimeoutSec = 15 diff --git a/debian/postinst b/debian/postinst index 502bba342..3690d20ba 100644 --- a/debian/postinst +++ b/debian/postinst @@ -2,7 +2,6 @@ set -e NAME=jellyfin -CONF_FILE=/etc/${NAME}.conf DEFAULT_FILE=/etc/default/${NAME} # Source Jellyfin default configuration @@ -10,13 +9,10 @@ if [[ -f $DEFAULT_FILE ]]; then . $DEFAULT_FILE fi -# Source Jellyfin user configuration overrides -if [[ -f $CONF_FILE ]]; then - . $CONF_FILE -fi - -# Data directory where Jellyfin database, cache and logs are stored -PROGRAMDATA=${JELLYFIN_DATA-/var/lib/$NAME} +# Data directories for program data (cache, db), configs, and logs +PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} +CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} +LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} case "$1" in configure) @@ -29,13 +25,24 @@ case "$1" in adduser --system --ingroup jellyfin --shell /bin/false jellyfin --no-create-home --home ${PROGRAMDATA} \ --gecos "Jellyfin default user" > /dev/null 2>&1 fi - # ensure $PROGRAMDATA has appropriate permissions + # ensure $PROGRAMDATA exists if [[ ! -d $PROGRAMDATA ]]; then mkdir $PROGRAMDATA - chown -R jellyfin:jellyfin $PROGRAMDATA fi + # ensure $CONFIGDATA exists + if [[ ! -d $CONFIGDATA ]]; then + mkdir $CONFIGDATA + fi + # ensure $LOGDATA exists + if [[ ! -d $LOGDATA ]]; then + mkdir $LOGDATA + fi + # Ensure permissions are correct on all config directories + chown -R jellyfin:jellyfin $PROGRAMDATA + chown -R jellyfin:jellyfin $CONFIGDATA + chown -R jellyfin:jellyfin $LOGDATA - chmod +x ${JELLYFIN_DIR}/restart.sh > /dev/null 2>&1 || true + chmod +x /usr/lib/jellyfin/restart.sh > /dev/null 2>&1 || true # Install jellyfin symlink into /usr/bin ln -sf /usr/lib/jellyfin/bin/jellyfin /usr/bin/jellyfin diff --git a/debian/postrm b/debian/postrm index 852841b16..690f5d587 100644 --- a/debian/postrm +++ b/debian/postrm @@ -2,7 +2,6 @@ set -e NAME=jellyfin -CONF_FILE=/etc/${NAME}.conf DEFAULT_FILE=/etc/default/${NAME} # Source Jellyfin default configuration @@ -10,13 +9,10 @@ if [[ -f $DEFAULT_FILE ]]; then . $DEFAULT_FILE fi -# Source Jellyfin user configuration overrides -if [[ -f $CONF_FILE ]]; then - . $CONF_FILE -fi - -# Data directory where Jellyfin database, cache and logs are stored -PROGRAMDATA=${JELLYFIN_DATA-/var/lib/$NAME} +# Data directories for program data (cache, db), configs, and logs +PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} +CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} +LOGDATA=${JELLYFIN_DATA_DIRECTORY-/var/log/$NAME} # In case this system is running systemd, we make systemd reload the unit files # to pick up changes. @@ -37,14 +33,29 @@ case "$1" in deb-systemd-helper unmask jellyfin.service >/dev/null fi + # Remove user and group userdel jellyfin > /dev/null 2>&1 || true delgroup --quiet jellyfin > /dev/null 2>&1 || true + # Remove config dir + if [[ -d $CONFIGDATA ]]; then + rm -rf $CONFIGDATA + fi + # Remove log dir + if [[ -d $LOGDATA ]]; then + rm -rf $LOGDATA + fi + # Remove program data dir if [[ -d $PROGRAMDATA ]]; then rm -rf $PROGRAMDATA fi + # Remove binary symlink [[ -f /usr/bin/jellyfin ]] && rm /usr/bin/jellyfin + # Remove sudoers config [[ -f /etc/sudoers.d/jellyfin-sudoers ]] && rm /etc/sudoers.d/jellyfin-sudoers - [[ -d /var/lib/jellyfin ]] && rm -rf /var/lib/jellyfin + # Remove anything at the default locations; catches situations where the user moved the defaults + [[ -e /etc/jellyfin ]] && rm -rf /etc/jellyfin + [[ -e /var/log/jellyfin ]] && rm -rf /var/log/jellyfin + [[ -e /var/lib/jellyfin ]] && rm -rf /var/lib/jellyfin ;; remove) if [[ -x "/usr/bin/deb-systemd-helper" ]]; then diff --git a/debian/preinst b/debian/preinst index 2ce29a0cf..0063e0e63 100644 --- a/debian/preinst +++ b/debian/preinst @@ -2,7 +2,6 @@ set -e NAME=jellyfin -CONF_FILE=/etc/${NAME}.conf DEFAULT_FILE=/etc/default/${NAME} # Source Jellyfin default configuration @@ -10,13 +9,10 @@ if [[ -f $DEFAULT_FILE ]]; then . $DEFAULT_FILE fi -# Source Jellyfin user configuration overrides -if [[ -f $CONF_FILE ]]; then - . $CONF_FILE -fi - -# Data directory where Jellyfin database, cache and logs are stored -PROGRAMDATA=${JELLYFIN_DATA-/var/lib/$NAME} +# Data directories for program data (cache, db), configs, and logs +PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} +CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} +LOGDATA=${JELLYFIN_DATA_DIRECTORY-/var/log/$NAME} # In case this system is running systemd, we make systemd reload the unit files # to pick up changes. @@ -57,6 +53,14 @@ case "$1" in # Clean up old Emby cruft that can break the user's system [[ -f /etc/sudoers.d/emby ]] && rm -f /etc/sudoers.d/emby + # If we have existing config or log dirs in /var/lib/jellyfin, move them into the right place + if [[ -d $PROGRAMDATA/config ]]; then + mv $PROGRAMDATA/config $CONFIGDATA + fi + if [[ -d $PROGRAMDATA/logs ]]; then + mv $PROGRAMDATA/logs $LOGDATA + fi + ;; abort-upgrade) ;; diff --git a/debian/prerm b/debian/prerm index 3cdffed79..4770c03c4 100644 --- a/debian/prerm +++ b/debian/prerm @@ -2,7 +2,6 @@ set -e NAME=jellyfin -CONF_FILE=/etc/${NAME}.conf DEFAULT_FILE=/etc/default/${NAME} # Source Jellyfin default configuration @@ -10,13 +9,10 @@ if [[ -f $DEFAULT_FILE ]]; then . $DEFAULT_FILE fi -# Source Jellyfin user configuration overrides -if [[ -f $CONF_FILE ]]; then - . $CONF_FILE -fi - -# Data directory where Jellyfin database, cache and logs are stored -PROGRAMDATA=${JELLYFIN_DATA-/var/lib/$NAME} +# Data directories for program data (cache, db), configs, and logs +PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} +CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} +LOGDATA=${JELLYFIN_DATA_DIRECTORY-/var/log/$NAME} case "$1" in remove|upgrade|deconfigure) diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 000000000..45bef4764 --- /dev/null +++ b/debian/source/options @@ -0,0 +1 @@ +tar-ignore = ".git*" |
