1
0
Fork 0
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:
Yalh 2019-01-28 02:05:14 +01:00
parent 1951417bf1
commit f46c455770

View file

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