1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pleroma_ynh.git synced 2024-09-03 20:15:59 +02:00
This commit is contained in:
yalh76 2019-02-05 19:26:12 +01:00
parent e25a246d19
commit 04cafbc8e4
6 changed files with 16 additions and 16 deletions

View file

@ -6,7 +6,7 @@
"en": "Pleroma is an OStatus-compatible social networking server written in Elixir, compatible with GNU Social and Mastodon", "en": "Pleroma is an OStatus-compatible social networking server written in Elixir, compatible with GNU Social and Mastodon",
"fr": "Pleroma est un réseau social écrit en Elixir, compatible avec OStatus, GNU Social et Mastodon" "fr": "Pleroma est un réseau social écrit en Elixir, compatible avec OStatus, GNU Social et Mastodon"
}, },
"version": "0.9.0~ynh2", "version": "0.9.0~ynh3",
"url": "https://git.pleroma.social/pleroma/pleroma", "url": "https://git.pleroma.social/pleroma/pleroma",
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
"maintainer": { "maintainer": {

View file

@ -29,7 +29,7 @@ app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get $app final_path)
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get $app domain)
db_name=$(ynh_app_setting_get "$app" db_name) db_name=$(ynh_app_setting_get $app db_name)
cache=$(ynh_app_setting_get "$app" cache) cache=$(ynh_app_setting_get "$app" cache)
#================================================= #=================================================

View file

@ -44,7 +44,6 @@ then
admin="test" admin="test"
fi fi
### If it's a multi-instance app, meaning it can be installed several times independently ### If it's a multi-instance app, meaning it can be installed several times independently
### The id of the app as stated in the manifest is available as $YNH_APP_ID ### The id of the app as stated in the manifest is available as $YNH_APP_ID
### The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2", ...) ### The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2", ...)
@ -128,7 +127,7 @@ sudo apt-key add erlang_solutions.asc
sudo rm erlang_solutions.asc sudo rm erlang_solutions.asc
# install dependencies # install dependencies
ynh_install_app_dependencies git build-essential postgresql postgresql-contrib openssl g++ apt-transport-https erlang-inets elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools ynh_install_app_dependencies git build-essential openssl ssh sudo postgresql postgresql-contrib elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools
#================================================= #=================================================
# CREATE A POSTGRESQL DATABASE # CREATE A POSTGRESQL DATABASE
@ -141,9 +140,9 @@ ynh_install_app_dependencies git build-essential postgresql postgresql-contrib o
### - Remove also the section "REMOVE THE POSTGRESQL DATABASE" in the remove script ### - Remove also the section "REMOVE THE POSTGRESQL DATABASE" in the remove script
### - As well as the section "RESTORE THE POSTGRESQL DATABASE" in the restore script ### - As well as the section "RESTORE THE POSTGRESQL DATABASE" in the restore script
db_name="$app" db_name=$(ynh_sanitize_dbid $app)
db_pwd=$(ynh_string_random 30) db_pwd=$(ynh_string_random 30)
ynh_app_setting_set "$app" db_name "$db_name" ynh_app_setting_set $app db_name $db_name
ynh_app_setting_set "$app" db_pwd "$db_pwd" ynh_app_setting_set "$app" db_pwd "$db_pwd"
ynh_psql_test_if_first_run ynh_psql_test_if_first_run
ynh_psql_create_user "$app" "$db_pwd" ynh_psql_create_user "$app" "$db_pwd"
@ -219,6 +218,7 @@ ynh_system_user_create "$app" "$final_path"
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================
cp -f ../conf/generated_config.exs "$final_path/$app/config/prod.secret.exs" cp -f ../conf/generated_config.exs "$final_path/$app/config/prod.secret.exs"
ynh_replace_string "__DOMAIN__" "$domain" "$final_path/$app/config/prod.secret.exs" ynh_replace_string "__DOMAIN__" "$domain" "$final_path/$app/config/prod.secret.exs"
@ -253,6 +253,7 @@ cp -f ../conf/prod.exs "$final_path/$app/config/prod.exs"
#================================================= #=================================================
# MAKE SETUP # MAKE SETUP
#================================================= #=================================================
# Give permission to the final_path # Give permission to the final_path
chown -R "$app":"$app" "$final_path" chown -R "$app":"$app" "$final_path"
@ -271,7 +272,6 @@ pushd $final_path/$app
ynh_replace_string "administrator@example.com" "__ADMIN_EMAIL__" "$final_path/$app/config/prod.secret.exs" ynh_replace_string "administrator@example.com" "__ADMIN_EMAIL__" "$final_path/$app/config/prod.secret.exs"
popd popd
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================

View file

@ -18,7 +18,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get $app domain)
port=$(ynh_app_setting_get $app port) port=$(ynh_app_setting_get $app port)
db_name=$(ynh_app_setting_get "$app" db_name) db_name=$(ynh_app_setting_get $app db_name)
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get $app final_path)
cache=$(ynh_app_setting_get "$app" cache) cache=$(ynh_app_setting_get "$app" cache)

View file

@ -30,10 +30,10 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get $app domain)
path_url="/" path_url="/"
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get $app final_path)
port=$(ynh_app_setting_get "$app" port) port=$(ynh_app_setting_get $app port)
db_name=$(ynh_app_setting_get "$app" db_name) db_name=$(ynh_app_setting_get $app db_name)
db_pwd=$(ynh_app_setting_get "$app" db_pwd) db_pwd=$(ynh_app_setting_get $app db_pwd)
cache=$(ynh_app_setting_get "$app" cache) cache=$(ynh_app_setting_get $app cache)
#================================================= #=================================================
@ -117,7 +117,7 @@ sudo apt-key add erlang_solutions.asc
sudo rm erlang_solutions.asc sudo rm erlang_solutions.asc
# install dependencies # install dependencies
ynh_install_app_dependencies git build-essential postgresql postgresql-contrib openssl g++ apt-transport-https erlang-inets elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools ynh_install_app_dependencies git build-essential openssl ssh sudo postgresql postgresql-contrib elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools
#================================================= #=================================================
# RESTORE SYSTEMD # RESTORE SYSTEMD

View file

@ -142,8 +142,7 @@ sudo apt-key add erlang_solutions.asc
sudo rm erlang_solutions.asc sudo rm erlang_solutions.asc
# install dependencies # install dependencies
ynh_install_app_dependencies git build-essential postgresql postgresql-contrib openssl g++ apt-transport-https erlang-inets elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools ynh_install_app_dependencies git build-essential openssl ssh sudo postgresql postgresql-contrib elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
@ -164,6 +163,7 @@ ynh_system_user_create "$app" "$final_path"
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================
cp -f ../conf/generated_config.exs "$final_path/$app/config/prod.secret.exs" cp -f ../conf/generated_config.exs "$final_path/$app/config/prod.secret.exs"
ynh_replace_string "__DOMAIN__" "$domain" "$final_path/$app/config/prod.secret.exs" ynh_replace_string "__DOMAIN__" "$domain" "$final_path/$app/config/prod.secret.exs"
@ -212,7 +212,7 @@ cp -f ../conf/prod.exs "$final_path/$app/config/prod.exs"
# 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 pushd $final_path/$app
sudo -u "$app" mix deps.get sudo -u "$app" MIX_ENV=prod mix deps.get
sudo -u "$app" MIX_ENV=prod mix ecto.migrate --force sudo -u "$app" MIX_ENV=prod mix ecto.migrate --force
popd popd