diff --git a/ALL_README.md b/ALL_README.md index 152f2e7..4ed64dd 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -5,4 +5,5 @@ - [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) +- [Baca README dalam bahasa bahasa Indonesia](README_id.md) - [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index adcbbcb..f37b992 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ It shall NOT be edited by hand. Jellyfin enables you to collect, manage, and stream your media. Run the Jellyfin server on your system and gain access to the leading free-software entertainment system, bells and whistles included. -**Shipped version:** 10.9.7~ynh2 +**Shipped version:** 10.9.8~ynh1 **Demo:** diff --git a/README_es.md b/README_es.md index 3968e10..c6a3a43 100644 --- a/README_es.md +++ b/README_es.md @@ -19,7 +19,7 @@ No se debe editar a mano. Jellyfin enables you to collect, manage, and stream your media. Run the Jellyfin server on your system and gain access to the leading free-software entertainment system, bells and whistles included. -**Versión actual:** 10.9.7~ynh2 +**Versión actual:** 10.9.8~ynh1 **Demo:** diff --git a/README_eu.md b/README_eu.md index 82f5d86..4349953 100644 --- a/README_eu.md +++ b/README_eu.md @@ -19,7 +19,7 @@ EZ editatu eskuz. Jellyfin enables you to collect, manage, and stream your media. Run the Jellyfin server on your system and gain access to the leading free-software entertainment system, bells and whistles included. -**Paketatutako bertsioa:** 10.9.7~ynh2 +**Paketatutako bertsioa:** 10.9.8~ynh1 **Demoa:** diff --git a/README_fr.md b/README_fr.md index 83a6c3e..6566945 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Il NE doit PAS être modifié à la main. Jellyfin vous permet de collecter, gérer et diffuser vos médias. Exécutez le serveur Jellyfin sur votre système et accédez au principal système de divertissement à logiciel libre. -**Version incluse :** 10.9.7~ynh2 +**Version incluse :** 10.9.8~ynh1 **Démo :** diff --git a/README_gl.md b/README_gl.md index 443b65b..ed54f70 100644 --- a/README_gl.md +++ b/README_gl.md @@ -19,7 +19,7 @@ NON debe editarse manualmente. Jellyfin enables you to collect, manage, and stream your media. Run the Jellyfin server on your system and gain access to the leading free-software entertainment system, bells and whistles included. -**Versión proporcionada:** 10.9.7~ynh2 +**Versión proporcionada:** 10.9.8~ynh1 **Demo:** diff --git a/README_id.md b/README_id.md new file mode 100644 index 0000000..982404f --- /dev/null +++ b/README_id.md @@ -0,0 +1,51 @@ + + +# Jellyfin untuk YunoHost + +[![Tingkat integrasi](https://dash.yunohost.org/integration/jellyfin.svg)](https://ci-apps.yunohost.org/ci/apps/jellyfin/) ![Status kerja](https://ci-apps.yunohost.org/ci/badges/jellyfin.status.svg) ![Status pemeliharaan](https://ci-apps.yunohost.org/ci/badges/jellyfin.maintain.svg) + +[![Pasang Jellyfin dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=jellyfin) + +*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)* + +> *Paket ini memperbolehkan Anda untuk memasang Jellyfin secara cepat dan mudah pada server YunoHost.* +> *Bila Anda tidak mempunyai YunoHost, silakan berkonsultasi dengan [panduan](https://yunohost.org/install) untuk mempelajari bagaimana untuk memasangnya.* + +## Ringkasan + +Jellyfin enables you to collect, manage, and stream your media. Run the Jellyfin server on your system and gain access to the leading free-software entertainment system, bells and whistles included. + + +**Versi terkirim:** 10.9.8~ynh1 + +**Demo:** + +## Tangkapan Layar + +![Tangkapan Layar pada Jellyfin](./doc/screenshots/jellyfin-1.jpg) +![Tangkapan Layar pada Jellyfin](./doc/screenshots/jellyfin-2.jpg) + +## Dokumentasi dan sumber daya + +- Website aplikasi resmi: +- Dokumentasi pengguna resmi: +- Repositori kode aplikasi hulu: +- Gudang YunoHost: +- Laporkan bug: + +## Info developer + +Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/jellyfin_ynh/tree/testing). + +Untuk mencoba branch `testing`, silakan dilanjutkan seperti: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/jellyfin_ynh/tree/testing --debug +atau +sudo yunohost app upgrade jellyfin -u https://github.com/YunoHost-Apps/jellyfin_ynh/tree/testing --debug +``` + +**Info lebih lanjut mengenai pemaketan aplikasi:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index d7b24bc..a7e70d9 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -19,7 +19,7 @@ Jellyfin enables you to collect, manage, and stream your media. Run the Jellyfin server on your system and gain access to the leading free-software entertainment system, bells and whistles included. -**分发版本:** 10.9.7~ynh2 +**分发版本:** 10.9.8~ynh1 **演示:** diff --git a/manifest.toml b/manifest.toml index 813934a..063e760 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Jellyfin" description.en = "Media System that manage and stream your media" description.fr = "Système multimédia qui gère et diffuse vos médias" -version = "10.9.7~ynh2" +version = "10.9.8~ynh1" maintainers = ["tituspijean"] @@ -62,24 +62,24 @@ ram.runtime = "100M" [resources] [resources.sources.server_bullseye] - armhf.url = "https://repo.jellyfin.org/files/server/debian/stable/v10.9.7/armhf/jellyfin-server_10.9.7+deb11_armhf.deb" - armhf.sha256 = "a05083388d32f8de32b9860a41d59d42fc6a976e1f19f44465105cac9e6809b5" - arm64.url = "https://repo.jellyfin.org/files/server/debian/stable/v10.9.7/arm64/jellyfin-server_10.9.7+deb11_arm64.deb" - arm64.sha256 = "09e21c2ef81e15fddb905ec90082b275c13c1a996be2a0defe0256feede89537" - amd64.url = "https://repo.jellyfin.org/files/server/debian/stable/v10.9.7/amd64/jellyfin-server_10.9.7+deb11_amd64.deb" - amd64.sha256 = "55f7f18ee2812aa55e4c5956c954310fd3b37c99d89e1f1dde14b2c5cce2c62c" + armhf.url = "https://repo.jellyfin.org/files/server/debian/stable/v10.9.8/armhf/jellyfin-server_10.9.8+deb11_armhf.deb" + armhf.sha256 = "e3f058a5cb0bff207799564c2f3e0db20172ee9a34da17f9acd1e46095ca192b" + arm64.url = "https://repo.jellyfin.org/files/server/debian/stable/v10.9.8/arm64/jellyfin-server_10.9.8+deb11_arm64.deb" + arm64.sha256 = "333fc7b830dae31bf97325cf0afe616e7cd56de1fa7a9ef0b72abff9b758e474" + amd64.url = "https://repo.jellyfin.org/files/server/debian/stable/v10.9.8/amd64/jellyfin-server_10.9.8+deb11_amd64.deb" + amd64.sha256 = "7bcb0532b84758c6b9663c46205d4126865496fba2c25eea091923e125d1fbf0" format = "whatever" extract = false rename = "jellyfin-server.deb" [resources.sources.server_bookworm] - armhf.url = "https://repo.jellyfin.org/files/server/debian/stable/v10.9.7/armhf/jellyfin-server_10.9.7+deb12_armhf.deb" - armhf.sha256 = "c5f0cd1a685c31276204b85bda20f6739945f3c4c27212ef116fd91364a3afef" - arm64.url = "https://repo.jellyfin.org/files/server/debian/stable/v10.9.7/arm64/jellyfin-server_10.9.7+deb12_arm64.deb" - arm64.sha256 = "f096803d494fe6b60faeb787a11a6e4a3576c13eee46db393f40767d156d0568" - amd64.url = "https://repo.jellyfin.org/files/server/debian/stable/v10.9.7/amd64/jellyfin-server_10.9.7+deb12_amd64.deb" - amd64.sha256 = "fcd2486ce67ab6eba639e06865cc17945a785b698f34e0e9b102807413d727c1" + armhf.url = "https://repo.jellyfin.org/files/server/debian/stable/v10.9.8/armhf/jellyfin-server_10.9.8+deb12_armhf.deb" + armhf.sha256 = "965d13aa96b35a72d21cb3cdd961ae469b7b9f19bb5415c34b24426300068b04" + arm64.url = "https://repo.jellyfin.org/files/server/debian/stable/v10.9.8/arm64/jellyfin-server_10.9.8+deb12_arm64.deb" + arm64.sha256 = "96978fbf0289732004e88b626ecead0cf6c2261b523f72c3997dc26f707dc4bd" + amd64.url = "https://repo.jellyfin.org/files/server/debian/stable/v10.9.8/amd64/jellyfin-server_10.9.8+deb12_amd64.deb" + amd64.sha256 = "76a6efb43dffc3cd7b704076822d8c2e607453a0122db6c8451bdb03318f075e" format = "whatever" extract = false @@ -87,16 +87,16 @@ ram.runtime = "100M" [resources.sources.web_bullseye] - url = "https://repo.jellyfin.org/files/server/debian/stable/v10.9.7/amd64/jellyfin-web_10.9.7+deb11_all.deb" - sha256 = "3ce87029296d88cbb63a8d114c4b45a2999f4b79fac6ca2fce41be7fe406ba09" + url = "https://repo.jellyfin.org/files/server/debian/stable/v10.9.8/amd64/jellyfin-web_10.9.8+deb11_all.deb" + sha256 = "62daa8c2f2bedcc19dba508aad3b1fd52568ed1edcbc3a09071be83f48820a78" format = "whatever" extract = false rename = "jellyfin-web.deb" [resources.sources.web_bookworm] - url = "https://repo.jellyfin.org/files/server/debian/stable/v10.9.7/amd64/jellyfin-web_10.9.7+deb12_all.deb" - sha256 = "f203d9a031ee1c781a7cb71f2fee3f998d59d0c94dfdfb6033e5b2d83b3d2007" + url = "https://repo.jellyfin.org/files/server/debian/stable/v10.9.8/amd64/jellyfin-web_10.9.8+deb12_all.deb" + sha256 = "30dc942102ac4d546bea65cd523723f661b082be684518b7ad9ca771235aac7f" format = "whatever" extract = false @@ -104,11 +104,11 @@ ram.runtime = "100M" [resources.sources.ffmpeg_bullseye] - armhf.url = "https://repo.jellyfin.org/files/ffmpeg/debian/latest-6.x/armhf/jellyfin-ffmpeg6_6.0.1-7-bullseye_armhf.deb" + armhf.url = "https://repo.jellyfin.org/files/ffmpeg/debian/6.x/6.0.1-7/armhf/jellyfin-ffmpeg6_6.0.1-7-bullseye_armhf.deb" armhf.sha256 = "4940083aa8bf6f04df7fbd3c5740f96b8b1d41ae2aeef8aba25eed7fbc72dd57" - arm64.url = "https://repo.jellyfin.org/files/ffmpeg/debian/latest-6.x/arm64/jellyfin-ffmpeg6_6.0.1-7-bullseye_arm64.deb" + arm64.url = "https://repo.jellyfin.org/files/ffmpeg/debian/6.x/6.0.1-7/arm64/jellyfin-ffmpeg6_6.0.1-7-bullseye_arm64.deb" arm64.sha256 = "106311dfc45cfa69f9588772b9c0327e1558fd5186f6b4ce6d1f615ad09893bb" - amd64.url = "https://repo.jellyfin.org/files/ffmpeg/debian/latest-6.x/amd64/jellyfin-ffmpeg6_6.0.1-7-bullseye_amd64.deb" + amd64.url = "https://repo.jellyfin.org/files/ffmpeg/debian/6.x/6.0.1-7/amd64/jellyfin-ffmpeg6_6.0.1-7-bullseye_amd64.deb" amd64.sha256 = "ee50c84a501c530e179088cf3f6d9048fe446e186d93f726a2073b860a313c5c" format = "whatever" @@ -116,11 +116,11 @@ ram.runtime = "100M" rename = "jellyfin-ffmpeg6.deb" [resources.sources.ffmpeg_bookworm] - armhf.url = "https://repo.jellyfin.org/files/ffmpeg/debian/latest-6.x/armhf/jellyfin-ffmpeg6_6.0.1-7-bookworm_armhf.deb" + armhf.url = "https://repo.jellyfin.org/files/ffmpeg/debian/6.x/6.0.1-7/armhf/jellyfin-ffmpeg6_6.0.1-7-bookworm_armhf.deb" armhf.sha256 = "03d8a5512c7406e77359475da729157fc653dc5203f2399b59c71c6f59ca10f3" - arm64.url = "https://repo.jellyfin.org/files/ffmpeg/debian/latest-6.x/arm64/jellyfin-ffmpeg6_6.0.1-7-bookworm_arm64.deb" + arm64.url = "https://repo.jellyfin.org/files/ffmpeg/debian/6.x/6.0.1-7/arm64/jellyfin-ffmpeg6_6.0.1-7-bookworm_arm64.deb" arm64.sha256 = "6c21dfdd931c576fcd5c095d4aae2cf92d4720beba6c73404f3d56220213c2a4" - amd64.url = "https://repo.jellyfin.org/files/ffmpeg/debian/latest-6.x/amd64/jellyfin-ffmpeg6_6.0.1-7-bookworm_amd64.deb" + amd64.url = "https://repo.jellyfin.org/files/ffmpeg/debian/6.x/6.0.1-7/amd64/jellyfin-ffmpeg6_6.0.1-7-bookworm_amd64.deb" amd64.sha256 = "0773fda9111e03394e088790eabc99dbb0291d107a4950bdcbfafd94c5d0652e" format = "whatever" diff --git a/scripts/_common.sh b/scripts/_common.sh index 818ba16..3975534 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ debian=$(lsb_release --codename --short) debian_number=$(lsb_release --release --short) -pkg_version="10.9.7" +pkg_version="10.9.8" version=$(echo "$pkg_version" | cut -d '-' -f 1) ffmpeg_pkg_version="6.0.1-7" @@ -30,6 +30,11 @@ cache_path="/var/cache/$app" #================================================= install_jellyfin_packages() { + # Get version numbers from manifest UNUSED because update_version.py uses the hard-coded variables + # pkg_version="$(ynh_app_upstream_version)" + # ffmpeg_url="$(ynh_read_manifest --manifest_key="resources.sources.ffmpeg_${debian}.${YNH_ARCH}.url")" + # ffmpeg_pkg_version="$(echo "$ffmpeg_url" | sed "s/.*\/jellyfin-ffmpeg[0-9]*_\([0-9.-]*\)-${debian}_${YNH_ARCH}.deb/\1/")" + # Create the temporary directory tempdir="$(mktemp -d)" diff --git a/scripts/backup b/scripts/backup index 995e80b..52bbcf6 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -24,23 +22,13 @@ ynh_backup --src_path="$config_path" ynh_backup --src_path="/etc/default/jellyfin" --not_mandatory #================================================= -# BACKUP THE NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP LOGROTATE -#================================================= - ynh_backup --src_path="/etc/logrotate.d/$app" -#================================================= -# BACKUP SYSTEMD -#================================================= - ynh_backup --src_path="/etc/systemd/system/jellyfin.service.d" --not_mandatory #================================================= diff --git a/scripts/change_url b/scripts/change_url index 38754c3..6fed8b7 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC STARTING #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -9,14 +7,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD MODIFICATIONS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=2 +ynh_script_progression --message="Stopping $app's systemd service..." --weight=2 -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --timeout=15 +ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd" --timeout=15 #================================================= # MODIFY URL IN NGINX CONF @@ -25,15 +21,12 @@ ynh_script_progression --message="Updating NGINX web server configuration..." -- ynh_change_url_nginx_config -#================================================= -# SPECIFIC MODIFICATIONS #================================================= # BASE URL #================================================= # Change the path in system.xml config file -if [ $change_path -eq 1 ] -then +if [ $change_path -eq 1 ]; then # If somehow was not replaced during install if grep -q "" "$config_path/network.xml"; then ynh_replace_string --match_string="" --replace_string="$new_path" --target_file="$config_path/network.xml" @@ -42,14 +35,12 @@ then fi fi -#================================================= -# GENERIC FINALISATION #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=2 +ynh_script_progression --message="Starting $app's systemd service..." --weight=2 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --timeout=15 +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --timeout=15 #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 9cb6105..a4bb507 100644 --- a/scripts/install +++ b/scripts/install @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -19,13 +17,26 @@ fi ynh_app_setting_set --app="$app" --key=config_path --value="$config_path" #================================================= -# STANDARD MODIFICATIONS +# SYSTEM CONFIGURATION +#=================================================ç +ynh_script_progression --message="Configuring the dedicated system user..." --weight=1 + +if getent group render && ! id -Gn "$app" | grep -qw "\brender\b" >/dev/null; then + # Add user to render group + adduser "$app" render +fi + #================================================= # OPEN PORTS #================================================= ynh_script_progression --message="Checking whether to open ports..." --weight=1 configure_jellyfin_discovery_ports install +ports_args=() +if [[ "${opened_ports:-__NOTHING__}" != "__NOTHING__" ]]; then + ports_args=( "--needs_exposed_ports" "${opened_ports[@]}" ) +fi + #================================================= # INSTALL PACKAGES #================================================= @@ -33,20 +44,6 @@ ynh_script_progression --message="Installing packages..." --weight=1 install_jellyfin_packages -#================================================= -# SYSTEM CONFIGURATION -#=================================================ç -ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 - -if getent group render && ! id -Gn "$app" | grep -qw "\brender\b" >/dev/null; then - # Add user to render group - adduser "$app" render -fi - -ynh_add_nginx_config - -#================================================= -# SPECIFIC SETUP #================================================= # ADD A CONFIGURATION #================================================= @@ -87,42 +84,29 @@ ynh_script_progression --message="Adding multimedia directories..." --weight=2 # Build YunoHost multimedia directories ynh_multimedia_build_main_dir + # Allow Jellyfin to write into these directories ynh_multimedia_addaccess "$app" #================================================= -# GENERIC FINALIZATION +# SYSTEM CONFIGURATION #================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." --weight=1 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 + +# Create a dedicated NGINX config using the conf/nginx.conf template +ynh_add_nginx_config + +ynh_add_config --template="systemd.service" --destination="/etc/systemd/system/jellyfin.service.d/baseurl.service.conf" +systemctl daemon-reload +yunohost service add "$app" --description="Jellyfin media center" "${ports_args[@]}" # Use logrotate to manage application logfile(s) ynh_use_logrotate -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -ports_args=() -if [[ "${opened_ports:-__NOTHING__}" != "__NOTHING__" ]]; then - ports_args+=('--needs_exposed_ports') - ports_args+=(${opened_ports}) -fi - -yunohost service add "$app" --description="Jellyfin media center" ${ports_args[@]} - -#================================================= -# EDIT SYSTEMD ENVIRONMENT VARIABLE FOR AUTO-DISCOVERY -#================================================= -ynh_add_config --template="systemd.service" --destination="/etc/systemd/system/jellyfin.service.d/baseurl.service.conf" -systemctl daemon-reload - #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression --message="Starting $app's systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --timeout=15 diff --git a/scripts/remove b/scripts/remove index df96e13..72d6d4e 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -9,24 +7,16 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD REMOVE -#================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST -#================================================= - -# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app >/dev/null -then - ynh_script_progression --message="Removing $app service integration..." --weight=3 - yunohost service remove "$app" -fi - #================================================= # REMOVE SYSTEM CONFIGURATIONS #================================================= ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 +# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) +if ynh_exec_warn_less yunohost service status "$app" >/dev/null; then + yunohost service remove "$app" +fi + ynh_remove_logrotate ynh_remove_nginx_config @@ -41,11 +31,10 @@ ynh_remove_app_dependencies #================================================= # CLOSE A PORT #================================================= -ynh_script_progression --message="Checking whether to open ports..." --weight=1 +ynh_script_progression --message="Closing ports..." --weight=1 + configure_jellyfin_discovery_ports remove -#================================================= -# SPECIFIC REMOVE #================================================= # REMOVE VARIOUS FILES #================================================= diff --git a/scripts/restore b/scripts/restore index 92cd497..d89fbb6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -10,8 +8,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD RESTORATION STEPS #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -29,6 +25,11 @@ fi ynh_script_progression --message="Checking whether to open ports..." --weight=1 configure_jellyfin_discovery_ports install +ports_args=() +if [[ "${opened_ports:-__NOTHING__}" != "__NOTHING__" ]]; then + ports_args=( "--needs_exposed_ports" "${opened_ports[@]}" ) +fi + #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -45,21 +46,14 @@ ynh_script_progression --message="Reinstalling packages..." --weight=7 install_jellyfin_packages -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE USER RIGHTS #================================================= ynh_script_progression --message="Restoring user rights..." # Restore permissions on app files -chown -R $app: $data_path -chown -R $app: $config_path +chown -R "$app:" "$data_path" +chown -R "$app:" "$config_path" #================================================= # YUNOHOST MULTIMEDIA INTEGRATION @@ -68,52 +62,29 @@ ynh_script_progression --message="Adding multimedia directories..." --weight=2 # Build YunoHost multimedia directories ynh_multimedia_build_main_dir + # Allow Jellyfin to write into these directories -ynh_multimedia_addaccess $app +ynh_multimedia_addaccess "$app" #================================================= -# RESTORE SYSTEMD +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/jellyfin.service.d" --not_mandatory systemctl enable jellyfin.service --quiet - -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 +yunohost service add "$app" --description="Jellyfin media center" "${ports_args[@]}" ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= -# INTEGRATE SERVICE IN YUNOHOST +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -ports_args=() -if [[ "${opened_ports:-__NOTHING__}" = "__NOTHING__" ]]; then - ports_args+=('--open-ports') - ports_args+=(${ports}) -fi - -yunohost service add "$app" --description="Jellyfin media center" "${ports_args[@]}" - - - -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 - -ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" --timeout=15 - -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX AND PHP-FPM -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +ynh_systemd_action --service_name="$app" --action="restart" --log_path="systemd" --timeout=15 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/update_version.py b/scripts/update_version.py index 9672210..9458e1f 100755 --- a/scripts/update_version.py +++ b/scripts/update_version.py @@ -36,7 +36,8 @@ class JellyfinDistro: return f"{JELLYFIN_REPO}/files/server/debian/stable/v{version}/amd64/jellyfin-web_{version}+deb{self.debian_number}_all.deb" def ffmpeg_url(self, version: str, arch: str) -> str: - return f"{JELLYFIN_REPO}/files/ffmpeg/debian/latest-6.x/{arch}/jellyfin-ffmpeg6_{version}-{self.debian_name}_{arch}.deb" + major = version.split(".")[0] + return f"{JELLYFIN_REPO}/files/ffmpeg/debian/{major}.x/{version}/{arch}/jellyfin-ffmpeg6_{version}-{self.debian_name}_{arch}.deb" def ldap_url(self, version: str) -> str: return f"{JELLYFIN_REPO}/files/plugin/ldap-authentication/ldap-authentication_{version}.zip" diff --git a/scripts/upgrade b/scripts/upgrade index a0fc1f8..bb71346 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -9,19 +7,10 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= -ynh_script_progression --message="Checking version..." - -upgrade_type=$(ynh_check_app_version_changed) - -#================================================= -# STANDARD UPGRADE STEPS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=1 +ynh_script_progression --message="Stopping $app's systemd service..." --weight=1 ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd" --timeout=15 @@ -61,6 +50,11 @@ fi ynh_script_progression --message="Checking whether to open ports..." --weight=1 configure_jellyfin_discovery_ports install +ports_args=() +if [[ "${opened_ports:-__NOTHING__}" != "__NOTHING__" ]]; then + ports_args=( "--needs_exposed_ports" "${opened_ports[@]}" ) +fi + #================================================= # UPGRADE PACKAGES #================================================= @@ -74,16 +68,6 @@ done install_jellyfin_packages -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 - -# Create a dedicated NGINX config -ynh_add_nginx_config - -#================================================= -# SPECIFIC UPGRADE #================================================= # UPDATE A CONFIG FILE #================================================= @@ -141,8 +125,8 @@ ynh_add_config --template="LDAP-Auth.xml" --destination="/var/lib/jellyfin/plugi #================================================= # Set permissions on app files -chown -R $app: $data_path -chown -R $app: $config_path +chown -R "$app:" "$data_path" +chown -R "$app:" "$config_path" #================================================= # YUNOHOST MULTIMEDIA INTEGRATION @@ -151,44 +135,32 @@ ynh_script_progression --message="Adding multimedia directories..." --weight=2 # Build YunoHost multimedia directories ynh_multimedia_build_main_dir + # Allow Jellyfin to write into these directories -ynh_multimedia_addaccess $app +ynh_multimedia_addaccess "$app" #================================================= -# GENERIC FINALIZATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 + +# Create a dedicated NGINX config +ynh_add_nginx_config + +ynh_add_config --template="systemd.service" --destination="/etc/systemd/system/jellyfin.service.d/baseurl.service.conf" +systemctl daemon-reload # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -ports_args=() -if [[ "${opened_ports:-__NOTHING__}" = "__NOTHING__" ]]; then - ports_args+=('--open-ports') - ports_args+=(${ports}) -fi - yunohost service add "$app" --description="Jellyfin media center" "${ports_args[@]}" -#================================================= -# EDIT SYSTEMD ENVIRONMENT VARIABLE FOR AUTO-DISCOVERY -#================================================= -ynh_add_config --template="systemd.service" --destination="/etc/systemd/system/jellyfin.service.d/baseurl.service.conf" -systemctl daemon-reload - #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression --message="Starting $app's systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" --timeout=15 +ynh_systemd_action --service_name="$app" --action="restart" --log_path="systemd" --timeout=15 #================================================= # END OF SCRIPT