1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jellyfin_ynh.git synced 2024-09-03 19:26:29 +02:00

Merge pull request #75 from YunoHost-Apps/testing

Testing
This commit is contained in:
tituspijean 2021-06-19 14:02:50 +02:00 committed by GitHub
commit c89ce94626
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 321 additions and 121 deletions

View file

@ -1,3 +1,8 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# Jellyfin for YunoHost
[![Integration level](https://dash.yunohost.org/integration/jellyfin.svg)](https://dash.yunohost.org/appci/app/jellyfin) ![](https://ci-apps.yunohost.org/ci/badges/jellyfin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/jellyfin.maintain.svg)
@ -5,59 +10,39 @@
*[Lire ce readme en français.](./README_fr.md)*
> *This package allows you to install Jellyfin quickly and simply on a YunoHost server.
> *This package allows you to install Jellyfin quickly and simply on a YunoHost server.
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## Overview
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.7.5
Media System that manage and stream your media.
**Shipped version:** 10.7.6~ynh1
**Demo:** https://demo.jellyfin.org/stable/web/index.html
## Screenshots
![](https://jellyfin.org/images/screenshots/movie_full.png)
![](./doc/screenshots/jellyfin.png)
## Demo
## Disclaimers / important information
* [Official demo](https://demo.jellyfin.org/)
* The app relies on YunoHost's LDAP server for users to log in:
* Standard users need the `main` permission;
* Users with the `admin` permission will have access to the administration panel.
## Configuration
* Starting version 10.7.5~ynh2, you can ask for the discovery ports (1900 and 7359) to be opened.
They ease the setting up of your media center between clients and server.
* If you are upgrading to this version and above, set `discovery: '1'` in `/etc/yunohost/apps/jellyfin/settings.yml`
if you want the upgrade to open them for you.
* How to configure this app: From an admin panel.
## Documentation and resources
## Documentation
* Official documentation: https://jellyfin.org/docs/
* YunoHost documentation: If specific documentation is needed, feel free to contribute.
## YunoHost specific features
#### Multi-user support
* Are LDAP and HTTP auth supported? **Yes**
* Can the app be used by multiple users? **Yes**
#### Supported architectures
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/jellyfin%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/jellyfin/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/jellyfin%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/jellyfin/)
## Limitations
* Any known limitations.
## Additional information
* Other info you would like to add about this app.
## Links
* Report a bug: https://github.com/YunoHost-Apps/jellyfin_ynh/issues
* App website: https://jellyfin.org/
* Upstream app repository: https://github.com/jellyfin/jellyfin
* YunoHost website: https://yunohost.org/
---
* Official app website: https://jellyfin.org
* Official user documentation: https://jellyfin.org/docs/
* Upstream app code repository: https://github.com/jellyfin/jellyfin
* YunoHost documentation for this app: https://yunohost.org/app_jellyfin
* Report a bug: https://github.com/YunoHost-Apps/jellyfin_ynh/issues
## Developer info
@ -69,3 +54,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/jellyfin_ynh/tree/tes
or
sudo yunohost app upgrade jellyfin -u https://github.com/YunoHost-Apps/jellyfin_ynh/tree/testing --debug
```
**More info regarding app packaging:** https://yunohost.org/packaging_apps

View file

@ -4,60 +4,41 @@
[![Installer Jellyfin avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=jellyfin)
*[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer Jellyfin rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.*
> *Ce package vous permet d'installer Jellyfin rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
## Vue d'ensemble
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.7.5
Système multimédia qui gère et diffuse vos médias.
**Version incluse :** 10.7.6~ynh1
**Démo :** https://demo.jellyfin.org/stable/web/index.html
## Captures d'écran
![](https://jellyfin.org/images/screenshots/movie_full.png)
![](./doc/screenshots/jellyfin.png)
## Démo
## Avertissements / informations importantes
* [Démo officielle](https://demo.jellyfin.org/)
* L'app repose sur le serveur LDAP de YunoHost pour gérer les connexions:
* Les utilisateurs standards doivent avoir la permission `main` ;
* Les utilisateurs doivent avoir la permission `admin` pour pouvoir accéder au panneau d'administration.
## Configuration
* À partir de la version 10.7.5~ynh2, vous pouvez demander l'ouverture des ports de découverte (1900 et 7359).
Ils facilitent la mise en place de votre système multimédia entre les clients et le serveur.
* Si vous mettez à jour vers cette version et les suivantes, mettez `discovery: '1'` dans `/etc/yunohost/apps/jellyfin/settings.yml`
si vous voulez que la mise à jour les ouvre pour vous.
Comment configurer cette application : via le panneau d'administration.
## Documentations et ressources
## Documentation
* Documentation officielle : https://jellyfin.org/docs/
* Documentation YunoHost : Si une documentation spécifique est nécessaire, n'hésitez pas à contribuer.
## Caractéristiques spécifiques YunoHost
#### Support multi-utilisateur
* L'authentification LDAP et HTTP est-elle prise en charge ? **Oui**
* L'application peut-elle être utilisée par plusieurs utilisateurs ? **Oui**
#### Architectures supportées
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/jellyfin%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/jellyfin/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/jellyfin%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/jellyfin/)
## Limitations
* Limitations connues.
## Informations additionnelles
* Autres informations que vous souhaitez ajouter sur cette application.
## Liens
* Signaler un bug : https://github.com/YunoHost-Apps/jellyfin_ynh/issues
* Site de l'application : https://jellyfin.org/
* Dépôt de l'application principale : https://github.com/jellyfin/jellyfin
* Site web YunoHost : https://yunohost.org/
---
* Site officiel de l'app : https://jellyfin.org
* Documentation officielle utilisateur : https://jellyfin.org/docs/
* Dépôt de code officiel de l'app : https://github.com/jellyfin/jellyfin
* Documentation YunoHost pour cette app : https://yunohost.org/app_jellyfin
* Signaler un bug : https://github.com/YunoHost-Apps/jellyfin_ynh/issues
## Informations pour les développeurs
@ -69,3 +50,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/jellyfin_ynh/tree/tes
ou
sudo yunohost app upgrade jellyfin -u https://github.com/YunoHost-Apps/jellyfin_ynh/tree/testing --debug
```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps

View file

@ -9,6 +9,7 @@
path="/path" (PATH)
admin="john" (USER)
is_public=1 (PUBLIC|public=1|private=0)
discovery=1
; Checks
pkg_linter=1
setup_sub_dir=1
@ -25,6 +26,7 @@
#upgrade=1 from_commit=5478712c0ca7683503bc1b50cfafe81ea508065e
# 10.7.0~ynh1
#upgrade=1 from_commit=63ab03ab79cc088a52b8a36fb4fdf5918bf0e14b
upgrade=1 from_commit=8ed403b30a8d3e61e2d3bf5bc8d3f4cae1ed80b6
backup_restore=1
multi_instance=0
port_already_use=0
@ -41,3 +43,5 @@ Notification=none
name=10.6.4~ynh3
; commit=63ab03ab79cc088a52b8a36fb4fdf5918bf0e14b
name=10.7.0~ynh1
; commit=8ed403b30a8d3e61e2d3bf5bc8d3f4cae1ed80b6
name=10.7.5~ynh1

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.7.5/jellyfin-server_10.7.5-1_amd64.deb
SOURCE_SUM=5b3c1fe15a1b701311e8b07a9b15f6d7a45e58d4e3b388bdf8e3afe9530483d5
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.7.6/jellyfin-server_10.7.6-1_amd64.deb
SOURCE_SUM=d4f196e7082f80edc9167975a627b3cb23e922b086c5d695c1b747875d2f5888
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.7.5/jellyfin-server_10.7.5-1_arm64.deb
SOURCE_SUM=01da7e3250c7b32b0090680db0199f86130171b1c7e499557f339827ffce6185
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.7.6/jellyfin-server_10.7.6-1_arm64.deb
SOURCE_SUM=d6e93f138f5c7583068c0421a6af27d30c7b970ca4c6d62ed9801c57128af5bb
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.7.5/jellyfin-server_10.7.5-1_armhf.deb
SOURCE_SUM=2418ab32fb13217a138229aad8101876bc221375fc9b3194e6c2f2b8b7d998f4
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.7.6/jellyfin-server_10.7.6-1_armhf.deb
SOURCE_SUM=d438b9e04b5ee6cc53a5d5b6418bec818c9eb8e20f469daaca1cc27327e5f96a
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/10.7.5/jellyfin-web_10.7.5-1_all.deb
SOURCE_SUM=294a00e7a63c1a7f826e4da798663e872d2f2d227061b60253ac9cecd8642301
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/10.7.6/jellyfin-web_10.7.6-1_all.deb
SOURCE_SUM=4c2741f029da19b028c2a66559df33ef128065a97fc4187065a7497e61998ff5
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/10.7.5/jellyfin-web_10.7.5-1_all.deb
SOURCE_SUM=294a00e7a63c1a7f826e4da798663e872d2f2d227061b60253ac9cecd8642301
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/10.7.6/jellyfin-web_10.7.6-1_all.deb
SOURCE_SUM=4c2741f029da19b028c2a66559df33ef128065a97fc4187065a7497e61998ff5
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/10.7.5/jellyfin-web_10.7.5-1_all.deb
SOURCE_SUM=294a00e7a63c1a7f826e4da798663e872d2f2d227061b60253ac9cecd8642301
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/10.7.6/jellyfin-web_10.7.6-1_all.deb
SOURCE_SUM=4c2741f029da19b028c2a66559df33ef128065a97fc4187065a7497e61998ff5
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false

0
doc/.gitkeep Normal file
View file

8
doc/DISCLAIMER.md Normal file
View file

@ -0,0 +1,8 @@
* The app relies on YunoHost's LDAP server for users to log in:
* Standard users need the `main` permission;
* Users with the `admin` permission will have access to the administration panel.
* Starting version 10.7.5~ynh2, you can ask for the discovery ports (1900 and 7359) to be opened.
They ease the setting up of your media center between clients and server.
* If you are upgrading to this version and above, set `discovery: '1'` in `/etc/yunohost/apps/jellyfin/settings.yml`
if you want the upgrade to open them for you.

8
doc/DISCLAIMER_fr.md Normal file
View file

@ -0,0 +1,8 @@
* L'app repose sur le serveur LDAP de YunoHost pour gérer les connexions:
* Les utilisateurs standards doivent avoir la permission `main` ;
* Les utilisateurs doivent avoir la permission `admin` pour pouvoir accéder au panneau d'administration.
* À partir de la version 10.7.5~ynh2, vous pouvez demander l'ouverture des ports de découverte (1900 et 7359).
Ils facilitent la mise en place de votre système multimédia entre les clients et le serveur.
* Si vous mettez à jour vers cette version et les suivantes, mettez `discovery: '1'` dans `/etc/yunohost/apps/jellyfin/settings.yml`
si vous voulez que la mise à jour les ouvre pour vous.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View file

@ -6,13 +6,26 @@
"en": "Media System that manage and stream your media.",
"fr": "Système multimédia qui gère et diffuse vos médias."
},
"version": "10.7.5~ynh1",
"url": "https://github.com/jellyfin/jellyfin",
"version": "10.7.6~ynh1",
"url": "https://jellyfin.org",
"upstream": {
"license": "GPL-2.0-only",
"website": "https://jellyfin.org",
"demo": "https://demo.jellyfin.org/stable/web/index.html",
"userdoc": "https://jellyfin.org/docs/",
"code": "https://github.com/jellyfin/jellyfin"
},
"license": "GPL-2.0-only",
"maintainer": {
"name": "liberodark",
"email": "liberodark@gmail.com"
"name": "tituspijean",
"email": "tituspijean@outlook.com"
},
"previous_maintainers": [
{
"name": "liberodark",
"email": "liberodark@gmail.com"
}
],
"requirements": {
"yunohost": ">= 4.1.3"
},
@ -46,6 +59,19 @@
"en": "Jellyfin has its own login system, you should make it public to let external clients access it (mobile app, etc.).",
"fr": "Jellyfin a son propre système de connexion, vous devriez la laisser publique pour permettre la connexion de clients externes (app mobile, etc.)."
}
},
{
"name": "discovery",
"type": "boolean",
"default": true,
"ask": {
"en": "Should the ports for client and server discovery be opened?",
"fr": "Est-ce que les ports pour la découverte entre clients et serveur doivent être ouverts ?"
},
"help": {
"en": "Enable discovery if you use Jellyfin on your local network or through a VPN to smoothen detection between clients and server. If it is installed on a VPS and only accessed via its web interface, you should disable discovery.",
"fr": "Activez la découverte si vous utilisez Jellyfin sur votre réseau local ou via un VPN pour simplifier la détection entre clients et serveur. S'il est installé sur un VPS et utilisé uniquement via son interface web, vous devriez désactiver la découverte."
}
}
]
}

View file

@ -5,13 +5,16 @@
#=================================================
debian=$(lsb_release --codename --short)
pkg_version="10.7.5-1"
pkg_version="10.7.6-1"
version=$(echo "$pkg_version" | cut -d '-' -f 1)
ffmpeg_pkg_version="4.3.2-1"
architecture=$(dpkg --print-architecture)
discovery_service_port=1900
discovery_client_port=7359
#=================================================
# PERSONAL HELPERS
#=================================================

View file

@ -51,16 +51,24 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP VARIOUS FILES
# BACKUP LOGROTATE
#=================================================
ynh_backup --src_path="/etc/logrotate.d/$app"
#=================================================
# BACKUP SYSTEMD
#=================================================
ynh_backup --src_path="/etc/systemd/system/jellyfin.service.d" --not_mandatory
ynh_backup --src_path="/lib/systemd/system/jellyfin.service"
#=================================================
# BACKUP VARIOUS FILES
#=================================================
ynh_backup --src_path="$config_path"
ynh_backup --src_path="/etc/default/jellyfin" --not_mandatory
#=================================================
# END OF SCRIPT

View file

@ -27,6 +27,7 @@ domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC
discovery=$YNH_APP_ARG_DISCOVERY
app=$YNH_APP_INSTANCE_NAME
@ -56,6 +57,7 @@ ynh_script_progression --message="Storing installation settings..." --weight=2
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=discovery --value=$discovery
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
ynh_app_setting_set --app=$app --key=config_path --value=$config_path
@ -70,6 +72,32 @@ ynh_script_progression --message="Finding an available port..." --weight=1
port=$(ynh_find_port --port=8095)
ynh_app_setting_set --app=$app --key=port --value=$port
discovery_service=$discovery
discovery_client=$discovery
if [ $discovery -eq 1 ]; then
ynh_script_progression --message="Configuring firewall..." --weight=1
# Open port 1900 for service auto-discovery
if ynh_port_available --port=$discovery_service_port; then
ynh_exec_warn_less yunohost firewall allow UDP $discovery_service_port
else
discovery_service=0
ynh_print_warn --message="Port $discovery_service_port (for service auto-discovery) is not available. Continuing nonetheless."
fi
# Open port 7359 for client auto-discovery
if ynh_port_available --port=$discovery_client_port; then
ynh_exec_warn_less yunohost firewall allow UDP $discovery_client_port
else
discovery_client=0
ynh_print_warn --message="Port $discovery_client_port (for client auto-discovery) is not available. Continuing nonetheless."
fi
fi
ynh_app_setting_set --app=$app --key=discovery_service --value=$discovery_service
ynh_app_setting_set --app=$app --key=discovery_client --value=$discovery_client
#=================================================
# INSTALL DEPENDENCIES
#=================================================
@ -114,6 +142,9 @@ fi
#=================================================
ynh_script_progression --message="Configuring the settings..." --weight=1
# Set permissions to app files
chown -R $app: $final_path
# Load services once to generate system.xml
ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" --line_match="Started Jellyfin Media Server" --timeout=15
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped Jellyfin Media Server" --timeout=15
@ -122,6 +153,9 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --li
ynh_replace_string --match_string="<PublicPort>8096</PublicPort>" --replace_string="<PublicPort>$port</PublicPort>" --target_file="$config_path/network.xml"
ynh_replace_string --match_string="<HttpServerPortNumber>8096</HttpServerPortNumber>" --replace_string="<HttpServerPortNumber>$port</HttpServerPortNumber>" --target_file="$config_path/network.xml"
# Enable IPv6
ynh_replace_string --match_string="<EnableIPV6>false</EnableIPV6>" --replace_string="<EnableIPV6>true</EnableIPV6>" --target_file="$config_path/network.xml"
# BaseUrl config
ynh_replace_string --match_string="<BaseUrl />" --replace_string="<BaseUrl>$path_url</BaseUrl>" --target_file="$config_path/network.xml"
@ -153,6 +187,7 @@ ynh_script_progression --message="Securing files and directories..."
# Set permissions to app files
chown -R $app: $final_path
chown -R $app: $config_path
#=================================================
# SETUP LOGROTATE
@ -167,7 +202,17 @@ ynh_use_logrotate
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Jellyfin media center" --log_type="systemd"
# Build the ports list
needed_ports=()
(( $discovery_service == 1 )) && needed_ports+=( "$discovery_service_port" )
(( $discovery_client == 1 )) && needed_ports+=( "$discovery_client_port" )
# Integrate service and require to expose the ports if needed
if [[ -z ${needed_ports[@]} ]]; then
yunohost service add $app --description="Jellyfin media center" --log_type="systemd"
else
yunohost service add $app --description="Jellyfin media center" --log_type="systemd" --needs_exposed_ports ${needed_ports[@]}
fi
#=================================================
# START SYSTEMD SERVICE

View file

@ -17,6 +17,8 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
discovery_client=$(ynh_app_setting_get --app=$app --key=discovery_client)
discovery_service=$(ynh_app_setting_get --app=$app --key=discovery_service)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
@ -68,6 +70,22 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight=
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# CLOSE A PORT
#=================================================
if [[ $discovery_service -eq 1 ]] && yunohost firewall list | grep -q "\- 1900$"
then
ynh_script_progression --message="Closing port 1900..." --weight=1
ynh_exec_warn_less yunohost firewall disallow UDP 1900
fi
if [[ $discovery_client -eq 1 ]] && yunohost firewall list | grep -q "\- 7359$"
then
ynh_script_progression --message="Closing port 7359..." --weight=1
ynh_exec_warn_less yunohost firewall disallow UDP 7359
fi
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -31,6 +31,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
discovery=$(ynh_app_setting_get --app=$app --key=discovery)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
@ -51,6 +52,36 @@ fi
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# OPEN PORTS
#=================================================
discovery_service=$discovery
discovery_client=$discovery
if [ $discovery -eq 1 ]; then
ynh_script_progression --message="Configuring firewall..." --weight=1
# Open port 1900 for service auto-discovery
if ynh_port_available --port=$discovery_service_port; then
ynh_exec_warn_less yunohost firewall allow UDP $discovery_service_port
else
discovery_service=0
ynh_print_warn --message="Port $discovery_service_port (for service auto-discovery) is not available. Continuing nonetheless."
fi
# Open port 7359 for client auto-discovery
if ynh_port_available --port=$discovery_client_port; then
ynh_exec_warn_less yunohost firewall allow UDP $discovery_client_port
else
discovery_client=0
ynh_print_warn --message="Port $discovery_client_port (for client auto-discovery) is not available. Continuing nonetheless."
fi
fi
ynh_app_setting_set --app=$app --key=discovery_service --value=$discovery_service
ynh_app_setting_set --app=$app --key=discovery_client --value=$discovery_client
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
@ -65,6 +96,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$final_path"
ynh_restore_file --origin_path="$config_path"
ynh_restore_file --origin_path="/etc/default/jellyfin" --not_mandatory
#=================================================
# RECREATE THE DEDICATED USER
@ -74,14 +106,6 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app
#=================================================
# RESTORE USER RIGHTS
#=================================================
ynh_script_progression --message="Restoring user rights..."
# Restore permissions on app files
chown -R $app: $final_path
#=================================================
# SPECIFIC RESTORATION
#=================================================
@ -102,12 +126,40 @@ ynh_exec_warn_less apt-get -f install $tempdir/jellyfin-ffmpeg.deb -y -o Dpkg::O
ynh_exec_warn_less apt-get -f install $tempdir/jellyfin-server.deb -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold
ynh_exec_warn_less apt-get -f install $tempdir/jellyfin-web.deb -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold
#=================================================
# RESTORE SYSTEMD
#=================================================
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
ynh_restore_file --origin_path="/etc/systemd/system/jellyfin.service.d" --not_mandatory
ynh_restore_file --origin_path="/lib/systemd/system/jellyfin.service"
systemctl enable jellyfin.service --quiet
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Jellyfin media center" --log_type="systemd"
# Build the ports list
needed_ports=()
(( $discovery_service == 1 )) && needed_ports+=( "$discovery_service_port" )
(( $discovery_client == 1 )) && needed_ports+=( "$discovery_client_port" )
# Integrate service and require to expose the ports if needed
if [[ -z ${needed_ports[@]} ]]; then
yunohost service add $app --description="Jellyfin media center" --log_type="systemd"
else
yunohost service add $app --description="Jellyfin media center" --log_type="systemd" --needs_exposed_ports ${needed_ports[@]}
fi
#=================================================
# RESTORE USER RIGHTS
#=================================================
ynh_script_progression --message="Restoring user rights..."
# Restore permissions on app files
chown -R $app: $final_path
chown -R $app: $config_path
#=================================================
# START SYSTEMD SERVICE

View file

@ -74,9 +74,7 @@ for architecture in "${architectures[@]}"; do
prepare_source --template="../conf/server.src.default" --destination="../conf/server.$architecture.src" --architecture="$architecture"
done
sed -i "s#\*\*Shipped version:\*\*.*#\*\*Shipped version:\*\* ${version}#" ../README.md
sed -i "s#\*\*Version incluse :\*\*.*#\*\*Version incluse :\*\* ${version}#" ../README_fr.md
sed -i "s# \"version\": \".*# \"version\": \"${version}\~ynh1\",#" ../manifest.json
git add .
git commit ../README.md ../README_fr.md ../manifest.json ../conf/ffmpeg.*.src ../conf/web.*.src ../conf/server.*.src -m "Upgrade to v$version"
git commit _common.sh ../manifest.json ../conf/ffmpeg.*.src ../conf/web.*.src ../conf/server.*.src -m "Upgrade to v$version"

View file

@ -21,6 +21,7 @@ admin=$(ynh_app_setting_get --app=$app --key=admin)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
port=$(ynh_app_setting_get --app=$app --key=port)
discovery=$(ynh_app_setting_get --app=$app --key=discovery)
#=================================================
# CHECK VERSION
@ -39,11 +40,12 @@ if [[ ! "$architecture" =~ ^(amd64|arm64|armhf)$ ]]; then
ynh_die "Jellyfin is not compatible with your architecture, $architecture, which is neither amd64, arm64, or armhf." 1
fi
# If path keys do not exist, create it
if [ -z "$config_path" ]; then
config_path=/var/lib/jellyfin
# If path keys do not exist, create them
# If config_path is mixed up with final_path, fix them
if [ -z "$config_path" ] || [[ $config_path = "/var/lib/jellyfin" ]]; then
config_path=/etc/jellyfin
final_path=/var/lib/jellyfin
ynh_app_setting_set --app=$app --key=config_path --value=$config_path
final_path=/etc/jellyfin
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi
@ -64,6 +66,12 @@ if ! ynh_permission_exists --permission="admin"; then
ynh_permission_create --permission="admin" --allowed=$admin
fi
# If discovery key does not exist, create it
if [ -z "$discovery" ]; then
discovery=0
ynh_app_setting_set --app=$app --key=discovery --value=$discovery
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -80,6 +88,37 @@ ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# OPEN PORTS
#=================================================
discovery_service=$discovery
discovery_client=$discovery
if [ $discovery -eq 1 ]; then
ynh_script_progression --message="Configuring firewall..." --weight=1
# Open port 1900 for service auto-discovery
if ynh_port_available --port=$discovery_service_port; then
ynh_exec_warn_less yunohost firewall allow UDP $discovery_service_port
else
discovery_service=0
ynh_print_warn --message="Port $discovery_service_port (for service auto-discovery) is not available. Continuing nonetheless."
fi
# Open port 7359 for client auto-discovery
if ynh_port_available --port=$discovery_client_port; then
ynh_exec_warn_less yunohost firewall allow UDP $discovery_client_port
else
discovery_client=0
ynh_print_warn --message="Port $discovery_client_port (for client auto-discovery) is not available. Continuing nonetheless."
fi
fi
ynh_app_setting_set --app=$app --key=discovery_service --value=$discovery_service
ynh_app_setting_set --app=$app --key=discovery_client --value=$discovery_client
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
@ -126,12 +165,15 @@ ynh_system_user_create --username=$app
#=================================================
# Check if network.xml exists (introduced in v10.7)
if [ -z "/etc/jellyfin/network.xml" ]; then
if [ -f "/etc/jellyfin/network.xml" ]; then
ynh_script_progression --message="Configuring the settings..." --weight=1
ynh_backup_if_checksum_is_different --file="$config_path/network.xml"
ynh_backup_if_checksum_is_different --file="$config_path/system.xml"
# Set permissions to app files
chown -R $app: $final_path
# Load services once to generate network.xml
ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" --line_match="Started Jellyfin Media Server" --timeout=15
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped Jellyfin Media Server" --timeout=15
@ -140,6 +182,9 @@ if [ -z "/etc/jellyfin/network.xml" ]; then
ynh_replace_string --match_string="<PublicPort>8096</PublicPort>" --replace_string="<PublicPort>$port</PublicPort>" --target_file="$config_path/network.xml"
ynh_replace_string --match_string="<HttpServerPortNumber>8096</HttpServerPortNumber>" --replace_string="<HttpServerPortNumber>$port</HttpServerPortNumber>" --target_file="$config_path/network.xml"
# Enable IPv6
ynh_replace_string --match_string="<EnableIPV6>false</EnableIPV6>" --replace_string="<EnableIPV6>true</EnableIPV6>" --target_file="$config_path/network.xml"
# BaseUrl config
ynh_replace_string --match_string="<BaseUrl />" --replace_string="<BaseUrl>$path_url</BaseUrl>" --target_file="$config_path/network.xml"
@ -148,7 +193,11 @@ if [ -z "/etc/jellyfin/network.xml" ]; then
fi
# Lower logging verbosity
ynh_replace_string --match_string="\"Default\": \"Information\"" --replace_string="\"Default\": \"Error\"" --target_file="$config_path/logging.json"
# But first, if missing, copy it from its template
if [ ! -f "$config_path/logging.json" ]; then
cp "$config_path/logging.default.json" "$config_path/logging.json"
fi
ynh_exec_fully_quiet ynh_replace_string --match_string="\"Default\": \"Information\"" --replace_string="\"Default\": \"Error\"" --target_file="$config_path/logging.json"
#=================================================
# INSTALL LDAP PLUGIN
@ -171,6 +220,7 @@ fi
# Set permissions on app files
chown -R $app: $final_path
chown -R $app: $config_path
#=================================================
# SETUP LOGROTATE
@ -185,7 +235,17 @@ ynh_use_logrotate --non-append
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Jellyfin media center" --log_type="systemd"
# Build the ports list
needed_ports=()
(( $discovery_service == 1 )) && needed_ports+=( "$discovery_service_port" )
(( $discovery_client == 1 )) && needed_ports+=( "$discovery_client_port" )
# Integrate service and require to expose the ports if needed
if [[ -z ${needed_ports[@]} ]]; then
yunohost service add $app --description="Jellyfin media center" --log_type="systemd"
else
yunohost service add $app --description="Jellyfin media center" --log_type="systemd" --needs_exposed_ports ${needed_ports[@]}
fi
#=================================================
# START SYSTEMD SERVICE