mirror of
https://github.com/YunoHost-Apps/jellyfin_ynh.git
synced 2024-09-03 19:26:29 +02:00
Testing (#143)
* Manifestv2 * add back user and install_dir to manifest * Update manifest.toml * rewrite update_version.sh in python for toml * Bump jellyfin-ffmpeg to 6.0-6 as #136 (Thanks @Tagadda) * Only add user to render group if not already * Remove line_match from ynh_systemd_actions : they actually just match when systemctl returns * Fix upgrade: uninstall previous packages * Installation of deb packages will overwrite the configuration files, so to prevent a warning we backup those files beforehand. * Test with a long sleep * Auto-update README * update_version: fix linter * Add ldap to update_version.py * Revert sleep 30 from debugging * Do not remove packages during upgrade * Fix upgrade again --------- Co-authored-by: Félix Piédallu <felix@piedallu.me> Co-authored-by: yunohost-bot <yunohost@yunohost.org>
This commit is contained in:
parent
d38c24f378
commit
6a3fa81973
43 changed files with 387 additions and 909 deletions
19
README.md
19
README.md
|
@ -19,27 +19,14 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
|
||||||
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.
|
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.8.11~ynh2
|
**Shipped version:** 10.8.11~ynh3
|
||||||
|
|
||||||
**Demo:** https://demo.jellyfin.org/stable/web/index.html
|
**Demo:** https://demo.jellyfin.org/stable/web/index.html
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||

|

|
||||||
|

|
||||||
## Disclaimers / important information
|
|
||||||
|
|
||||||
* 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.
|
|
||||||
|
|
||||||
* The app can access YunoHost's multimedia directories:
|
|
||||||
choose one of the folders in `/home/yunohost.multimedia/share` upon configuration of your libraries.
|
|
||||||
|
|
||||||
* 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.
|
|
||||||
|
|
||||||
## Documentation and resources
|
## Documentation and resources
|
||||||
|
|
||||||
|
|
19
README_fr.md
19
README_fr.md
|
@ -19,27 +19,14 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po
|
||||||
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.
|
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.8.11~ynh2
|
**Version incluse :** 10.8.11~ynh3
|
||||||
|
|
||||||
**Démo :** https://demo.jellyfin.org/stable/web/index.html
|
**Démo :** https://demo.jellyfin.org/stable/web/index.html
|
||||||
|
|
||||||
## Captures d’écran
|
## Captures d’écran
|
||||||
|
|
||||||

|

|
||||||
|

|
||||||
## Avertissements / informations importantes
|
|
||||||
|
|
||||||
* 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.
|
|
||||||
|
|
||||||
* L'app a accès aux dossiers multimédia de YunoHost:
|
|
||||||
indiquez un des dossiers de `/home/yunohost.multimedia/share` comme source lors du paramétrage de vos bibliothèques.
|
|
||||||
|
|
||||||
* À 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.
|
|
||||||
|
|
||||||
## Documentations et ressources
|
## Documentations et ressources
|
||||||
|
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
;; Test complet
|
|
||||||
; Manifest
|
|
||||||
domain="domain.tld"
|
|
||||||
path="/path"
|
|
||||||
is_public=1
|
|
||||||
admin="john"
|
|
||||||
discovery=1
|
|
||||||
; Checks
|
|
||||||
pkg_linter=1
|
|
||||||
setup_sub_dir=1
|
|
||||||
setup_root=1
|
|
||||||
setup_nourl=0
|
|
||||||
setup_private=1
|
|
||||||
setup_public=1
|
|
||||||
upgrade=1
|
|
||||||
# 10.8.0~ynh1
|
|
||||||
upgrade=1 from_commit=384dcd2ff1dbf4b0085edb7f12e4d15f00508e2b
|
|
||||||
backup_restore=1
|
|
||||||
multi_instance=0
|
|
||||||
port_already_use=0
|
|
||||||
change_url=1
|
|
||||||
;;; Options
|
|
||||||
Email=
|
|
||||||
Notification=none
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/5.1.2-6/jellyfin-ffmpeg5_5.1.2-6-bullseye_amd64.deb
|
|
||||||
SOURCE_SUM=3dbb0fa5d32abe7fe5b9706f230180300a180707cdebda88b013462333dcdfcc
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-ffmpeg5.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/5.1.2-6/jellyfin-ffmpeg5_5.1.2-6-bullseye_arm64.deb
|
|
||||||
SOURCE_SUM=d3785119cdf5263f91c968c9bc0c4d8ac89c489141441e6320f224bf0b2072e6
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-ffmpeg5.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/5.1.2-6/jellyfin-ffmpeg5_5.1.2-6-bullseye_armhf.deb
|
|
||||||
SOURCE_SUM=f29c51a4ff70655777f5f106847d8fac86786646e9d7af60420c748c4c8df3fe
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-ffmpeg5.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/5.1.2-6/jellyfin-ffmpeg5_5.1.2-6-buster_amd64.deb
|
|
||||||
SOURCE_SUM=1e64a9819fd0bef5b77ba5e3136b63b293b0985519a8a51ebc8168c9eeb76cac
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-ffmpeg5.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/5.1.2-6/jellyfin-ffmpeg5_5.1.2-6-buster_arm64.deb
|
|
||||||
SOURCE_SUM=c52297fc7783a072bf042dfd924b7cfe7e169f63389398d43afb8be81059b70f
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-ffmpeg5.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/5.1.2-6/jellyfin-ffmpeg5_5.1.2-6-buster_armhf.deb
|
|
||||||
SOURCE_SUM=4a5cec25a7f3468b5e779e6317bc85d69d909bea3fb8a36e75bfdb773546e94b
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-ffmpeg5.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/__FFMPEG_PKG_VERSION__/jellyfin-ffmpeg5___FFMPEG_PKG_VERSION__-__DEBIAN_____ARCHITECTURE__.deb
|
|
||||||
SOURCE_SUM=https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/__FFMPEG_PKG_VERSION__/jellyfin-ffmpeg5___FFMPEG_PKG_VERSION__-__DEBIAN_____ARCHITECTURE__.deb.sha256sum
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-ffmpeg5.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/plugin/ldap-authentication/ldap-authentication_16.0.0.0.zip
|
|
||||||
SOURCE_SUM=8857a7dbe8bd08db2a8c10621d388424a389a9f0d98253dbd0ea229310d5cf7f
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=zip
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_FILENAME=
|
|
||||||
SOURCE_EXTRACT=true
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/plugin/ldap-authentication/ldap-authentication___LDAP_PKG_VERSION__.zip
|
|
||||||
SOURCE_SUM=none
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=zip
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_FILENAME=
|
|
||||||
SOURCE_EXTRACT=true
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.8.11/jellyfin-server_10.8.11-1_amd64.deb
|
|
||||||
SOURCE_SUM=8d512bf3d457c8cd92ade0cd32ce99d70f5549677779404ae89413ec77248e87
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-server.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.8.11/jellyfin-server_10.8.11-1_arm64.deb
|
|
||||||
SOURCE_SUM=a1d132fbf624e9745e43a6600f6364ff15e86c8cf75950a5a44b7a20e6fd41ca
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-server.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.8.11/jellyfin-server_10.8.11-1_armhf.deb
|
|
||||||
SOURCE_SUM=f35d0cda50b22be9d5480f68db70bf1b66f0a974d93739a333fa540e941147d1
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-server.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.8.11/jellyfin-server_10.8.11-1_amd64.deb
|
|
||||||
SOURCE_SUM=8d512bf3d457c8cd92ade0cd32ce99d70f5549677779404ae89413ec77248e87
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-server.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.8.11/jellyfin-server_10.8.11-1_arm64.deb
|
|
||||||
SOURCE_SUM=a1d132fbf624e9745e43a6600f6364ff15e86c8cf75950a5a44b7a20e6fd41ca
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-server.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.8.11/jellyfin-server_10.8.11-1_armhf.deb
|
|
||||||
SOURCE_SUM=f35d0cda50b22be9d5480f68db70bf1b66f0a974d93739a333fa540e941147d1
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-server.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/__VERSION__/jellyfin-server___PKG_VERSION_____ARCHITECTURE__.deb
|
|
||||||
SOURCE_SUM=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/__VERSION__/jellyfin-server___PKG_VERSION_____ARCHITECTURE__.deb.sha256sum
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-server.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/10.8.11/jellyfin-web_10.8.11-1_all.deb
|
|
||||||
SOURCE_SUM=9875062909d8a4e7081a50c5aac2fb6378edfeebccb0830a6eadd7e0d04b7f6d
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-web.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/10.8.11/jellyfin-web_10.8.11-1_all.deb
|
|
||||||
SOURCE_SUM=9875062909d8a4e7081a50c5aac2fb6378edfeebccb0830a6eadd7e0d04b7f6d
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-web.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/10.8.11/jellyfin-web_10.8.11-1_all.deb
|
|
||||||
SOURCE_SUM=9875062909d8a4e7081a50c5aac2fb6378edfeebccb0830a6eadd7e0d04b7f6d
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-web.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/10.8.11/jellyfin-web_10.8.11-1_all.deb
|
|
||||||
SOURCE_SUM=9875062909d8a4e7081a50c5aac2fb6378edfeebccb0830a6eadd7e0d04b7f6d
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-web.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/10.8.11/jellyfin-web_10.8.11-1_all.deb
|
|
||||||
SOURCE_SUM=9875062909d8a4e7081a50c5aac2fb6378edfeebccb0830a6eadd7e0d04b7f6d
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-web.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/10.8.11/jellyfin-web_10.8.11-1_all.deb
|
|
||||||
SOURCE_SUM=9875062909d8a4e7081a50c5aac2fb6378edfeebccb0830a6eadd7e0d04b7f6d
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-web.deb
|
|
|
@ -1,7 +0,0 @@
|
||||||
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/__VERSION__/jellyfin-web___PKG_VERSION___all.deb
|
|
||||||
SOURCE_SUM=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/__VERSION__/jellyfin-web___PKG_VERSION___all.deb.sha256sum
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=deb
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_EXTRACT=false
|
|
||||||
SOURCE_FILENAME=jellyfin-web.deb
|
|
|
@ -3,9 +3,10 @@
|
||||||
* Users with the `admin` permission will have access to the administration panel.
|
* Users with the `admin` permission will have access to the administration panel.
|
||||||
|
|
||||||
* The app can access YunoHost's multimedia directories:
|
* The app can access YunoHost's multimedia directories:
|
||||||
choose one of the folders in `/home/yunohost.multimedia/share` upon configuration of your libraries.
|
|
||||||
|
Choose one of the folders in `/home/yunohost.multimedia/share` upon configuration of your libraries.
|
||||||
|
|
||||||
* Starting version 10.7.5~ynh2, you can ask for the discovery ports (1900 and 7359) to be opened.
|
* 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`
|
They ease the setting up of your media center between clients and server.
|
||||||
if you want the upgrade to open them for you.
|
* 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.
|
BIN
doc/screenshots/jellyfin-1.jpg
Normal file
BIN
doc/screenshots/jellyfin-1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 233 KiB |
BIN
doc/screenshots/jellyfin-2.jpg
Normal file
BIN
doc/screenshots/jellyfin-2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 160 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.3 MiB |
|
@ -1,77 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Jellyfin",
|
|
||||||
"id": "jellyfin",
|
|
||||||
"packaging_format": 1,
|
|
||||||
"description": {
|
|
||||||
"en": "Media System that manage and stream your media",
|
|
||||||
"fr": "Système multimédia qui gère et diffuse vos médias"
|
|
||||||
},
|
|
||||||
"version": "10.8.11~ynh2",
|
|
||||||
"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",
|
|
||||||
"cpe": "cpe:2.3:a:jellyfin:jellyfin"
|
|
||||||
},
|
|
||||||
"license": "GPL-2.0-only",
|
|
||||||
"maintainer": {
|
|
||||||
"name": "tituspijean",
|
|
||||||
"email": "tituspijean@outlook.com"
|
|
||||||
},
|
|
||||||
"previous_maintainers": [
|
|
||||||
{
|
|
||||||
"name": "liberodark",
|
|
||||||
"email": "liberodark@gmail.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"requirements": {
|
|
||||||
"yunohost": ">= 11.0.9"
|
|
||||||
},
|
|
||||||
"multi_instance": false,
|
|
||||||
"services": [
|
|
||||||
"nginx"
|
|
||||||
],
|
|
||||||
"arguments": {
|
|
||||||
"install": [
|
|
||||||
{
|
|
||||||
"name": "domain",
|
|
||||||
"type": "domain"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "path",
|
|
||||||
"type": "path",
|
|
||||||
"example": "/jellyfin",
|
|
||||||
"default": "/jellyfin"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "is_public",
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"help": {
|
|
||||||
"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": "admin",
|
|
||||||
"type": "user"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"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."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
150
manifest.toml
Normal file
150
manifest.toml
Normal file
|
@ -0,0 +1,150 @@
|
||||||
|
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json
|
||||||
|
|
||||||
|
packaging_format = 2
|
||||||
|
|
||||||
|
id = "jellyfin"
|
||||||
|
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.8.11~ynh3"
|
||||||
|
|
||||||
|
maintainers = ["tituspijean"]
|
||||||
|
|
||||||
|
[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"
|
||||||
|
cpe = "cpe:2.3:a:jellyfin:jellyfin"
|
||||||
|
fund = "https://opencollective.com/jellyfin"
|
||||||
|
|
||||||
|
[integration]
|
||||||
|
yunohost = ">= 11.2"
|
||||||
|
architectures = ["armhf", "arm64", "amd64"]
|
||||||
|
multi_instance = false
|
||||||
|
ldap = true
|
||||||
|
sso = true
|
||||||
|
disk = "300M"
|
||||||
|
ram.build = "200M"
|
||||||
|
ram.runtime = "100M"
|
||||||
|
|
||||||
|
[install]
|
||||||
|
[install.domain]
|
||||||
|
type = "domain"
|
||||||
|
|
||||||
|
[install.path]
|
||||||
|
type = "path"
|
||||||
|
default = "/jellyfin"
|
||||||
|
|
||||||
|
[install.init_main_permission]
|
||||||
|
help.en = "Jellyfin has its own login system, you should make it public to let external clients access it (mobile app, etc.)."
|
||||||
|
help.fr = "Jellyfin a son propre système de connexion, vous devriez la laisser publique pour permettre la connexion de clients externes (app mobile, etc.)."
|
||||||
|
type = "group"
|
||||||
|
default = "visitors"
|
||||||
|
|
||||||
|
[install.admin]
|
||||||
|
type = "user"
|
||||||
|
|
||||||
|
[install.discovery]
|
||||||
|
ask.en = "Should the ports for client and server discovery be opened?"
|
||||||
|
ask.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."
|
||||||
|
help.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."
|
||||||
|
type = "boolean"
|
||||||
|
default = true
|
||||||
|
|
||||||
|
[resources]
|
||||||
|
[resources.sources]
|
||||||
|
[resources.sources.server]
|
||||||
|
armhf.url = "https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.8.11/jellyfin-server_10.8.11-1_armhf.deb"
|
||||||
|
armhf.sha256 = "f35d0cda50b22be9d5480f68db70bf1b66f0a974d93739a333fa540e941147d1"
|
||||||
|
|
||||||
|
arm64.url = "https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.8.11/jellyfin-server_10.8.11-1_arm64.deb"
|
||||||
|
arm64.sha256 = "a1d132fbf624e9745e43a6600f6364ff15e86c8cf75950a5a44b7a20e6fd41ca"
|
||||||
|
|
||||||
|
amd64.url = "https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.8.11/jellyfin-server_10.8.11-1_amd64.deb"
|
||||||
|
amd64.sha256 = "8d512bf3d457c8cd92ade0cd32ce99d70f5549677779404ae89413ec77248e87"
|
||||||
|
|
||||||
|
rename = "jellyfin-server.deb"
|
||||||
|
format = "whatever"
|
||||||
|
extract = false
|
||||||
|
|
||||||
|
[resources.sources.web]
|
||||||
|
url = "https://repo.jellyfin.org/releases/server/debian/versions/stable/web/10.8.11/jellyfin-web_10.8.11-1_all.deb"
|
||||||
|
sha256 = "9875062909d8a4e7081a50c5aac2fb6378edfeebccb0830a6eadd7e0d04b7f6d"
|
||||||
|
|
||||||
|
rename = "jellyfin-web.deb"
|
||||||
|
format = "whatever"
|
||||||
|
extract = false
|
||||||
|
|
||||||
|
|
||||||
|
[resources.sources.ffmpeg_bookworm]
|
||||||
|
armhf.url = "https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/6.0-6/jellyfin-ffmpeg6_6.0-6-bookworm_armhf.deb"
|
||||||
|
armhf.sha256 = "5d8cb04731f1c0741f259f4b86c5e2047a464d868580710b14dc9c92871e1cdb"
|
||||||
|
|
||||||
|
arm64.url = "https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/6.0-6/jellyfin-ffmpeg6_6.0-6-bookworm_arm64.deb"
|
||||||
|
arm64.sha256 = "3407859d4b233e41f1200861df43e94c6e4fab51481b91ce3768b0335011d8a5"
|
||||||
|
|
||||||
|
amd64.url = "https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/6.0-6/jellyfin-ffmpeg6_6.0-6-bookworm_amd64.deb"
|
||||||
|
amd64.sha256 = "4b209eec5c43556af15c8b26c06360e45d4956ccb7a5d40cf8f2835750d60f46"
|
||||||
|
|
||||||
|
rename = "jellyfin-ffmpeg6.deb"
|
||||||
|
format = "whatever"
|
||||||
|
extract = false
|
||||||
|
|
||||||
|
|
||||||
|
[resources.sources.ffmpeg_bullseye]
|
||||||
|
armhf.url = "https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/6.0-6/jellyfin-ffmpeg6_6.0-6-bullseye_armhf.deb"
|
||||||
|
armhf.sha256 = "3e1aaef8d390ade1afe8a5b0de16d67ce6d8ba8cff777469505a7db5f790c5d9"
|
||||||
|
|
||||||
|
arm64.url = "https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/6.0-6/jellyfin-ffmpeg6_6.0-6-bullseye_arm64.deb"
|
||||||
|
arm64.sha256 = "4f3cba47d318f9c7a9cb8502335d2f1803b717746ac1fe5928f4d1de93e03181"
|
||||||
|
|
||||||
|
amd64.url = "https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/6.0-6/jellyfin-ffmpeg6_6.0-6-bullseye_amd64.deb"
|
||||||
|
amd64.sha256 = "1160f8c742791c15571de5781a417abeffc69bb285f7862e4874e9f7050bf218"
|
||||||
|
|
||||||
|
rename = "jellyfin-ffmpeg6.deb"
|
||||||
|
format = "whatever"
|
||||||
|
extract = false
|
||||||
|
|
||||||
|
|
||||||
|
[resources.sources.ffmpeg_buster]
|
||||||
|
armhf.url = "https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/6.0-6/jellyfin-ffmpeg6_6.0-6-buster_armhf.deb"
|
||||||
|
armhf.sha256 = "744c0cd40f0a7bead197da348d9a04958393423d5a703613943e23532362f645"
|
||||||
|
|
||||||
|
arm64.url = "https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/6.0-6/jellyfin-ffmpeg6_6.0-6-buster_arm64.deb"
|
||||||
|
arm64.sha256 = "93fed7dbc4bf0646cfea176a20b60186eef6c2735f07208c58fd9c73ec557c50"
|
||||||
|
|
||||||
|
amd64.url = "https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/6.0-6/jellyfin-ffmpeg6_6.0-6-buster_amd64.deb"
|
||||||
|
amd64.sha256 = "844b6574d345e5deb006c45b393186de324ac8b2abe08d76ba02af8db1df61ae"
|
||||||
|
rename = "jellyfin-ffmpeg6.deb"
|
||||||
|
format = "whatever"
|
||||||
|
extract = false
|
||||||
|
|
||||||
|
|
||||||
|
[resources.sources.plugin_ldap]
|
||||||
|
url = "https://repo.jellyfin.org/releases/plugin/ldap-authentication/ldap-authentication_16.0.0.0.zip"
|
||||||
|
sha256 = "8857a7dbe8bd08db2a8c10621d388424a389a9f0d98253dbd0ea229310d5cf7f"
|
||||||
|
in_subdir = false
|
||||||
|
|
||||||
|
|
||||||
|
[resources.system_user]
|
||||||
|
home = "/var/lib/jellyfin"
|
||||||
|
|
||||||
|
[resources.install_dir]
|
||||||
|
dir = "/var/lib/jellyfin"
|
||||||
|
|
||||||
|
[resources.permissions]
|
||||||
|
# auth_header=false is because Jellyfin expects custom data in the Authorization HTTP header (notably, for Jellyfin Vue)
|
||||||
|
main.url = "/"
|
||||||
|
main.auth_header = false
|
||||||
|
|
||||||
|
admin.protected = true
|
||||||
|
admin.auth_header = false
|
||||||
|
|
||||||
|
[resources.ports]
|
||||||
|
main.default = 8095
|
||||||
|
|
||||||
|
[resources.apt]
|
|
@ -8,94 +8,81 @@ debian=$(lsb_release --codename --short)
|
||||||
pkg_version="10.8.11-1"
|
pkg_version="10.8.11-1"
|
||||||
version=$(echo "$pkg_version" | cut -d '-' -f 1)
|
version=$(echo "$pkg_version" | cut -d '-' -f 1)
|
||||||
|
|
||||||
ffmpeg_pkg_version="5.1.2-6"
|
ffmpeg_pkg_version="6.0-6"
|
||||||
ldap_pkg_version="16.0.0.0"
|
ldap_pkg_version="16.0.0.0"
|
||||||
|
|
||||||
discovery_service_port=1900
|
discovery_service_port=1900
|
||||||
discovery_client_port=7359
|
discovery_client_port=7359
|
||||||
|
|
||||||
ffmpeg_deps=(
|
# Those directories are handled by the deb package
|
||||||
libass9
|
data_path="/var/lib/$app"
|
||||||
libbluray2
|
config_path="/etc/$app"
|
||||||
libc6
|
log_path="/var/log/$app"
|
||||||
libdrm2
|
cache_path="/var/cache/$app"
|
||||||
libfontconfig1
|
|
||||||
libfreetype6
|
|
||||||
libfribidi0
|
|
||||||
libgcc1
|
|
||||||
libgmp10
|
|
||||||
libgnutls30
|
|
||||||
libllvm13
|
|
||||||
libmp3lame0
|
|
||||||
libopus0
|
|
||||||
libstdc++6
|
|
||||||
libtheora0
|
|
||||||
libvdpau1
|
|
||||||
libvorbis0a
|
|
||||||
libvorbisenc2
|
|
||||||
libwebp6
|
|
||||||
libwebpmux3
|
|
||||||
libx11-6
|
|
||||||
libxcb-randr0
|
|
||||||
libzvbi0
|
|
||||||
zlib1g
|
|
||||||
)
|
|
||||||
|
|
||||||
case "$debian" in
|
|
||||||
buster) ffmpeg_deps+=( libvpx5 libx264-155 libx265-165 ) ;;
|
|
||||||
bullseye) ffmpeg_deps+=( libvpx6 libx264-160 libx265-192 ) ;;
|
|
||||||
*) echo "Unknown release: $debian" >&2; exit 1 ;;
|
|
||||||
esac
|
|
||||||
case "$YNH_ARCH" in
|
|
||||||
arm64) : ;;
|
|
||||||
armhf) : ;;
|
|
||||||
*) ffmpeg_deps+=( libdrm-intel1 libopencl1 ) ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
jellyfin_deps=(at libsqlite3-0 libfontconfig1 libfreetype6 libssl1.1)
|
|
||||||
|
|
||||||
pkg_dependencies="${ffmpeg_deps[*]} ${jellyfin_deps[*]}"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
install_jellyfin_packages() {
|
install_jellyfin_packages() {
|
||||||
# In case of a new version, the url change from
|
|
||||||
# https://repo.jellyfin.org/releases/server/debian/versions/stable/server/X.X.X/jellyfin-server_X.X.X-1_$YNH_ARCH.deb to
|
|
||||||
# https://repo.jellyfin.org/archive/debian/stable/X.X.X/server/jellyfin-server_X.X.X-1_$YNH_ARCH.deb
|
|
||||||
for pkg in web server; do
|
|
||||||
src_url=$(grep 'SOURCE_URL=' "$YNH_APP_BASEDIR/conf/$pkg.$debian.$YNH_ARCH.src" | cut -d= -f2-)
|
|
||||||
if ! curl --output /dev/null --silent --head --fail "$src_url"; then
|
|
||||||
ynh_replace_string \
|
|
||||||
--match_string="releases/server/debian/versions/stable/$pkg/$version/" \
|
|
||||||
--replace_string="archive/debian/stable/$version/$pkg/" \
|
|
||||||
--target_file="$YNH_APP_BASEDIR/conf/$pkg.$debian.$YNH_ARCH.src"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Create the temporary directory
|
# Create the temporary directory
|
||||||
tempdir="$(mktemp -d)"
|
tempdir="$(mktemp -d)"
|
||||||
|
|
||||||
# Download the deb files
|
# Download the deb files
|
||||||
ynh_setup_source --dest_dir=$tempdir --source_id="ffmpeg.$debian.$YNH_ARCH"
|
ynh_setup_source --dest_dir="$tempdir" --source_id="web"
|
||||||
ynh_setup_source --dest_dir=$tempdir --source_id="server.$debian.$YNH_ARCH"
|
ynh_setup_source --dest_dir="$tempdir" --source_id="ffmpeg_$debian"
|
||||||
ynh_setup_source --dest_dir=$tempdir --source_id="web.$debian.$YNH_ARCH"
|
ynh_setup_source --dest_dir="$tempdir" --source_id="server"
|
||||||
|
|
||||||
# Install the packages
|
# Install the packages
|
||||||
ynh_exec_warn_less dpkg --force-confdef --force-confnew -i $tempdir/jellyfin-web.deb
|
ynh_package_install \
|
||||||
ynh_exec_warn_less dpkg --force-confdef --force-confnew -i $tempdir/jellyfin-ffmpeg5.deb
|
"$tempdir/jellyfin-web.deb" \
|
||||||
ynh_exec_warn_less dpkg --force-confdef --force-confnew -i $tempdir/jellyfin-server.deb
|
"$tempdir/jellyfin-server.deb"
|
||||||
|
|
||||||
ynh_secure_remove --file="$tempdir"
|
# We need to workaround yunohoost passing --no-remove to replace jellyfin-ffmpeg5...
|
||||||
|
if ynh_package_is_installed "jellyfin-ffmpeg5"; then
|
||||||
|
ynh_package_remove "jellyfin-ffmpeg5"
|
||||||
|
fi
|
||||||
|
ynh_package_install \
|
||||||
|
"$tempdir/jellyfin-ffmpeg6.deb"
|
||||||
|
|
||||||
# The doc says it should be called only once,
|
# The doc says it should be called only once,
|
||||||
# but the code says multiple calls are supported.
|
# but the code says multiple calls are supported.
|
||||||
# Also, they're already installed so that should be quasi instantaneous.
|
# Also, they're already installed so that should be quasi instantaneous.
|
||||||
ynh_install_app_dependencies \
|
ynh_install_app_dependencies \
|
||||||
jellyfin-web="$pkg_version" \
|
jellyfin-web="$pkg_version" \
|
||||||
jellyfin-ffmpeg5="$ffmpeg_pkg_version-$debian" \
|
jellyfin-ffmpeg6="$ffmpeg_pkg_version-$debian" \
|
||||||
jellyfin-server="$pkg_version"
|
jellyfin-server="$pkg_version"
|
||||||
|
|
||||||
|
# Mark packages as dependencies, to allow automatic removal
|
||||||
|
apt-mark auto jellyfin-server jellyfin-web jellyfin-ffmpeg6
|
||||||
|
}
|
||||||
|
|
||||||
|
open_jellyfin_discovery_ports() {
|
||||||
|
discovery_service=$discovery
|
||||||
|
discovery_client=$discovery
|
||||||
|
|
||||||
|
if [ "$discovery" -eq 1 ]; then
|
||||||
|
|
||||||
|
# Open port $discovery_service_port 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 $discovery_client_port 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"
|
||||||
}
|
}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -10,27 +10,6 @@
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# MANAGE SCRIPT FAILURE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_clean_setup () {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# LOAD SETTINGS
|
|
||||||
#=================================================
|
|
||||||
ynh_print_info --message="Loading installation settings..."
|
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
|
||||||
|
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|
||||||
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -40,7 +19,9 @@ ynh_print_info --message="Declaring files to be backed up..."
|
||||||
# BACKUP THE APP MAIN DIR
|
# BACKUP THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="$final_path"
|
ynh_backup --src_path="$data_path"
|
||||||
|
ynh_backup --src_path="$config_path"
|
||||||
|
ynh_backup --src_path="/etc/default/jellyfin" --not_mandatory
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE NGINX CONFIGURATION
|
# BACKUP THE NGINX CONFIGURATION
|
||||||
|
@ -62,13 +43,6 @@ ynh_backup --src_path="/etc/logrotate.d/$app"
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/systemd/system/jellyfin.service.d" --not_mandatory
|
ynh_backup --src_path="/etc/systemd/system/jellyfin.service.d" --not_mandatory
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP VARIOUS FILES
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_backup --src_path="$config_path"
|
|
||||||
ynh_backup --src_path="/etc/default/jellyfin" --not_mandatory
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -9,64 +9,6 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RETRIEVE ARGUMENTS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
old_domain=$YNH_APP_OLD_DOMAIN
|
|
||||||
old_path=$YNH_APP_OLD_PATH
|
|
||||||
|
|
||||||
new_domain=$YNH_APP_NEW_DOMAIN
|
|
||||||
new_path=$YNH_APP_NEW_PATH
|
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# LOAD SETTINGS
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Loading installation settings..." --weight=1
|
|
||||||
|
|
||||||
# Needed for helper "ynh_add_nginx_config"
|
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|
||||||
|
|
||||||
# Add settings here as needed by your application
|
|
||||||
port=$(ynh_app_setting_get --app="$app" --key=port)
|
|
||||||
config_path=$(ynh_app_setting_get --app="$app" --key=config_path)
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=10
|
|
||||||
|
|
||||||
# Backup the current version of the app
|
|
||||||
ynh_backup_before_upgrade
|
|
||||||
ynh_clean_setup () {
|
|
||||||
ynh_clean_check_starting
|
|
||||||
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
|
|
||||||
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
|
||||||
|
|
||||||
# Restore it if the upgrade fails
|
|
||||||
ynh_restore_upgradebackup
|
|
||||||
}
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CHECK WHICH PARTS SHOULD BE CHANGED
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
change_domain=0
|
|
||||||
if [ "$old_domain" != "$new_domain" ]
|
|
||||||
then
|
|
||||||
change_domain=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
change_path=0
|
|
||||||
if [ "$old_path" != "$new_path" ]
|
|
||||||
then
|
|
||||||
change_path=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -74,36 +16,14 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Stopping a systemd service..." --weight=2
|
ynh_script_progression --message="Stopping a systemd service..." --weight=2
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped Jellyfin Media Server" --timeout=15
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --timeout=15
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY URL IN NGINX CONF
|
# MODIFY URL IN NGINX CONF
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
||||||
|
|
||||||
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
ynh_change_url_nginx_config
|
||||||
|
|
||||||
# Change the path in the NGINX config file
|
|
||||||
if [ $change_path -eq 1 ]
|
|
||||||
then
|
|
||||||
# Make a backup of the original NGINX config file if modified
|
|
||||||
ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
|
|
||||||
# Set global variables for NGINX helper
|
|
||||||
domain="$old_domain"
|
|
||||||
path_url="$new_path"
|
|
||||||
# Create a dedicated NGINX config
|
|
||||||
ynh_add_nginx_config
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Change the domain for NGINX
|
|
||||||
if [ $change_domain -eq 1 ]
|
|
||||||
then
|
|
||||||
# Delete file checksum for the old conf file location
|
|
||||||
ynh_delete_file_checksum --file="$nginx_conf_path"
|
|
||||||
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
|
|
||||||
# Store file checksum for the new config file location
|
|
||||||
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC MODIFICATIONS
|
# SPECIFIC MODIFICATIONS
|
||||||
|
@ -129,14 +49,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=2
|
ynh_script_progression --message="Starting a systemd service..." --weight=2
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started Jellyfin Media Server" --timeout=15
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --timeout=15
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RELOAD NGINX
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
153
scripts/install
153
scripts/install
|
@ -10,99 +10,23 @@ source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MANAGE SCRIPT FAILURE
|
# CREATE DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_clean_setup () {
|
if [ -d "$config_path" ]; then
|
||||||
ynh_clean_check_starting
|
ynh_die --message="There is already a directory: $config_path "
|
||||||
}
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
|
||||||
path_url=$YNH_APP_ARG_PATH
|
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
|
||||||
admin=$YNH_APP_ARG_ADMIN
|
|
||||||
discovery=$YNH_APP_ARG_DISCOVERY
|
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Validating installation parameters..." --weight=1
|
|
||||||
|
|
||||||
final_path=/var/lib/jellyfin
|
|
||||||
config_path=/etc/jellyfin
|
|
||||||
test ! -e "$final_path" || ynh_die --message="There is already a directory: $final_path "
|
|
||||||
test ! -e "$config_path" || ynh_die --message="There is already a directory: $config_path "
|
|
||||||
|
|
||||||
if [[ ! "$YNH_ARCH" =~ ^(amd64|arm64|armhf)$ ]]; then
|
|
||||||
ynh_die "Jellyfin is not compatible with your architecture, $YNH_ARCH, which is neither amd64, arm64, or armhf." 1
|
|
||||||
fi
|
fi
|
||||||
|
ynh_app_setting_set --app="$app" --key=config_path --value="$config_path"
|
||||||
# Register (book) web path
|
|
||||||
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STORE SETTINGS FROM MANIFEST
|
|
||||||
#=================================================
|
|
||||||
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
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
# FIND AND OPEN A PORT
|
# OPEN PORTS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Finding an available port..." --weight=1
|
|
||||||
|
|
||||||
# Find an available port
|
ynh_script_progression --message="Configuring firewall..." --weight=1
|
||||||
port=$(ynh_find_port --port=8095)
|
|
||||||
ynh_app_setting_set --app=$app --key=port --value=$port
|
|
||||||
|
|
||||||
discovery_service=$discovery
|
open_jellyfin_discovery_ports
|
||||||
discovery_client=$discovery
|
|
||||||
|
|
||||||
if [ $discovery -eq 1 ]; then
|
|
||||||
ynh_script_progression --message="Configuring firewall..." --weight=1
|
|
||||||
|
|
||||||
# Open port $discovery_service_port 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 $discovery_client_port 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
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Installing dependencies..." --weight=5
|
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL PACKAGES
|
# INSTALL PACKAGES
|
||||||
|
@ -112,24 +36,15 @@ ynh_script_progression --message="Installing packages..." --weight=1
|
||||||
install_jellyfin_packages
|
install_jellyfin_packages
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# SYSTEM CONFIGURATION
|
||||||
#=================================================
|
#=================================================ç
|
||||||
ynh_script_progression --message="Configuring system user..." --weight=2
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
# Create a system user
|
if getent group render && ! id -Gn "$app" | grep -qw "\brender\b" >/dev/null; then
|
||||||
ynh_system_user_create --username=$app
|
|
||||||
|
|
||||||
if grep -q "^render:" /etc/group; then
|
|
||||||
# Add user to render group
|
# Add user to render group
|
||||||
adduser $app render
|
adduser "$app" render
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# NGINX CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring NGINX web server..." --weight=6
|
|
||||||
|
|
||||||
# Create a dedicated NGINX config
|
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -142,7 +57,7 @@ sleep 30
|
||||||
|
|
||||||
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped Jellyfin Media Server" --timeout=15
|
ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd" --timeout=15
|
||||||
|
|
||||||
ynh_add_config --template="system.xml" --destination="$config_path/system.xml"
|
ynh_add_config --template="system.xml" --destination="$config_path/system.xml"
|
||||||
ynh_add_config --template="network.xml" --destination="$config_path/network.xml"
|
ynh_add_config --template="network.xml" --destination="$config_path/network.xml"
|
||||||
|
@ -153,7 +68,7 @@ ynh_add_config --template="logging.json" --destination="$config_path/logging.jso
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing LDAP plugin..." --weight=2
|
ynh_script_progression --message="Installing LDAP plugin..." --weight=2
|
||||||
|
|
||||||
ynh_setup_source --dest_dir="/var/lib/jellyfin/plugins/LDAP Authentication" --source_id=ldap
|
ynh_setup_source --dest_dir="/var/lib/jellyfin/plugins/LDAP Authentication" --source_id=plugin_ldap
|
||||||
mkdir -p /var/lib/jellyfin/plugins/configurations/
|
mkdir -p /var/lib/jellyfin/plugins/configurations/
|
||||||
ynh_add_config --template="LDAP-Auth.xml" --destination="/var/lib/jellyfin/plugins/configurations/LDAP-Auth.xml"
|
ynh_add_config --template="LDAP-Auth.xml" --destination="/var/lib/jellyfin/plugins/configurations/LDAP-Auth.xml"
|
||||||
|
|
||||||
|
@ -163,8 +78,8 @@ ynh_add_config --template="LDAP-Auth.xml" --destination="/var/lib/jellyfin/plugi
|
||||||
ynh_script_progression --message="Securing files and directories..."
|
ynh_script_progression --message="Securing files and directories..."
|
||||||
|
|
||||||
# Set permissions to app files
|
# Set permissions to app files
|
||||||
chown -R $app: $final_path
|
chown -R "$app:" "$data_path"
|
||||||
chown -R $app: $config_path
|
chown -R "$app:" "$config_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# YUNOHOST MULTIMEDIA INTEGRATION
|
# YUNOHOST MULTIMEDIA INTEGRATION
|
||||||
|
@ -174,7 +89,7 @@ ynh_script_progression --message="Adding multimedia directories..." --weight=2
|
||||||
# Build YunoHost multimedia directories
|
# Build YunoHost multimedia directories
|
||||||
ynh_multimedia_build_main_dir
|
ynh_multimedia_build_main_dir
|
||||||
# Allow Jellyfin to write into these directories
|
# Allow Jellyfin to write into these directories
|
||||||
ynh_multimedia_addaccess $app
|
ynh_multimedia_addaccess "$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
@ -191,7 +106,10 @@ ynh_use_logrotate
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||||
|
|
||||||
yunohost service add $app --description="Jellyfin media center"
|
yunohost service add "$app" --description="Jellyfin media center"
|
||||||
|
|
||||||
|
# Only the admin can access the admin panel of the app (if the app has an admin panel)
|
||||||
|
ynh_permission_update --permission="admin" --add="$admin"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
|
@ -199,34 +117,7 @@ yunohost service add $app --description="Jellyfin media center"
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
# Start a systemd service
|
# Start a systemd service
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started Jellyfin Media Server" --timeout=15
|
ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --timeout=15
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP SSOWAT
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring permissions..." --weight=1
|
|
||||||
|
|
||||||
# Make app public if necessary
|
|
||||||
if [ $is_public -eq 1 ]
|
|
||||||
then
|
|
||||||
# Everyone can access the app.
|
|
||||||
# The "main" permission is automatically created before the install script.
|
|
||||||
ynh_permission_update --permission="main" --add="visitors"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# auth_header=false is because Jellyfin expects custom data in the Authorization HTTP header
|
|
||||||
# (notably, for Jellyfin Vue)
|
|
||||||
ynh_permission_url --permission="main" --auth_header=false
|
|
||||||
|
|
||||||
# Only the admin can access the admin panel of the app (if the app has an admin panel)
|
|
||||||
ynh_permission_create --permission="admin" --auth_header=false --allowed=$admin
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RELOAD NGINX
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=2
|
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -9,19 +9,6 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# LOAD SETTINGS
|
|
||||||
#=================================================
|
|
||||||
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)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# STANDARD REMOVE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -32,41 +19,24 @@ config_path=$(ynh_app_setting_get --app=$app --key=config_path)
|
||||||
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Removing $app service integration..." --weight=3
|
ynh_script_progression --message="Removing $app service integration..." --weight=3
|
||||||
yunohost service remove $app
|
yunohost service remove "$app"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE LOGROTATE CONFIGURATION
|
# REMOVE SYSTEM CONFIGURATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
|
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
# Remove the app-specific logrotate config
|
|
||||||
ynh_remove_logrotate
|
ynh_remove_logrotate
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE NGINX CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
|
|
||||||
|
|
||||||
# Remove the dedicated NGINX config
|
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing dependencies..." --weight=3
|
|
||||||
|
|
||||||
# Remove metapackage and its dependencies
|
|
||||||
ynh_remove_app_dependencies
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE PACKAGES
|
# REMOVE PACKAGES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing packages..." --weight=1
|
ynh_script_progression --message="Removing packages..." --weight=1
|
||||||
|
|
||||||
dpkg --remove jellyfin-web
|
ynh_remove_app_dependencies
|
||||||
dpkg --remove jellyfin-server
|
|
||||||
dpkg --remove jellyfin-ffmpeg5
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CLOSE A PORT
|
# CLOSE A PORT
|
||||||
|
@ -91,7 +61,6 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing various files..." --weight=1
|
ynh_script_progression --message="Removing various files..." --weight=1
|
||||||
|
|
||||||
ynh_secure_remove --file="$final_path"
|
|
||||||
ynh_secure_remove --file="$config_path"
|
ynh_secure_remove --file="$config_path"
|
||||||
ynh_secure_remove --file="/etc/systemd/system/jellyfin.service.d"
|
ynh_secure_remove --file="/etc/systemd/system/jellyfin.service.d"
|
||||||
ynh_secure_remove --file="/etc/sudoers.d/jellyfin-sudoers"
|
ynh_secure_remove --file="/etc/sudoers.d/jellyfin-sudoers"
|
||||||
|
@ -99,16 +68,6 @@ ynh_secure_remove --file="/etc/sudoers.d/jellyfin-sudoers"
|
||||||
# Remove the log files
|
# Remove the log files
|
||||||
ynh_secure_remove --file="/var/log/$app"
|
ynh_secure_remove --file="/var/log/$app"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
|
||||||
# REMOVE DEDICATED USER
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing the dedicated system user..." --weight=2
|
|
||||||
|
|
||||||
# Delete a system user
|
|
||||||
ynh_system_user_delete --username=$app
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -10,54 +10,16 @@
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# MANAGE SCRIPT FAILURE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_clean_setup () {
|
|
||||||
ynh_clean_check_starting
|
|
||||||
}
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# LOAD SETTINGS
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Loading installation settings..." --weight=1
|
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
|
||||||
|
|
||||||
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
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Validating restoration parameters..." --weight=2
|
|
||||||
|
|
||||||
test ! -d $final_path \
|
|
||||||
|| ynh_die --message="There is already a directory: $final_path "
|
|
||||||
test ! -d $config_path \
|
|
||||||
|| ynh_die --message="There is already a directory: $config_path "
|
|
||||||
|
|
||||||
if [[ ! "$YNH_ARCH" =~ ^(amd64|arm64|armhf)$ ]]; then
|
|
||||||
ynh_die "Jellyfin is not compatible with your architecture, $YNH_ARCH, which is neither amd64, arm64, or armhf." 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD RESTORATION STEPS
|
# STANDARD RESTORATION STEPS
|
||||||
#=================================================
|
#=================================================
|
||||||
# RECREATE THE DEDICATED USER
|
# RECREATE THE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
|
ynh_script_progression --message="Reconfiguring the dedicated system user..." --weight=1
|
||||||
|
|
||||||
# Create the dedicated user (if not existing)
|
# It could be created later by the deb, but it's cleaner here
|
||||||
ynh_system_user_create --username=$app
|
ynh_system_user_create --username=$app
|
||||||
|
if getent group render && ! id -Gn "$app" | grep -qw "\brender\b" >/dev/null; then
|
||||||
if grep -q "^render:" /etc/group; then
|
|
||||||
# Add user to render group
|
# Add user to render group
|
||||||
adduser $app render
|
adduser $app render
|
||||||
fi
|
fi
|
||||||
|
@ -65,52 +27,19 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# OPEN PORTS
|
# OPEN PORTS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Configuring firewall..." --weight=1
|
||||||
|
|
||||||
discovery_service=$discovery
|
open_jellyfin_discovery_ports
|
||||||
discovery_client=$discovery
|
|
||||||
|
|
||||||
if [ $discovery -eq 1 ]; then
|
|
||||||
ynh_script_progression --message="Configuring firewall..." --weight=1
|
|
||||||
|
|
||||||
# Open port $discovery_service_port 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 $discovery_client_port 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 APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the app main directory..." --weight=2
|
ynh_script_progression --message="Restoring the app main directory..." --weight=2
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$final_path"
|
ynh_restore_file --origin_path="$data_path"
|
||||||
ynh_restore_file --origin_path="$config_path"
|
ynh_restore_file --origin_path="$config_path"
|
||||||
ynh_restore_file --origin_path="/etc/default/jellyfin" --not_mandatory
|
ynh_restore_file --origin_path="/etc/default/jellyfin" --not_mandatory
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC RESTORATION
|
|
||||||
#=================================================
|
|
||||||
# REINSTALL DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Reinstalling dependencies..." --weight=5
|
|
||||||
|
|
||||||
# Define and install dependencies
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REINSTALL PACKAGES
|
# REINSTALL PACKAGES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -131,7 +60,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
ynh_script_progression --message="Restoring user rights..."
|
ynh_script_progression --message="Restoring user rights..."
|
||||||
|
|
||||||
# Restore permissions on app files
|
# Restore permissions on app files
|
||||||
chown -R $app: $final_path
|
chown -R $app: $data_path
|
||||||
chown -R $app: $config_path
|
chown -R $app: $config_path
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -171,7 +100,7 @@ yunohost service add $app --description="Jellyfin media center"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
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="restart" --log_path="systemd" --timeout=15
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
90
scripts/update_version.py
Executable file
90
scripts/update_version.py
Executable file
|
@ -0,0 +1,90 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
from typing import Any
|
||||||
|
from pathlib import Path
|
||||||
|
import tomlkit
|
||||||
|
import requests
|
||||||
|
|
||||||
|
REPO_ROOT = Path(__file__).parent.parent
|
||||||
|
|
||||||
|
JELLYFIN_REPO = "https://repo.jellyfin.org"
|
||||||
|
JELLYFIN_DEB_REPO = f"{JELLYFIN_REPO}/releases/server/debian"
|
||||||
|
|
||||||
|
ARCHS = [
|
||||||
|
"armhf",
|
||||||
|
"arm64",
|
||||||
|
"amd64",
|
||||||
|
]
|
||||||
|
|
||||||
|
DEBS = [
|
||||||
|
"buster",
|
||||||
|
"bullseye",
|
||||||
|
"bookworm",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def version_from__common_sh(name: str) -> str:
|
||||||
|
content = (REPO_ROOT/"scripts"/"_common.sh").open(encoding="utf-8").readlines()
|
||||||
|
result = next(filter(lambda line: line.startswith(f"{name}="), content))
|
||||||
|
return result.split('"')[1]
|
||||||
|
|
||||||
|
|
||||||
|
def server_url(arch: str, version: str) -> str:
|
||||||
|
version_simple = version.split("-")[0]
|
||||||
|
return f"{JELLYFIN_DEB_REPO}/versions/stable/server/{version_simple}/jellyfin-server_{version}_{arch}.deb"
|
||||||
|
|
||||||
|
|
||||||
|
def web_url(arch: str, version: str) -> str:
|
||||||
|
version_simple = version.split("-")[0]
|
||||||
|
return f"{JELLYFIN_DEB_REPO}/versions/stable/web/{version_simple}/jellyfin-web_{version}_all.deb"
|
||||||
|
|
||||||
|
|
||||||
|
def ffmpeg_url(arch: str, deb: str, version: str) -> str:
|
||||||
|
major = version.split(".")[0]
|
||||||
|
return f"{JELLYFIN_DEB_REPO}/versions/jellyfin-ffmpeg/{version}/jellyfin-ffmpeg{major}_{version}-{deb}_{arch}.deb"
|
||||||
|
|
||||||
|
|
||||||
|
def ldap_url(arch: str, version: str) -> str:
|
||||||
|
major = version.split(".")[0]
|
||||||
|
return f"{JELLYFIN_REPO}/releases/plugin/ldap-authentication/ldap-authentication_{version}.zip"
|
||||||
|
|
||||||
|
|
||||||
|
def sha256sum_of(url: str) -> str:
|
||||||
|
result = requests.get(f"{url}.sha256sum", timeout=10)
|
||||||
|
|
||||||
|
content = result.content.decode("utf-8")
|
||||||
|
return content.split(" ")[0]
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
manifest_file = REPO_ROOT/"manifest.toml"
|
||||||
|
manifest: dict[str, Any] = tomlkit.parse(manifest_file.open(encoding="utf-8").read())
|
||||||
|
|
||||||
|
jellyfin_version = version_from__common_sh("pkg_version")
|
||||||
|
ffmpeg_version = version_from__common_sh("ffmpeg_pkg_version")
|
||||||
|
ldap_version = version_from__common_sh("ldap_pkg_version")
|
||||||
|
|
||||||
|
for arch in ARCHS:
|
||||||
|
url = server_url(arch, jellyfin_version)
|
||||||
|
manifest["resources"]["sources"]["server"][arch]["url"] = url
|
||||||
|
manifest["resources"]["sources"]["server"][arch]["sha256"] = sha256sum_of(url)
|
||||||
|
|
||||||
|
url = web_url(arch, jellyfin_version)
|
||||||
|
manifest["resources"]["sources"]["web"]["url"] = url
|
||||||
|
manifest["resources"]["sources"]["web"]["sha256"] = sha256sum_of(url)
|
||||||
|
|
||||||
|
for arch in ARCHS:
|
||||||
|
for deb in DEBS:
|
||||||
|
url = ffmpeg_url(arch, deb, ffmpeg_version)
|
||||||
|
manifest["resources"]["sources"][f"ffmpeg_{deb}"][arch]["url"] = url
|
||||||
|
manifest["resources"]["sources"][f"ffmpeg_{deb}"][arch]["sha256"] = sha256sum_of(url)
|
||||||
|
|
||||||
|
url = ldap_url(arch, ldap_version)
|
||||||
|
manifest["resources"]["sources"]["plugin_ldap"]["url"] = url
|
||||||
|
manifest["resources"]["sources"]["plugin_ldap"]["sha256"] = sha256sum_of(url)
|
||||||
|
|
||||||
|
manifest_file.open("w", encoding="utf-8").write(tomlkit.dumps(manifest))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
|
@ -1,87 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
source _common.sh
|
|
||||||
source /usr/share/yunohost/helpers
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# META HELPER FOR PACKAGE RELEASES
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# This script is meant to be manually run by the app packagers
|
|
||||||
# to automatically update the source files.
|
|
||||||
# Edit version numbers in _common.sh before running the script.
|
|
||||||
|
|
||||||
prepare_source () {
|
|
||||||
# Declare an array to define the options of this helper.
|
|
||||||
local legacy_args=tda
|
|
||||||
local -A args_array=( [t]=template= [d]=destination= [a]=architecture= )
|
|
||||||
local template
|
|
||||||
local destination
|
|
||||||
local architecture
|
|
||||||
# Manage arguments with getopts
|
|
||||||
ynh_handle_getopts_args "$@"
|
|
||||||
local template_path
|
|
||||||
|
|
||||||
if [ -f "../conf/$template" ]; then
|
|
||||||
template_path="../conf/$template"
|
|
||||||
elif [ -f "../settings/conf/$template" ]; then
|
|
||||||
template_path="../settings/conf/$template"
|
|
||||||
elif [ -f "$template" ]; then
|
|
||||||
template_path=$template
|
|
||||||
else
|
|
||||||
ynh_die --message="The provided template $template doesn't exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp "$template_path" "$destination"
|
|
||||||
|
|
||||||
ynh_replace_vars --file="$destination"
|
|
||||||
|
|
||||||
local official_checksum
|
|
||||||
local official_checksum_url
|
|
||||||
local filename
|
|
||||||
local checksum
|
|
||||||
local url
|
|
||||||
|
|
||||||
# Create the temporary directory
|
|
||||||
tempdir="$(mktemp -d)"
|
|
||||||
|
|
||||||
url=$(grep "SOURCE_URL=" "$destination" | cut -d "=" -f 2)
|
|
||||||
echo $url
|
|
||||||
filename=${url##*/}
|
|
||||||
echo $filename
|
|
||||||
curl -s -4 -L $url -o "$tempdir/$filename"
|
|
||||||
checksum=$(sha256sum "$tempdir/$filename" | head -c 64)
|
|
||||||
|
|
||||||
ynh_secure_remove $tempdir
|
|
||||||
|
|
||||||
official_checksum_url=$(grep "SOURCE_SUM=" "$destination" | cut -d "=" -f 2)
|
|
||||||
if [[ "$official_checksum_url" != "none" ]]; then
|
|
||||||
official_checksum=$(curl -L -s "${official_checksum_url}" | cut -d ' ' -f 1)
|
|
||||||
echo $official_checksum
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$official_checksum_url" != "none" && "$official_checksum" != "$checksum" ]]; then
|
|
||||||
echo "Downloaded file checksum ($checksum) does not match official checksum ($official_checksum)"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
sed -i "s/SOURCE_SUM=.*/SOURCE_SUM=${checksum}/" "$destination"
|
|
||||||
echo "$destination updated"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
debians=("buster" "bullseye")
|
|
||||||
architectures=("amd64" "arm64" "armhf")
|
|
||||||
for debian in "${debians[@]}"; do
|
|
||||||
for architecture in "${architectures[@]}"; do
|
|
||||||
prepare_source --template="../conf/ffmpeg.src.default" --destination="../conf/ffmpeg.$debian.$architecture.src" --architecture="$architecture"
|
|
||||||
prepare_source --template="../conf/web.src.default" --destination="../conf/web.$debian.$architecture.src" --architecture="$architecture"
|
|
||||||
prepare_source --template="../conf/server.src.default" --destination="../conf/server.$debian.$architecture.src" --architecture="$architecture"
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
prepare_source --template="../conf/ldap.src.default" --destination="../conf/ldap.src"
|
|
||||||
|
|
||||||
sed -i "s# \"version\": \".*# \"version\": \"${version}\~ynh1\",#" ../manifest.json
|
|
||||||
|
|
||||||
git add _common.sh ../manifest.json ../conf/ffmpeg.*.src ../conf/web.*.src ../conf/server.*.src ../conf/ldap.src
|
|
||||||
git commit -m "Upgrade to v$version"
|
|
120
scripts/upgrade
120
scripts/upgrade
|
@ -9,20 +9,6 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# LOAD SETTINGS
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Loading installation settings..." --weight=1
|
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|
||||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
|
||||||
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
|
# CHECK VERSION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -30,21 +16,6 @@ ynh_script_progression --message="Checking version..."
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
upgrade_type=$(ynh_check_app_version_changed)
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=3
|
|
||||||
|
|
||||||
# Backup the current version of the app
|
|
||||||
ynh_backup_before_upgrade
|
|
||||||
ynh_clean_setup () {
|
|
||||||
ynh_clean_check_starting
|
|
||||||
# Restore it if the upgrade fails
|
|
||||||
ynh_restore_upgradebackup
|
|
||||||
}
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD UPGRADE STEPS
|
# STANDARD UPGRADE STEPS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -52,51 +23,31 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped Jellyfin Media Server" --timeout=15
|
ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd" --timeout=15
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
|
|
||||||
if [[ ! "$YNH_ARCH" =~ ^(amd64|arm64|armhf)$ ]]; then
|
# If render group exists, and system user doesn't belong to it, add it
|
||||||
ynh_die "Jellyfin is not compatible with your architecture, $YNH_ARCH, which is neither amd64, arm64, or armhf." 1
|
if getent group render && ! id -Gn "$app" | grep -qw "\brender\b" >/dev/null; then
|
||||||
|
adduser "$app" render
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If path keys do not exist, create them
|
# If path keys do not exist, create them
|
||||||
# If config_path is mixed up with final_path, fix them
|
# If config_path is mixed up with install_dir, fix them
|
||||||
if [ -z "$config_path" ] || [[ $config_path = "/var/lib/jellyfin" ]]; then
|
if [ -z "$config_path" ] || [[ $config_path = "/var/lib/jellyfin" ]]; then
|
||||||
config_path=/etc/jellyfin
|
config_path=/etc/jellyfin
|
||||||
final_path=/var/lib/jellyfin
|
ynh_app_setting_set --app="$app" --key=config_path --value=$config_path
|
||||||
ynh_app_setting_set --app=$app --key=config_path --value=$config_path
|
|
||||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If render group exists, and system user doesn't belong to it, add it
|
ynh_app_setting_delete --app="$app" --key=is_public
|
||||||
if [ $(grep -q "^render:" /etc/group) ] && [ ! $(id -Gn $app | grep -q '\brender\b') ]; then
|
|
||||||
adduser $app render
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Cleaning legacy permissions
|
|
||||||
if ynh_legacy_permissions_exists; then
|
|
||||||
ynh_legacy_permissions_delete_all
|
|
||||||
|
|
||||||
ynh_app_setting_delete --app=$app --key=is_public
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! ynh_permission_exists --permission="admin"; then
|
|
||||||
# Create the required permissions
|
|
||||||
ynh_permission_create --permission="admin" --auth_header=false --allowed=$admin
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Update SSO permissions with --auth_header=false (notably, for Jellyfin Vue)
|
|
||||||
ynh_permission_url --permission="main" --auth_header=false
|
|
||||||
ynh_permission_url --permission="admin" --auth_header=false
|
|
||||||
|
|
||||||
# If discovery key does not exist, create it
|
# If discovery key does not exist, create it
|
||||||
if [ -z "$discovery" ]; then
|
if [ -z "${discovery:-}" ]; then
|
||||||
discovery=0
|
discovery=0
|
||||||
ynh_app_setting_set --app=$app --key=discovery --value=$discovery
|
ynh_app_setting_set --app="$app" --key=discovery --value=$discovery
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "/etc/logrotate.d/$app" ]; then
|
if [ ! -f "/etc/logrotate.d/$app" ]; then
|
||||||
|
@ -130,31 +81,25 @@ fi
|
||||||
ynh_app_setting_set --app=$app --key=discovery_service --value=$discovery_service
|
ynh_app_setting_set --app=$app --key=discovery_service --value=$discovery_service
|
||||||
ynh_app_setting_set --app=$app --key=discovery_client --value=$discovery_client
|
ynh_app_setting_set --app=$app --key=discovery_client --value=$discovery_client
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CREATE DEDICATED USER
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
|
|
||||||
|
|
||||||
# Create a dedicated user (if not existing)
|
|
||||||
ynh_system_user_create --username=$app
|
|
||||||
|
|
||||||
if grep -q "^render:" /etc/group; then
|
|
||||||
# Add user to render group
|
|
||||||
adduser $app render
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# UPGRADE DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Upgrading dependencies..." --weight=5
|
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE PACKAGES
|
# UPGRADE PACKAGES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading packages..." --weight=3
|
ynh_script_progression --message="Upgrading packages..." --weight=3
|
||||||
|
|
||||||
|
# Backup the configuration files to prevent yunohost to see a manual edit
|
||||||
|
bakdir=$(mktemp -d)
|
||||||
|
for name in system.xml network.xml logging.json; do
|
||||||
|
cp "$config_path/$name" "$bakdir/$name"
|
||||||
|
done
|
||||||
|
|
||||||
|
# ynh_package_install passes --no-remove so the ffmpeg5 -> ffmpeg6 migration is blocked.
|
||||||
|
# So we remove the packages before installing the new ones.
|
||||||
|
if ynh_package_is_installed "jellyfin-ffmpeg5"; then
|
||||||
|
# Previous versions of the package did not do that so remove_app_dependencies doesn't do its job
|
||||||
|
apt-mark auto jellyfin-server jellyfin-web jellyfin-ffmpeg5
|
||||||
|
# ynh_remove_app_dependencies
|
||||||
|
fi
|
||||||
|
|
||||||
install_jellyfin_packages
|
install_jellyfin_packages
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -172,6 +117,12 @@ ynh_add_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating a configuration file..." --weight=2
|
ynh_script_progression --message="Updating a configuration file..." --weight=2
|
||||||
|
|
||||||
|
# Restore the files we just backed up before installing the debs...
|
||||||
|
for name in system.xml network.xml logging.json; do
|
||||||
|
mv -f "$bakdir/$name" "$config_path/$name"
|
||||||
|
done
|
||||||
|
ynh_secure_remove "$bakdir"
|
||||||
|
|
||||||
# TODO: investigate if we can avoid overriding system.xml
|
# TODO: investigate if we can avoid overriding system.xml
|
||||||
#ynh_add_config --template="system.xml" --destination="$config_path/system.xml"
|
#ynh_add_config --template="system.xml" --destination="$config_path/system.xml"
|
||||||
ynh_add_config --template="network.xml" --destination="$config_path/network.xml"
|
ynh_add_config --template="network.xml" --destination="$config_path/network.xml"
|
||||||
|
@ -182,7 +133,7 @@ ynh_add_config --template="logging.json" --destination="$config_path/logging.jso
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing LDAP plugin..." --weight=2
|
ynh_script_progression --message="Installing LDAP plugin..." --weight=2
|
||||||
|
|
||||||
ynh_setup_source --dest_dir="/var/lib/jellyfin/plugins/LDAP Authentication" --source_id=ldap
|
ynh_setup_source --dest_dir="/var/lib/jellyfin/plugins/LDAP Authentication" --source_id=plugin_ldap
|
||||||
mkdir -p /var/lib/jellyfin/plugins/configurations/
|
mkdir -p /var/lib/jellyfin/plugins/configurations/
|
||||||
ynh_add_config --template="LDAP-Auth.xml" --destination="/var/lib/jellyfin/plugins/configurations/LDAP-Auth.xml"
|
ynh_add_config --template="LDAP-Auth.xml" --destination="/var/lib/jellyfin/plugins/configurations/LDAP-Auth.xml"
|
||||||
|
|
||||||
|
@ -191,7 +142,7 @@ ynh_add_config --template="LDAP-Auth.xml" --destination="/var/lib/jellyfin/plugi
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Set permissions on app files
|
# Set permissions on app files
|
||||||
chown -R $app: $final_path
|
chown -R $app: $data_path
|
||||||
chown -R $app: $config_path
|
chown -R $app: $config_path
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -226,14 +177,7 @@ yunohost service add $app --description="Jellyfin media center"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started Jellyfin Media Server" --timeout=15
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --timeout=15
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RELOAD NGINX
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
15
tests.toml
Normal file
15
tests.toml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json
|
||||||
|
|
||||||
|
test_format = 1.0
|
||||||
|
|
||||||
|
[default]
|
||||||
|
|
||||||
|
preinstall = """
|
||||||
|
sudo apt update >/dev/null
|
||||||
|
"""
|
||||||
|
|
||||||
|
args.admin = "john"
|
||||||
|
|
||||||
|
test_upgrade_from.384dcd2ff1dbf4b0085edb7f12e4d15f00508e2b.name = "10.8.0_ynh1"
|
||||||
|
test_upgrade_from.384dcd2ff1dbf4b0085edb7f12e4d15f00508e2b.args.domain = "domain.tld"
|
||||||
|
test_upgrade_from.384dcd2ff1dbf4b0085edb7f12e4d15f00508e2b.args.admin = "john"
|
Loading…
Add table
Reference in a new issue