1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pleroma_ynh.git synced 2024-09-03 20:15:59 +02:00

Clean up installation + add Pair Key generation

This commit is contained in:
yalh76 2019-02-02 03:32:46 +01:00
parent 1d8e03322c
commit e688f4a7ec

View file

@ -99,7 +99,7 @@ ynh_app_setting_set "$app" random_key "$random_key"
### - Remove the section "CLOSE A PORT" in the remove script ### - Remove the section "CLOSE A PORT" in the remove script
# Find a free port # Find a free port
port=$(ynh_find_port 4000) port=$(ynh_find_port 8095)
# Open this port # Open this port
#yunohost firewall allow --no-upnp TCP $port 2>&1 #yunohost firewall allow --no-upnp TCP $port 2>&1
ynh_app_setting_set $app port $port ynh_app_setting_set $app port $port
@ -256,21 +256,28 @@ 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
# App setup and db migration # App setup and db migration
( cd $final_path/$app && sudo -u "$app" MIX_ENV=prod mix local.hex --force ) sudo -u "$app" MIX_ENV=prod mix local.hex --force
( cd $final_path/$app && sudo -u "$app" MIX_ENV=prod mix local.rebar --force ) sudo -u "$app" MIX_ENV=prod mix local.rebar --force
( cd $final_path/$app && sudo -u "$app" MIX_ENV=prod mix deps.get ) sudo -u "$app" MIX_ENV=prod mix deps.get
ynh_psql_execute_as_root \ ynh_psql_execute_as_root \
"ALTER USER $app WITH SUPERUSER;" "ALTER USER $app WITH SUPERUSER;"
( cd $final_path/$app && sudo -u "$app" MIX_ENV=prod mix ecto.migrate --force ) sudo -u "$app" MIX_ENV=prod mix ecto.migrate --force
ynh_psql_execute_as_root \ ynh_psql_execute_as_root \
"ALTER USER $app WITH NOSUPERUSER;" "ALTER USER $app WITH NOSUPERUSER;"
# Add user # Add user
( cd $final_path/$app && sudo -u "$app" MIX_ENV=prod mix pleroma.user new "$admin" "$admin_email" --password "$password" --moderator --admin -y ) sudo -u "$app" MIX_ENV=prod mix pleroma.user new "$admin" "$admin_email" --password "$password" --moderator --admin -y
#Generate key pair
sudo -u "$app" MIX_ENV=prod mix web_push.gen.keypair >> "config/config.exs"
popd
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD