diff --git a/conf/LDAP-Auth.xml b/conf/LDAP-Auth.xml new file mode 100644 index 0000000..ad8ba1c --- /dev/null +++ b/conf/LDAP-Auth.xml @@ -0,0 +1,14 @@ + + + localhost + ou=users,dc=yunohost,dc=org + 389 + uid, cn, mail, displayName + uid + (objectClass=mailAccount) + (enabledService=JellyfinAdministrator) + cn=admin,dc=yunohost,dc=org + __BINDPASSWORD__ + true + false + diff --git a/conf/jellyfin-plugin-ldapauth.src b/conf/jellyfin-plugin-ldapauth.src new file mode 100644 index 0000000..496497d --- /dev/null +++ b/conf/jellyfin-plugin-ldapauth.src @@ -0,0 +1,7 @@ +SOURCE_URL=https://github.com/jellyfin/jellyfin-plugin-ldapauth/releases/download/v4/jellyfin-plugin-ldapauth_4.0.zip +SOURCE_SUM=dc6c27ca97f8cb6e398f9552e1ed263210376e005ee10d118bf19e77d6df6badda4fd61b5d9c3532df66f885ac38dc73b39e11dc4d9f10a40d0dddf5c89522f9 +SOURCE_SUM_PRG=sha512sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=false +SOURCE_EXTRACT=false +SOURCE_FILENAME=jellyfin-plugin-ldapauth.zip diff --git a/manifest.json b/manifest.json index 31125a6..61168ac 100644 --- a/manifest.json +++ b/manifest.json @@ -52,6 +52,15 @@ "fr": "Est-ce un site public ?" }, "default": "true" + }, + + { + "name": "password", + "type": "password", + "ask": { + "en": "Type LDAP admin password", + "fr": "Saisissez le mot de passe de l'admin LDAP" + } } ] } diff --git a/scripts/install b/scripts/install index ddd7143..be4ab79 100644 --- a/scripts/install +++ b/scripts/install @@ -28,6 +28,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC +password=$YNH_APP_ARG_PASSWORD ### 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 @@ -118,6 +119,7 @@ case `uname -m` in *) ynh_die "Unknown arch" ;; esac +ynh_setup_source "$final_path" "jellyfin-plugin-ldapauth" #============================================== # INSTALL JELLYFIN @@ -127,6 +129,24 @@ dpkg --install $final_path/jellyfin-ffmpeg.deb dpkg --install $final_path/jellyfin.deb rm $final_path/*.deb +#============================================== +# INSTALL LDAP PLUGIN +#============================================== + +plugins_path=/var/lib/jellyfin/plugins +plugins_conf_path=$plugins_path/configurations +plugins_conf_file=$plugins_conf_path/LDAP-Auth.xml +ldap_plugin_path="$plugins_path/LDAP Authentication" + +mkdir -p "$ldap_plugin_path" +unzip $final_path/jellyfin-plugin-ldapauth.zip -d "$ldap_plugin_path" +rm $final_path/*.zip + +mkdir -p "$plugins_conf_path" +cp ../conf/LDAP-Auth.xml "$plugins_conf_file" +ynh_replace_string --match_string="__BINDPASSWORD__" --replace_string="$password" --target_file="$plugins_conf_file" +chown -R jellyfin:jellyfin "$plugins_path" + #================================================= # NGINX CONFIGURATION #=================================================