From 4639646b32ea6b5b33de7e23b68a37bb72d9a1e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 5 Jan 2024 12:49:50 +0100 Subject: [PATCH] set password --- scripts/install | 5 ++--- scripts/upgrade | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index 0a7678d..2042737 100644 --- a/scripts/install +++ b/scripts/install @@ -14,7 +14,6 @@ source /usr/share/yunohost/helpers #================================================= admin_mail=$(ynh_user_get_info --username=$admin --key="mail") -admin_pass=$(ynh_string_random --length=24) secrets_peertube=$(ynh_string_random --length=24) redis_db=$(ynh_redis_get_free_db) @@ -22,7 +21,7 @@ redis_db=$(ynh_redis_get_free_db) # STORE SETTINGS FROM MANIFEST #================================================= -ynh_app_setting_set --app=$app --key=admin_pass --value=$admin_pass +ynh_app_setting_set --app=$app --key=password --value=$password ynh_app_setting_set --app=$app --key=secrets_peertube --value=$secrets_peertube ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db" @@ -113,7 +112,7 @@ ynh_script_progression --message="Installing $app plugin and password..." pushd "$install_dir" ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run plugin:install -- --npm-name peertube-plugin-auth-ldap ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run plugin:install -- --npm-name peertube-plugin-livechat - echo "$admin_pass" | ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run reset-password -- -u root + echo "$password" | ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run reset-password -- -u root popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8494db5..bc2301a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,9 +27,9 @@ if [ -z "${redis_db:-}" ]; then ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db" fi -if [ -z "${admin_pass:-}" ]; then - admin_pass=$(ynh_string_random --length=24) - ynh_app_setting_set --app=$app --key=admin_pass --value=$admin_pass +if [ -z "${password:-}" ]; then + password=$(ynh_string_random --length=24) + ynh_app_setting_set --app=$app --key=password --value=$password fi if [ -z "${secrets_peertube:-}" ]; then @@ -151,7 +151,7 @@ ynh_script_progression --message="Installing $app plugin..." pushd "$install_dir" ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run plugin:install -- --npm-name peertube-plugin-auth-ldap ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run plugin:install -- --npm-name peertube-plugin-livechat - echo "$admin_pass" | ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run reset-password -- -u root + echo "$password" | ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run reset-password -- -u root popd #=================================================