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

[add] set one LDAP user as admin

This commit is contained in:
tituspijean 2020-04-03 20:52:03 +00:00
parent 3aba2b5b3e
commit 4064cdafc0
3 changed files with 34 additions and 2 deletions

7
conf/policy.xml Normal file
View file

@ -0,0 +1,7 @@
<?xml version="1.0"?>
<UserPolicy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<IsAdministrator>true</IsAdministrator>
<IsHidden>true</IsHidden>
<IsDisabled>false</IsDisabled>
<AuthenticationProviderId>Jellyfin.Plugin.LDAP_Auth.LdapAuthenticationProviderPlugin</AuthenticationProviderId>
</UserPolicy>

View file

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

View file

@ -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="<BaseUrl />" --replace_string="<BaseUrl>$path
# Port config
ynh_replace_string --match_string="<HttpServerPortNumber>8096</HttpServerPortNumber>" --replace_string="<HttpServerPortNumber>$port</HttpServerPortNumber>" --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
#=================================================