From d6c1b09b39227a9e9d906a4569d89c18ee2b620f Mon Sep 17 00:00:00 2001 From: Yalh Date: Mon, 28 Jan 2019 03:05:46 +0100 Subject: [PATCH] Adding password instead of mail+reset password url --- README.md | 6 +++--- check_process | 3 ++- manifest.json | 13 +++++++++++++ scripts/install | 28 +++------------------------- 4 files changed, 21 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 95c6201..da58bfc 100644 --- a/README.md +++ b/README.md @@ -56,13 +56,13 @@ Go to **cd /var/www/pleroma/pleroma**. **Run:** - $ sudo -u pleroma MIX_ENV=prod mix pleroma.user new + $ ( cd /var/www/pleroma/pleroma && sudo -u pleroma MIX_ENV=prod mix pleroma.user new ) ### Password reset **Run:** - $ sudo -u pleroma MIX_ENV=prod mix pleroma.user reset_password + $ ( cd /var/www/pleroma/pleroma && sudo -u pleroma MIX_ENV=prod mix pleroma.user reset_password ) This will generate a **password reset link** that you can then send to the user. @@ -73,7 +73,7 @@ You can make users **moderators**. They will then be able to **delete any post** **Run:** - $ sudo -u pleroma MIX_ENV=prod mix pleroma.user set --[no-]admin + $ ( cd /var/www/pleroma/pleroma && sudo -u pleroma MIX_ENV=prod mix pleroma.user set --[no-]admin ) **--admin** option will **make the user moderator** and **--no-admin** will **take away the moderator privileges** from the user. diff --git a/check_process b/check_process index a616d55..93ba9b7 100755 --- a/check_process +++ b/check_process @@ -8,7 +8,8 @@ domain="domain.tld" (DOMAIN) admin="john" (USER) is_public=1 (PUBLIC|public=1|private=0) - name="pleroma" + password="pass" + name="My Pleroma" registration=0 (BOOLEAN) cache=1 (BOOLEAN) size="5g" diff --git a/manifest.json b/manifest.json index 077e58f..58b971a 100755 --- a/manifest.json +++ b/manifest.json @@ -49,6 +49,19 @@ }, "default": true }, + { + "name": "password", + "type": "password", + "ask": { + "en": "Set the administrator password", + "fr": "Définissez le mot de passe administrateur" + }, + "help": { + "en": "Use the help field to add an information for the admin about this question.", + "fr": "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." + }, + "example": "Choose a password" + }, { "name": "name", "ask": { diff --git a/scripts/install b/scripts/install index 5307dad..cd9ea14 100755 --- a/scripts/install +++ b/scripts/install @@ -29,6 +29,7 @@ domain=$YNH_APP_ARG_DOMAIN path_url="/" admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC +password=$YNH_APP_ARG_PASSWORD name=$YNH_APP_ARG_NAME registration=$YNH_APP_ARG_REGISTRATION cache=$YNH_APP_ARG_CACHE @@ -261,16 +262,8 @@ ynh_psql_execute_as_root \ ynh_psql_execute_as_root \ "ALTER USER $app WITH NOSUPERUSER;" -read -rsp $'Press enter to continue...\n' - -# Add user and retrieve a password reset link that you can then send to the user -admin_pass_reset_url=$( cd $final_path/$app && sudo -u "$app" MIX_ENV=prod mix pleroma.user new "$admin" "$admin_email" | tail -1 ) - -# Make user moderator -( cd $final_path/$app && sudo -u "$app" MIX_ENV=prod mix pleroma.user set "$admin" --moderator ) - -# Make user admin -( cd $final_path/$app && sudo -u "$app" MIX_ENV=prod mix pleroma.user set "$admin" --admin ) +# Add user +( cd $final_path/$app && sudo -u "$app" MIX_ENV=prod mix pleroma.user new "$admin" "$admin_email" --moderator --admin -y ) #================================================= # SETUP SYSTEMD @@ -406,18 +399,3 @@ systemctl reload nginx yunohost service start $app sleep 10 - -#================================================= -# SEND A README FOR THE ADMIN -#================================================= - -message=" $app was successfully installed :) -Please open your $app domain: https://$domain$path_url - -The moderator username is: $admin -To reset your password: $admin_pass_reset_url - -If you are facing any problem or want to improve this app, please open a new issue here: https://github.com/YunoHost-Apps/pleroma_ynh/ -If you are not afraid of the terminal, check out https://git.pleroma.social/pleroma/pleroma/wikis/home to see what more you can do with your awesome instance!" - -ynh_send_readme_to_admin "$message" "$admin"