From 4064cdafc0563f2d8268867027b4f4a8a094d6bf Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 3 Apr 2020 20:52:03 +0000 Subject: [PATCH] [add] set one LDAP user as admin --- conf/policy.xml | 7 +++++++ manifest.json | 22 ++++++++++++++++++++-- scripts/install | 7 +++++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 conf/policy.xml diff --git a/conf/policy.xml b/conf/policy.xml new file mode 100644 index 0000000..1d6970d --- /dev/null +++ b/conf/policy.xml @@ -0,0 +1,7 @@ + + + true + true + false + Jellyfin.Plugin.LDAP_Auth.LdapAuthenticationProviderPlugin + diff --git a/manifest.json b/manifest.json index 83fe71a..fae8541 100644 --- a/manifest.json +++ b/manifest.json @@ -41,7 +41,7 @@ "example": "/jellyfin", "default": "/jellyfin" }, - + { "name": "is_public", "type": "boolean", @@ -51,13 +51,31 @@ }, "default": "true" }, - + { "name": "password", "type": "password", "ask": { "en": "Type LDAP admin password", "fr": "Saisissez le mot de passe de l'admin LDAP" + }, + "help": { + "en": "This is your admin panel password. It is needed for Jellyfin's LDAP plugin to bind to YunoHost's server.", + "fr": "Il s'agit du mot de passe d'administration du serveur. Il est nécessaire pour que le plugin LDAP de Jellyfin se connecte à YunoHost." + } + }, + + { + "name": "admin", + "type": "user", + "ask": { + "en": "Choose an admin user", + "fr": "Choisissez l’administrateur" + }, + "example": "johndoe", + "help": { + "en": "Choose your YunoHost username, it will be set as a Jellyfin admin.", + "fr": "Choisissez votre utilisateur YunoHost, il sera défini comme un admin dans Jellyfin." } } ] diff --git a/scripts/install b/scripts/install index 5f17e40..19e238e 100644 --- a/scripts/install +++ b/scripts/install @@ -29,6 +29,7 @@ domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC password=$YNH_APP_ARG_PASSWORD +admin=$YNH_APP_ARG_ADMIN ### If it's a multi-instance app, meaning it can be installed several times independently ### The id of the app as stated in the manifest is available as $YNH_APP_ID @@ -66,6 +67,7 @@ ynh_webpath_register $app $domain $path_url ynh_app_setting_set $app domain $domain ynh_app_setting_set $app path $path_url ynh_app_setting_set $app is_public $is_public +ynh_app_setting_set $app admin $admin #================================================= # INSTALL DEPENDENCIES @@ -183,6 +185,11 @@ ynh_replace_string --match_string="" --replace_string="$path # Port config ynh_replace_string --match_string="8096" --replace_string="$port" --target_file="/etc/jellyfin/system.xml" +# Setting up the admin user +userdir="/etc/jellyfin/users/$admin" +mkdir -p "$userdir" +cp ../conf/policy.xml "$userdir/" + #================================================= # STORE THE CONFIG FILE CHECKSUM #=================================================