Closed yalh76 closed 5 years ago
As now with YunoHost 3.6 we are able to create users with yunohost user create without providing the admin password
yunohost user create
And as some applications need to have a dedicated ldap users to configure ldap connexions for authentication
The best way to create that dedicated user would be to use the $app. For example dedicated username could be ${app}ldap or ldap$app
$app
${app}ldap
ldap$app
But if you install twice the same application, in the second installation $app value would be something like example__2 for the example application
example__2
But yunohost user create has some limitations regarding username, firstname and lastname : https://github.com/YunoHost/yunohost/blob/ac7102a0caee9c6d2d8808ef4b345edfbdbb54e8/data/actionsmap/yunohost.yml#L75-L108
So the best is to sanitize the name to have something like:
ldap_user=$(ynh_sanitize_name --name="${app}ldap") ldap_password=$(ynh_string_random --length=8) yunohost user create $ldap_user --firstname $ldap_user --lastname $ldap_user --mail ${ldap_user}@$domain --password $ldap_password -q 0
Not sure we'll really need that, as app is already sanitize with similar rules. But anyway, as an experimental helper, let's try it and we'll see.
As now with YunoHost 3.6 we are able to create users with
yunohost user create
without providing the admin passwordAnd as some applications need to have a dedicated ldap users to configure ldap connexions for authentication
The best way to create that dedicated user would be to use the
$app
. For example dedicated username could be${app}ldap
orldap$app
But if you install twice the same application, in the second installation
$app
value would be something likeexample__2
for the example applicationBut
yunohost user create
has some limitations regarding username, firstname and lastname : https://github.com/YunoHost/yunohost/blob/ac7102a0caee9c6d2d8808ef4b345edfbdbb54e8/data/actionsmap/yunohost.yml#L75-L108So the best is to sanitize the name to have something like: