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
|
# Give permission to the final_path
|
||||||
chown -R "$app":"$app" "$final_path"
|
chown -R "$app":"$app" "$final_path"
|
||||||
|
|
||||||
pushd $final_path/$app
|
|
||||||
# Install dependecies
|
# 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.hex --force
|
||||||
MIX_ENV=prod mix local.rebar --force
|
MIX_ENV=prod mix local.rebar --force
|
||||||
mix deps.get
|
mix deps.get
|
||||||
|
popd
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
|
|
||||||
# Run the database migration
|
# Run the database migration
|
||||||
ynh_psql_execute_as_root \
|
ynh_psql_execute_as_root \
|
||||||
"ALTER USER $app WITH SUPERUSER;"
|
"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
|
MIX_ENV=prod mix ecto.migrate --force
|
||||||
|
popd
|
||||||
DATABASE
|
DATABASE
|
||||||
|
|
||||||
ynh_psql_execute_as_root \
|
ynh_psql_execute_as_root \
|
||||||
"ALTER USER $app WITH NOSUPERUSER;"
|
"ALTER USER $app WITH NOSUPERUSER;"
|
||||||
|
|
||||||
# Create admin account
|
# 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
|
# 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 )
|
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
|
# Make user admin
|
||||||
MIX_ENV=prod mix pleroma.user set "$admin" --admin
|
MIX_ENV=prod mix pleroma.user set "$admin" --admin
|
||||||
|
popd
|
||||||
ADMIN
|
ADMIN
|
||||||
|
|
||||||
popd
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
|
|
Loading…
Add table
Reference in a new issue