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

set password

This commit is contained in:
Éric Gaspar 2024-01-05 12:49:50 +01:00
parent 963b417c96
commit 4639646b32
2 changed files with 6 additions and 7 deletions

View file

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

View file

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