From 56f9572b03c1049131d78f316c2018e271fd3325 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 5 Jan 2019 15:38:50 -0500 Subject: [PATCH 1/6] Bump version to 10.0.0 --- debian/changelog | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9dc21d467e..f536f4f15c 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 PR#419 + + -- Joshua Boniface 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 From 263274e1aedfd73b90d4fabae75727e3da6528d0 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 5 Jan 2019 16:49:33 -0500 Subject: [PATCH 2/6] Add VCS entries to control file --- debian/control | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/control b/debian/control index 13c62c8065..74bebeaf15 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 From 3f65cb4f4882d63457192f1bc2f22eaeb9b035c9 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 5 Jan 2019 19:19:23 -0500 Subject: [PATCH 3/6] Add several more debuild artificats to gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 9bbfd9b745..befba5a20e 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/ From 177c4835a5403d47eab10cf597694d8f2567f25f Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 5 Jan 2019 19:55:55 -0500 Subject: [PATCH 4/6] Add updated configurations for log and config dir 1. Add log and config flags to init and config 2. Move the existing logs and config dirs to the right places 3. Some cleanups in the control scripts 4. Prune the changelog of pre-Jellyfin entries --- debian/changelog | 13 ------------- debian/conf/jellyfin | 8 ++++++-- debian/conf/logging.json | 21 +++++++++++++++++++++ debian/install | 1 + debian/jellyfin.service | 2 +- debian/postinst | 24 +++++++++++++++--------- debian/postrm | 25 +++++++++++++++++-------- debian/preinst | 20 ++++++++++++-------- debian/prerm | 12 ++++-------- 9 files changed, 77 insertions(+), 49 deletions(-) create mode 100644 debian/conf/logging.json diff --git a/debian/changelog b/debian/changelog index f536f4f15c..ad82a7fa40 100644 --- a/debian/changelog +++ b/debian/changelog @@ -44,16 +44,3 @@ jellyfin (3.5.2) unstable; urgency=medium * Rename from emby-server on version 3.5.2 -- Joshua Boniface 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 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 Thu, 9 Aug 2018 00:33:19 -0400 - diff --git a/debian/conf/jellyfin b/debian/conf/jellyfin index fb00e7f65c..2735fe8e77 100644 --- a/debian/conf/jellyfin +++ b/debian/conf/jellyfin @@ -16,7 +16,11 @@ # # Data directory -JELLYFIN_DATA="/var/lib/jellyfin" +JELLYFIN_DATA_DIRECTORY="/var/lib/jellyfin" +# Config directory +JELLYFIN_CONFIG_DIRECTORY="/etc/jellyfin" +# Logging directory +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 +33,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 0000000000..2ebe5655f3 --- /dev/null +++ b/debian/conf/logging.json @@ -0,0 +1,21 @@ +{ + "Serilog": { + "MinimumLevel": "Information", + "WriteTo": [ + { "Name": "Console", + "Args": { + "outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}" + } + }, + { "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/install b/debian/install index bc26f9f09a..adaff7b26f 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 4c37399092..c17422029a 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 502bba3422..7bf2e32de8 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) @@ -34,8 +30,18 @@ case "$1" in mkdir $PROGRAMDATA chown -R jellyfin:jellyfin $PROGRAMDATA fi + # ensure $JELLYFIN_CONFIG_DIRECTORY has appropriate permissions + if [[ -n $JELLYFIN_CONFIG_DIRECTORY && ! -d $JELLYFIN_CONFIG_DIRECTORY ]]; then + mkdir $JELLYFIN_CONFIG_DIRECTORY + chown -R jellyfin:jellyfin $JELLYFIN_CONFIG_DIRECTORY + fi + # ensure $JELLYFIN_LOG_DIRECTORY has appropriate permissions + if [[ -n $JELLYFIN_LOG_DIRECTORY && ! -d $JELLYFIN_LOG_DIRECTORY ]]; then + mkdir $JELLYFIN_LOG_DIRECTORY + chown -R jellyfin:jellyfin $JELLYFIN_LOG_DIRECTORY + fi - 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 852841b163..cbf77325ee 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,13 +33,26 @@ 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 + # Remove /var/lib/jellyfin, just in case [[ -d /var/lib/jellyfin ]] && rm -rf /var/lib/jellyfin ;; remove) diff --git a/debian/preinst b/debian/preinst index 2ce29a0cf1..0063e0e637 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 3cdffed79d..4770c03c41 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) From 4e8149bc86b524f59d60fbe2e207427963a694ee Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 5 Jan 2019 23:42:00 -0500 Subject: [PATCH 5/6] Update logging for async mode from #438 --- debian/conf/logging.json | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/debian/conf/logging.json b/debian/conf/logging.json index 2ebe5655f3..5d98484cdf 100644 --- a/debian/conf/logging.json +++ b/debian/conf/logging.json @@ -7,13 +7,21 @@ "outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}" } }, - { "Name": "File", + { + "Name": "Async", "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}" + "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}" + } + } + ] } } ] From d4182e761cbd18a85e3dc85812940b92f6a632dc Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sun, 6 Jan 2019 14:53:07 -0500 Subject: [PATCH 6/6] Tweakes based on review feedback --- debian/changelog | 2 +- debian/conf/jellyfin | 4 +--- debian/postrm | 6 ++++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index ad82a7fa40..61223e7253 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,7 @@ jellyfin (10.0.0-1) unstable; urgency=medium * 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 PR#419 + * Dozens of other improvements as documented in GitHub pull request #419 -- Joshua Boniface Sat, 05 Jan 2019 15:39:25 -0500 diff --git a/debian/conf/jellyfin b/debian/conf/jellyfin index 2735fe8e77..861865aae2 100644 --- a/debian/conf/jellyfin +++ b/debian/conf/jellyfin @@ -15,11 +15,9 @@ # General options # -# Data directory +# Program directories JELLYFIN_DATA_DIRECTORY="/var/lib/jellyfin" -# Config directory JELLYFIN_CONFIG_DIRECTORY="/etc/jellyfin" -# Logging directory JELLYFIN_LOG_DIRECTORY="/var/log/jellyfin" # Restart script for in-app server control JELLYFIN_RESTART_SCRIPT="/usr/lib/jellyfin/restart.sh" diff --git a/debian/postrm b/debian/postrm index cbf77325ee..690f5d587e 100644 --- a/debian/postrm +++ b/debian/postrm @@ -52,8 +52,10 @@ case "$1" in [[ -f /usr/bin/jellyfin ]] && rm /usr/bin/jellyfin # Remove sudoers config [[ -f /etc/sudoers.d/jellyfin-sudoers ]] && rm /etc/sudoers.d/jellyfin-sudoers - # Remove /var/lib/jellyfin, just in case - [[ -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