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

Add LDAP plugin

This commit is contained in:
Guillaume Gautier 2019-10-20 18:27:21 +02:00
parent 7f59f12e72
commit 4a9c9421e7
4 changed files with 50 additions and 0 deletions

14
conf/LDAP-Auth.xml Normal file
View file

@ -0,0 +1,14 @@
<?xml version="1.0"?>
<PluginConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<LdapServer>localhost</LdapServer>
<LdapBaseDn>ou=users,dc=yunohost,dc=org</LdapBaseDn>
<LdapPort>389</LdapPort>
<LdapSearchAttributes>uid, cn, mail, displayName</LdapSearchAttributes>
<LdapUsernameAttribute>uid</LdapUsernameAttribute>
<LdapSearchFilter>(objectClass=mailAccount)</LdapSearchFilter>
<LdapAdminFilter>(enabledService=JellyfinAdministrator)</LdapAdminFilter>
<LdapBindUser>cn=admin,dc=yunohost,dc=org</LdapBindUser>
<LdapBindPassword>__BINDPASSWORD__</LdapBindPassword>
<CreateUsersFromLdap>true</CreateUsersFromLdap>
<UseSsl>false</UseSsl>
</PluginConfiguration>

View file

@ -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

View file

@ -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"
}
}
]
}

View file

@ -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
#=================================================