diff --git a/README.md b/README.md index ef7188c..3cd42fb 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ For user friendly details about Pleroma: [see here](https://blog.soykaf.com/post - Tootdon (Android + iOS) - Tootle (iOS) -**Shipped version:** 0.9.0 +**Shipped version:** 0.9.9 ## Important points to read before installing diff --git a/conf/app.src b/conf/app.src index e4dd89f..6e673f7 100755 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=url of app's source -SOURCE_SUM=sha256 checksum +SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/archive/v0.9.9/pleroma-v0.9.9.tar.gz +SOURCE_SUM=21a25c34cfd9399e6b2feed570ea67f1f61a14304fadabb0283a03724b076a5f SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/systemd.service b/conf/systemd.service index d4bd6f0..104157b 100755 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -3,15 +3,23 @@ Description=__APP__ social network After=network.target postgresql.service [Service] -Environment="MIX_ENV=prod" -User=__APP__ -Group=__APP__ -WorkingDirectory=__FINALPATH__/__APP__ -Environment="HOME=__FINALPATH__" -ExecStart=/usr/bin/mix phx.server ExecReload=/bin/kill $MAINPID KillMode=process Restart=on-failure + +; Name of the user that runs the Pleroma service. +User=__APP__ +Group=__APP__ +; Declares that Pleroma runs in production mode. +Environment="MIX_ENV=prod" + +; Make sure that all paths fit your installation. +; Path to the home directory of the user running the Pleroma service. +Environment="HOME=__FINALPATH__" +; Path to the folder containing the Pleroma installation. +WorkingDirectory=__FINALPATH__/__APP__ +; Path to the Mix binary. +ExecStart=/usr/bin/mix phx.server StandardOutput=syslog StandardError=syslog diff --git a/manifest.json b/manifest.json index 482e2e9..c29709e 100755 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "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" }, - "version": "0.9.0~ynh4", + "version": "0.9.9~ynh1", "url": "https://git.pleroma.social/pleroma/pleroma", "license": "AGPL-3.0-only", "maintainer": { diff --git a/scripts/install b/scripts/install index 24cf001..1dfa170 100755 --- a/scripts/install +++ b/scripts/install @@ -106,6 +106,20 @@ port=$(ynh_find_port 8095) #ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port ynh_app_setting_set $app port $port +#================================================= +# INSTALL ERLANG and ELIXIR +#================================================= +ynh_print_info "Installing erlang and elixir ..." + +if [ "$(lsb_release --codename --short)" == "jessie" ]; then + sudo apt install -y ../conf/esl-erlang_21.2.6-1~debian~jessie_amd64.deb + sudo apt install -y ../conf/elixir_1.8.1-2~debian~jessie_amd64.deb +elif + [ "$(lsb_release --codename --short)" == "stretch" ]; then + sudo apt install -y ../conf/esl-erlang_21.2.6-1~debian~stretch_amd64.deb + sudo apt install -y ../conf/elixir_1.8.1-2~debian~stretch_amd64.deb +fi + #================================================= # INSTALL DEPENDENCIES #================================================= @@ -118,19 +132,6 @@ ynh_print_info "Installing dependencies ..." ### - As well as the section "REINSTALL DEPENDENCIES" in the restore script ### - And the section "UPGRADE DEPENDENCIES" in the upgrade script -# Add erlang for Debian Jessie - -if [ "$(lsb_release --codename --short)" == "jessie" ]; then - echo "deb http://packages.erlang-solutions.com/debian jessie contrib" | tee /etc/apt/sources.list.d/erlang-solutions.list -elif - [ "$(lsb_release --codename --short)" == "stretch" ]; then - echo "deb http://packages.erlang-solutions.com/debian stretch contrib" | tee /etc/apt/sources.list.d/erlang-solutions.list -fi -sudo wget https://packages.erlang-solutions.com/debian/erlang_solutions.asc -sudo apt-key add erlang_solutions.asc -sudo rm erlang_solutions.asc - -# install dependencies ynh_install_app_dependencies git build-essential openssl ssh sudo postgresql postgresql-contrib elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools #================================================= @@ -154,9 +155,11 @@ ynh_psql_create_user "$app" "$db_pwd" ynh_psql_execute_as_root \ "CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $db_name;" ynh_psql_execute_as_root "\connect $db_name -CREATE EXTENSION IF NOT EXISTS unaccent;CREATE EXTENSION IF NOT EXISTS pg_trgm;" +CREATE EXTENSION IF NOT EXISTS unaccent;" ynh_psql_execute_as_root "\connect $db_name -CREATE EXTENSION IF NOT EXISTS unaccent;CREATE EXTENSION IF NOT EXISTS citext;" +CREATE EXTENSION IF NOT EXISTS pg_trgm;" +ynh_psql_execute_as_root "\connect $db_name +CREATE EXTENSION IF NOT EXISTS citext;" ynh_psql_execute_as_root "\connect $db_name CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";" @@ -171,8 +174,7 @@ ynh_print_info "Setting up source files ..." ynh_app_setting_set $app final_path $final_path # Download, check integrity, uncompress and patch the source from app.src -#ynh_setup_source "$final_path/$app" -git clone https://git.pleroma.social/pleroma/pleroma "$final_path/$app" +ynh_setup_source "$final_path/$app" #================================================= # NGINX CONFIGURATION diff --git a/scripts/remove b/scripts/remove index 6b280b1..c4f0ffb 100755 --- a/scripts/remove +++ b/scripts/remove @@ -68,7 +68,14 @@ ynh_print_info "Removing dependencies" # Remove metapackage and its dependencies ynh_remove_app_dependencies -ynh_secure_remove "/etc/apt/sources.list.d/erlang-solutions.list" + +#================================================= +# REMOVE ERLANG AND ELIXIR +#================================================= +ynh_print_info "Removing erlang and elixir..." + +sudo apt remove -y esl-erlang +sudo apt remove -y elixir #================================================= # REMOVE APP MAIN DIR diff --git a/scripts/restore b/scripts/restore index f8412bc..55909ad 100755 --- a/scripts/restore +++ b/scripts/restore @@ -89,23 +89,25 @@ chown -R "$app":"$app" "$final_path" #================================================= # SPECIFIC RESTORATION +#================================================= +# INSTALL ERLANG and ELIXIR +#================================================= +ynh_print_info "Installing erlang and elixir ..." + +if [ "$(lsb_release --codename --short)" == "jessie" ]; then + sudo apt install -y ../settings/conf/esl-erlang_21.2.6-1~debian~jessie_amd64.deb + sudo apt install -y ../settings/conf/elixir_1.8.1-2~debian~jessie_amd64.deb +elif + [ "$(lsb_release --codename --short)" == "stretch" ]; then + sudo apt install -y ../settings/conf/esl-erlang_21.2.6-1~debian~stretch_amd64.deb + sudo apt install -y ../settings/conf/elixir_1.8.1-2~debian~stretch_amd64.deb +fi + #================================================= # REINSTALL DEPENDENCIES #================================================= ynh_print_info "Reinstalling dependencies..." -# Add erlang for Debian Jessie - -if [ "$(lsb_release --codename --short)" == "jessie" ]; then - echo "deb http://packages.erlang-solutions.com/debian jessie contrib" | tee /etc/apt/sources.list.d/erlang-solutions.list -elif - [ "$(lsb_release --codename --short)" == "stretch" ]; then - echo "deb http://packages.erlang-solutions.com/debian stretch contrib" | tee /etc/apt/sources.list.d/erlang-solutions.list -fi -sudo wget https://packages.erlang-solutions.com/debian/erlang_solutions.asc -sudo apt-key add erlang_solutions.asc -sudo rm erlang_solutions.asc - # Define and install dependencies ynh_install_app_dependencies git build-essential openssl ssh sudo postgresql postgresql-contrib elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools @@ -119,9 +121,11 @@ ynh_psql_create_user "$app" "$db_pwd" ynh_psql_execute_as_root \ "CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $app;" ynh_psql_execute_as_root "\connect $db_name -CREATE EXTENSION IF NOT EXISTS unaccent;CREATE EXTENSION IF NOT EXISTS pg_trgm;" +CREATE EXTENSION IF NOT EXISTS unaccent;" ynh_psql_execute_as_root "\connect $db_name -CREATE EXTENSION IF NOT EXISTS unaccent;CREATE EXTENSION IF NOT EXISTS citext;" +CREATE EXTENSION IF NOT EXISTS pg_trgm;" +ynh_psql_execute_as_root "\connect $db_name +CREATE EXTENSION IF NOT EXISTS citext;" ynh_psql_execute_file_as_root ./db.sql "$db_name" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index a625d2d..a5f14e1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -70,6 +70,9 @@ if [ -z $final_path ]; then ynh_app_setting_set $app final_path $final_path fi +# Remove repository +ynh_secure_remove "/etc/apt/sources.list.d/erlang-solutions.list" + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -106,11 +109,7 @@ path_url=$(ynh_normalize_url_path $path_url) ynh_print_info "Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src -#ynh_setup_source "$final_path/$app" -pushd $final_path/$app - git reset --hard - git pull --quiet -popd +ynh_setup_source "$final_path/$app" #================================================= # NGINX CONFIGURATION @@ -133,23 +132,25 @@ then ynh_store_file_checksum "/etc/nginx/conf.d/$domain.d/$app.conf" fi +#================================================= +# INSTALL ERLANG and ELIXIR +#================================================= +ynh_print_info "Installing erlang and elixir ..." + +if [ "$(lsb_release --codename --short)" == "jessie" ]; then + sudo apt install -y ../conf/esl-erlang_21.2.6-1~debian~jessie_amd64.deb + sudo apt install -y ../conf/elixir_1.8.1-2~debian~jessie_amd64.deb +elif + [ "$(lsb_release --codename --short)" == "stretch" ]; then + sudo apt install -y ../conf/esl-erlang_21.2.6-1~debian~stretch_amd64.deb + sudo apt install -y ../conf/elixir_1.8.1-2~debian~stretch_amd64.deb +fi + #================================================= # UPGRADE DEPENDENCIES #================================================= ynh_print_info "Upgrading dependencies..." -# Add erlang for Debian Jessie - -if [ "$(lsb_release --codename --short)" == "jessie" ]; then - echo "deb http://packages.erlang-solutions.com/debian jessie contrib" | tee /etc/apt/sources.list.d/erlang-solutions.list -elif - [ "$(lsb_release --codename --short)" == "stretch" ]; then - echo "deb http://packages.erlang-solutions.com/debian stretch contrib" | tee /etc/apt/sources.list.d/erlang-solutions.list -fi -sudo wget https://packages.erlang-solutions.com/debian/erlang_solutions.asc -sudo apt-key add erlang_solutions.asc -sudo rm erlang_solutions.asc - # install dependencies ynh_install_app_dependencies git build-essential openssl ssh sudo postgresql postgresql-contrib elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools