From 05915f39efc4d49e47b3c77e9e1565fd612d61ad Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 24 Feb 2019 15:15:43 +0100 Subject: [PATCH 1/6] Upgrade to 0.9.9 --- README.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- scripts/install | 3 +-- scripts/upgrade | 6 +----- 5 files changed, 6 insertions(+), 11 deletions(-) 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/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 6ea7a71..aba974d 100755 --- a/scripts/install +++ b/scripts/install @@ -172,8 +172,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/upgrade b/scripts/upgrade index 8b74dde..fe8df2b 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -109,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 From 69f73daf7b13009792b604ccd216590aba69a464 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 24 Feb 2019 15:45:53 +0100 Subject: [PATCH 2/6] Upgrade to 0.9.9 final --- conf/systemd.service | 20 ++++++++++++++------ scripts/install | 6 ++++-- 2 files changed, 18 insertions(+), 8 deletions(-) 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/scripts/install b/scripts/install index aba974d..0fa213d 100755 --- a/scripts/install +++ b/scripts/install @@ -155,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\";" From d109508c4cdc543ff803675c7a5ce8755fab5f38 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 24 Feb 2019 15:48:11 +0100 Subject: [PATCH 3/6] remove repo dependency --- scripts/upgrade | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index fe8df2b..9bc7acd 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -132,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 ../sources/esl-erlang_21.2.6-1~debian~jessie_amd64.deb + sudo apt install -y ../sources/elixir_1.8.1-2~debian~jessie_amd64.deb +elif + [ "$(lsb_release --codename --short)" == "stretch" ]; then + sudo apt install -y ../sources/esl-erlang_21.2.6-1~debian~stretch_amd64.deb + sudo apt install -y ../sources/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 From 8cb35d698d0847fe2b0166924f388d5f68b9223c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 24 Feb 2019 16:47:21 +0100 Subject: [PATCH 4/6] Fix restore --- scripts/restore | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/scripts/restore b/scripts/restore index f8412bc..ca391e1 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 ../sources/esl-erlang_21.2.6-1~debian~jessie_amd64.deb + sudo apt install -y ../sources/elixir_1.8.1-2~debian~jessie_amd64.deb +elif + [ "$(lsb_release --codename --short)" == "stretch" ]; then + sudo apt install -y ../sources/esl-erlang_21.2.6-1~debian~stretch_amd64.deb + sudo apt install -y ../sources/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" #================================================= From 3135783df6203037932b569d3e93e76dd383f991 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 24 Feb 2019 17:41:40 +0100 Subject: [PATCH 5/6] Fix restore script for erlang and elixir --- scripts/restore | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/restore b/scripts/restore index ca391e1..143a36d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -95,12 +95,12 @@ chown -R "$app":"$app" "$final_path" ynh_print_info "Installing erlang and elixir ..." if [ "$(lsb_release --codename --short)" == "jessie" ]; then - sudo apt install -y ../sources/esl-erlang_21.2.6-1~debian~jessie_amd64.deb - sudo apt install -y ../sources/elixir_1.8.1-2~debian~jessie_amd64.deb + sudo apt install -y ../settings/sources/esl-erlang_21.2.6-1~debian~jessie_amd64.deb + sudo apt install -y ../settings/sources/elixir_1.8.1-2~debian~jessie_amd64.deb elif [ "$(lsb_release --codename --short)" == "stretch" ]; then - sudo apt install -y ../sources/esl-erlang_21.2.6-1~debian~stretch_amd64.deb - sudo apt install -y ../sources/elixir_1.8.1-2~debian~stretch_amd64.deb + sudo apt install -y ../settings/sources/esl-erlang_21.2.6-1~debian~stretch_amd64.deb + sudo apt install -y ../settings/sources/elixir_1.8.1-2~debian~stretch_amd64.deb fi #================================================= From 68dd388246bbb5760e6219b6e03799ddc655c4e7 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 24 Feb 2019 19:07:50 +0100 Subject: [PATCH 6/6] Change .deb path --- scripts/install | 8 ++++---- scripts/restore | 8 ++++---- scripts/upgrade | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/install b/scripts/install index 0fa213d..1dfa170 100755 --- a/scripts/install +++ b/scripts/install @@ -112,12 +112,12 @@ ynh_app_setting_set $app port $port ynh_print_info "Installing erlang and elixir ..." if [ "$(lsb_release --codename --short)" == "jessie" ]; then - sudo apt install -y ../sources/esl-erlang_21.2.6-1~debian~jessie_amd64.deb - sudo apt install -y ../sources/elixir_1.8.1-2~debian~jessie_amd64.deb + 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 ../sources/esl-erlang_21.2.6-1~debian~stretch_amd64.deb - sudo apt install -y ../sources/elixir_1.8.1-2~debian~stretch_amd64.deb + 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 #================================================= diff --git a/scripts/restore b/scripts/restore index 143a36d..55909ad 100755 --- a/scripts/restore +++ b/scripts/restore @@ -95,12 +95,12 @@ chown -R "$app":"$app" "$final_path" ynh_print_info "Installing erlang and elixir ..." if [ "$(lsb_release --codename --short)" == "jessie" ]; then - sudo apt install -y ../settings/sources/esl-erlang_21.2.6-1~debian~jessie_amd64.deb - sudo apt install -y ../settings/sources/elixir_1.8.1-2~debian~jessie_amd64.deb + 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/sources/esl-erlang_21.2.6-1~debian~stretch_amd64.deb - sudo apt install -y ../settings/sources/elixir_1.8.1-2~debian~stretch_amd64.deb + 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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 9bc7acd..a5f14e1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -138,12 +138,12 @@ fi ynh_print_info "Installing erlang and elixir ..." if [ "$(lsb_release --codename --short)" == "jessie" ]; then - sudo apt install -y ../sources/esl-erlang_21.2.6-1~debian~jessie_amd64.deb - sudo apt install -y ../sources/elixir_1.8.1-2~debian~jessie_amd64.deb + 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 ../sources/esl-erlang_21.2.6-1~debian~stretch_amd64.deb - sudo apt install -y ../sources/elixir_1.8.1-2~debian~stretch_amd64.deb + 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 #=================================================