mirror of
https://github.com/YunoHost-Apps/pleroma_ynh.git
synced 2024-09-03 20:15:59 +02:00
Adding password instead of mail+reset password url
This commit is contained in:
parent
2774abd4b6
commit
d6c1b09b39
4 changed files with 21 additions and 29 deletions
|
@ -56,13 +56,13 @@ Go to **cd /var/www/pleroma/pleroma**.
|
||||||
|
|
||||||
**Run:**
|
**Run:**
|
||||||
|
|
||||||
$ sudo -u pleroma MIX_ENV=prod mix pleroma.user new <NICKNAME> <EMAIL>
|
$ ( cd /var/www/pleroma/pleroma && sudo -u pleroma MIX_ENV=prod mix pleroma.user new <NICKNAME> <EMAIL> )
|
||||||
|
|
||||||
### Password reset
|
### Password reset
|
||||||
|
|
||||||
**Run:**
|
**Run:**
|
||||||
|
|
||||||
$ sudo -u pleroma MIX_ENV=prod mix pleroma.user reset_password <NICKNAME>
|
$ ( cd /var/www/pleroma/pleroma && sudo -u pleroma MIX_ENV=prod mix pleroma.user reset_password <NICKNAME> )
|
||||||
|
|
||||||
This will generate a **password reset link** that you can then send to the user.
|
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:**
|
**Run:**
|
||||||
|
|
||||||
$ sudo -u pleroma MIX_ENV=prod mix pleroma.user set <NICKNAME> --[no-]admin
|
$ ( cd /var/www/pleroma/pleroma && sudo -u pleroma MIX_ENV=prod mix pleroma.user set <NICKNAME> --[no-]admin )
|
||||||
|
|
||||||
**--admin** option will **make the user moderator** and **--no-admin** will **take away the moderator privileges** from the user.
|
**--admin** option will **make the user moderator** and **--no-admin** will **take away the moderator privileges** from the user.
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
domain="domain.tld" (DOMAIN)
|
domain="domain.tld" (DOMAIN)
|
||||||
admin="john" (USER)
|
admin="john" (USER)
|
||||||
is_public=1 (PUBLIC|public=1|private=0)
|
is_public=1 (PUBLIC|public=1|private=0)
|
||||||
name="pleroma"
|
password="pass"
|
||||||
|
name="My Pleroma"
|
||||||
registration=0 (BOOLEAN)
|
registration=0 (BOOLEAN)
|
||||||
cache=1 (BOOLEAN)
|
cache=1 (BOOLEAN)
|
||||||
size="5g"
|
size="5g"
|
||||||
|
|
|
@ -49,6 +49,19 @@
|
||||||
},
|
},
|
||||||
"default": true
|
"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",
|
"name": "name",
|
||||||
"ask": {
|
"ask": {
|
||||||
|
|
|
@ -29,6 +29,7 @@ domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url="/"
|
path_url="/"
|
||||||
admin=$YNH_APP_ARG_ADMIN
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
|
password=$YNH_APP_ARG_PASSWORD
|
||||||
name=$YNH_APP_ARG_NAME
|
name=$YNH_APP_ARG_NAME
|
||||||
registration=$YNH_APP_ARG_REGISTRATION
|
registration=$YNH_APP_ARG_REGISTRATION
|
||||||
cache=$YNH_APP_ARG_CACHE
|
cache=$YNH_APP_ARG_CACHE
|
||||||
|
@ -261,16 +262,8 @@ ynh_psql_execute_as_root \
|
||||||
ynh_psql_execute_as_root \
|
ynh_psql_execute_as_root \
|
||||||
"ALTER USER $app WITH NOSUPERUSER;"
|
"ALTER USER $app WITH NOSUPERUSER;"
|
||||||
|
|
||||||
read -rsp $'Press enter to continue...\n'
|
# Add user
|
||||||
|
( cd $final_path/$app && sudo -u "$app" MIX_ENV=prod mix pleroma.user new "$admin" "$admin_email" --moderator --admin -y )
|
||||||
# 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 )
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
|
@ -406,18 +399,3 @@ systemctl reload nginx
|
||||||
|
|
||||||
yunohost service start $app
|
yunohost service start $app
|
||||||
sleep 10
|
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"
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue