mirror of
https://github.com/YunoHost-Apps/pleroma_ynh.git
synced 2024-09-03 20:15:59 +02:00
Fix SU pleroma
This commit is contained in:
parent
1951417bf1
commit
f46c455770
1 changed files with 10 additions and 5 deletions
|
@ -249,27 +249,32 @@ fi
|
|||
# Give permission to the final_path
|
||||
chown -R "$app":"$app" "$final_path"
|
||||
|
||||
pushd $final_path/$app
|
||||
|
||||
# Install dependecies
|
||||
su "$app" <<DEPENDENCIES
|
||||
su -l "$app" -s /bin/bash <<DEPENDENCIES
|
||||
pushd $final_path/$app
|
||||
MIX_ENV=prod mix local.hex --force
|
||||
MIX_ENV=prod mix local.rebar --force
|
||||
mix deps.get
|
||||
popd
|
||||
DEPENDENCIES
|
||||
|
||||
# Run the database migration
|
||||
ynh_psql_execute_as_root \
|
||||
"ALTER USER $app WITH SUPERUSER;"
|
||||
|
||||
su "$app" <<DATABASE
|
||||
su -l "$app" -s /bin/bash <<DATABASE
|
||||
pushd $final_path/$app
|
||||
MIX_ENV=prod mix ecto.migrate --force
|
||||
popd
|
||||
DATABASE
|
||||
|
||||
ynh_psql_execute_as_root \
|
||||
"ALTER USER $app WITH NOSUPERUSER;"
|
||||
|
||||
# Create admin account
|
||||
su "$app" <<ADMIN
|
||||
su -l "$app" -s /bin/bash <<ADMIN
|
||||
pushd $final_path/$app
|
||||
# Add user and retrieve a password reset link that you can then send to the user
|
||||
admin_pass_reset_url=$( MIX_ENV=prod mix pleroma.user new "$admin" "$admin_email" | tail -1 )
|
||||
|
||||
|
@ -278,9 +283,9 @@ su "$app" <<ADMIN
|
|||
|
||||
# Make user admin
|
||||
MIX_ENV=prod mix pleroma.user set "$admin" --admin
|
||||
popd
|
||||
ADMIN
|
||||
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
|
|
Loading…
Add table
Reference in a new issue