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

switch from email to user

This commit is contained in:
yalh76 2021-02-26 04:16:57 +01:00
parent 38cbc3b137
commit e8c4305c87
3 changed files with 11 additions and 9 deletions

View file

@ -37,13 +37,13 @@
"example": "example.com"
},
{
"name": "email",
"type": "string",
"name": "admin",
"type": "user",
"ask": {
"en": "Choose an admin email (can be changed after installation)",
"fr": "Choisissez une adresse e-mail d'administrateur (peut être modifiée après l'installation)"
"en": "Choose an admin user",
"fr": "Choisissez l'administrateur"
},
"example": "johndoe@example.com"
"example": "johndoe"
},
{
"name": "is_public",

View file

@ -26,9 +26,10 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
path_url="/"
admin_email=$YNH_APP_ARG_EMAIL
admin_pass=$(ynh_string_random --length=24)
admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC
admin_email=$(ynh_user_get_info --username=$admin --key="mail")
admin_pass=$(ynh_string_random --length=24)
app=$YNH_APP_INSTANCE_NAME
@ -52,8 +53,8 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
ynh_script_progression --message="Storing installation settings..."
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=admin_email --value=$admin_email
ynh_app_setting_set --app=$app --key=admin_pass --value=$admin_pass
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
#=================================================

View file

@ -18,7 +18,6 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
admin_email=$(ynh_app_setting_get --app=$app --key=admin_email)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port)
rtmp_port=$(ynh_app_setting_get --app=$app --key=rtmp_port)
@ -38,6 +37,8 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
ynh_app_setting_delete --app=$app --key=admin_pass
# If db_name doesn't exist, create it
if [ -z "$db_name" ]; then
db_name="peertube_${app}"