From 677999232b8b7f0bede2831b4073f2c6b5f1abc1 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Mar 2019 01:10:25 +0100 Subject: [PATCH 01/17] Apply last example_ynh --- pull_request_template.md | 23 +++++++++++++++++++++++ scripts/_common.sh | 7 +++++++ scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 4 +++- 5 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 pull_request_template.md diff --git a/pull_request_template.md b/pull_request_template.md new file mode 100644 index 0000000..4f6a1d4 --- /dev/null +++ b/pull_request_template.md @@ -0,0 +1,23 @@ +## Problem +- *Description of why you made this PR* + +## Solution +- *And how do you fix that problem* + +## PR Status +- [ ] Code finished. +- [ ] Tested with Package_check. +- [ ] Fix or enhancement tested. +- [ ] Upgrade from last version tested. +- [ ] Can be reviewed and tested. + +## Validation +--- +- [ ] **Code review** +- [ ] **Approval (LGTM)** +*Code review and approval have to be from a member of @YunoHost/apps group* +- **CI succeeded** : +[![Build Status](https://ci-apps-hq.yunohost.org/jenkins/job/APP_ynh%20-BRANCH-/badge/icon)](https://ci-apps-hq.yunohost.org/jenkins/job/APP_ynh%20-BRANCH-/) +*Please replace '-BRANCH-' in this link by the name of the branch used.* +*If the PR is from a forked repository. Please provide public results from package_check.* +When the PR is marked as ready to merge, you have to wait for 3 days before really merging it. diff --git a/scripts/_common.sh b/scripts/_common.sh index b905339..7427ffb 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,5 +1,12 @@ #!/bin/bash +#================================================= +# COMMON VARIABLES +#================================================= + +# dependencies used by the app +pkg_dependencies="git build-essential openssl ssh sudo postgresql postgresql-contrib elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools" + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 253589d..dc4bc65 100755 --- a/scripts/install +++ b/scripts/install @@ -132,7 +132,7 @@ 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 -ynh_install_app_dependencies git build-essential openssl ssh sudo postgresql postgresql-contrib elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools +ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE A POSTGRESQL DATABASE diff --git a/scripts/restore b/scripts/restore index 55909ad..97a8b4e 100755 --- a/scripts/restore +++ b/scripts/restore @@ -109,7 +109,7 @@ fi ynh_print_info "Reinstalling dependencies..." # 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 +ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE POSTGRESQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index fcdc0c6..62f883e 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -109,6 +109,8 @@ 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" + git clone --quiet https://git.pleroma.social/pleroma/pleroma "$final_path/upgrade" pushd "$final_path/upgrade" git checkout -b master @@ -157,7 +159,7 @@ fi ynh_print_info "Upgrading dependencies..." # install dependencies -ynh_install_app_dependencies git build-essential openssl ssh sudo postgresql postgresql-contrib elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools +ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER From 74bc5090702d48f6fffbb47147088dd7ba12af36 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Mar 2019 01:11:47 +0100 Subject: [PATCH 02/17] fix template --- pull_request_template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pull_request_template.md b/pull_request_template.md index 4f6a1d4..1bf7391 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -17,7 +17,7 @@ - [ ] **Approval (LGTM)** *Code review and approval have to be from a member of @YunoHost/apps group* - **CI succeeded** : -[![Build Status](https://ci-apps-hq.yunohost.org/jenkins/job/APP_ynh%20-BRANCH-/badge/icon)](https://ci-apps-hq.yunohost.org/jenkins/job/APP_ynh%20-BRANCH-/) +[![Build Status](https://ci-apps-hq.yunohost.org/jenkins/job/pleroma_ynh%20-BRANCH-/badge/icon)](https://ci-apps-hq.yunohost.org/jenkins/job/pleroma_ynh%20-BRANCH-/) *Please replace '-BRANCH-' in this link by the name of the branch used.* *If the PR is from a forked repository. Please provide public results from package_check.* When the PR is marked as ready to merge, you have to wait for 3 days before really merging it. From 7263d59164221e0ca4b4a5ca1301598d21582d47 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 16 Mar 2019 14:31:33 +0100 Subject: [PATCH 03/17] add yunopannel --- conf/nginx.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index 7de2dd3..1502215 100755 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -32,4 +32,7 @@ proxy_pass http://localhost:__PORT__; client_max_body_size 16m; + + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; } From 59a436039bb32d0c6dd18fc78010f9468c3eaf64 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 16 Mar 2019 14:41:39 +0100 Subject: [PATCH 04/17] make yunohot tile appear --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 1502215..6be7e2c 100755 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -19,7 +19,7 @@ add_header X-Content-Type-Options "nosniff" always; add_header Referrer-Policy "same-origin" always; add_header X-Download-Options "noopen" always; - add_header Content-Security-Policy "default-src 'none'; base-uri 'self'; form-action *; frame-ancestors 'none'; img-src 'self' data: https:; media-src 'self' https:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self' wss://__DOMAIN__; upgrade-insecure-requests;" always; + #add_header Content-Security-Policy "default-src 'none'; base-uri 'self'; form-action *; frame-ancestors 'none'; img-src 'self' data: https:; media-src 'self' https:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self' wss://__DOMAIN__; upgrade-insecure-requests;" always; # Uncomment this only after you get HTTPS working. # add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; From 22c81a10571298e9caced665d2cbc5154e4aabd6 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 16 Mar 2019 15:24:35 +0100 Subject: [PATCH 05/17] Fix Package Linter recommandations --- scripts/install | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index dc4bc65..c58f74a 100755 --- a/scripts/install +++ b/scripts/install @@ -152,16 +152,10 @@ ynh_app_setting_set $app db_name $db_name ynh_app_setting_set "$app" db_pwd "$db_pwd" ynh_psql_test_if_first_run 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;" -ynh_psql_execute_as_root "\connect $db_name -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\";" +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 "CREATE EXTENSION IF NOT EXISTS citext;" +ynh_psql_execute_as_root "CREATE EXTENSION IF NOT EXISTS pg_trgm;" +ynh_psql_execute_as_root "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE From 900ddc0ed331af6429c3ed227559933a3976ed50 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 16 Mar 2019 15:39:58 +0100 Subject: [PATCH 06/17] fix package linter recommandations --- scripts/remove | 3 +-- scripts/restore | 12 ++++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/scripts/remove b/scripts/remove index 50479bb..e465098 100755 --- a/scripts/remove +++ b/scripts/remove @@ -55,8 +55,7 @@ ynh_remove_systemd_config #================================================= ynh_print_info "Removing the PostgreSQL database" -ynh_psql_execute_as_root "\connect $db_name -SELECT pg_terminate_backend (pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = '$db_name';" +ynh_psql_execute_as_root "SELECT pg_terminate_backend (pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = '$db_name';" # Remove a database if it exists, along with the associated user ynh_psql_remove_db "$db_name" "$db_name" diff --git a/scripts/restore b/scripts/restore index 97a8b4e..1a7a0ab 100755 --- a/scripts/restore +++ b/scripts/restore @@ -118,14 +118,10 @@ ynh_print_info "Restoring the PostgreSQL database..." ynh_psql_test_if_first_run 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;" -ynh_psql_execute_as_root "\connect $db_name -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 "CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $app;" +ynh_psql_execute_as_root "CREATE EXTENSION IF NOT EXISTS citext;" +ynh_psql_execute_as_root "CREATE EXTENSION IF NOT EXISTS pg_trgm;" +ynh_psql_execute_as_root "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";" ynh_psql_execute_file_as_root ./db.sql "$db_name" #================================================= From 3498ec122d1762e831762fd8bb0395013bbd1a6c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 16 Mar 2019 15:42:50 +0100 Subject: [PATCH 07/17] Add new media proxy parameters --- conf/media.conf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/conf/media.conf b/conf/media.conf index 3b5b81e..768b570 100644 --- a/conf/media.conf +++ b/conf/media.conf @@ -1,6 +1,13 @@ location /proxy { proxy_cache {APP}_media_cache; + proxy_cache_key $host$uri$is_args$args; + proxy_http_version 1.1; + proxy_cache_valid 200 206 301 304 1h; proxy_cache_lock on; proxy_ignore_client_abort on; + proxy_buffering on; + chunked_transfer_encoding on; + proxy_ignore_headers Cache-Control; + proxy_hide_header Cache-Control; proxy_pass http://localhost:__PORT__; } From d18338091326d339bf75e7040172f57727cccf67 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 16 Mar 2019 15:53:31 +0100 Subject: [PATCH 08/17] Fix ** (Postgrex.Error) ERROR 42501 (insufficient_privilege): permission denied to create extension "citext" --- scripts/install | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index c58f74a..180b4ac 100755 --- a/scripts/install +++ b/scripts/install @@ -153,9 +153,10 @@ ynh_app_setting_set "$app" db_pwd "$db_pwd" ynh_psql_test_if_first_run 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 "CREATE EXTENSION IF NOT EXISTS citext;" -ynh_psql_execute_as_root "CREATE EXTENSION IF NOT EXISTS pg_trgm;" -ynh_psql_execute_as_root "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";" +ynh_psql_execute_as_root "CREATE EXTENSION IF NOT EXISTS unaccent;" $db_name +ynh_psql_execute_as_root "CREATE EXTENSION IF NOT EXISTS pg_trgm;" $db_name +ynh_psql_execute_as_root "CREATE EXTENSION IF NOT EXISTS citext;" $db_name +ynh_psql_execute_as_root "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";"$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE From 759417b449318bacd531bd5496a7c9afd03be51c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 16 Mar 2019 16:09:18 +0100 Subject: [PATCH 09/17] Fix ** (Postgrex.Error) ERROR 42501 (insufficient_privilege): permission denied to create extension "citext" --- scripts/install | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 180b4ac..425ee92 100755 --- a/scripts/install +++ b/scripts/install @@ -153,10 +153,14 @@ ynh_app_setting_set "$app" db_pwd "$db_pwd" ynh_psql_test_if_first_run 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 "CREATE EXTENSION IF NOT EXISTS unaccent;" $db_name -ynh_psql_execute_as_root "CREATE EXTENSION IF NOT EXISTS pg_trgm;" $db_name -ynh_psql_execute_as_root "CREATE EXTENSION IF NOT EXISTS citext;" $db_name -ynh_psql_execute_as_root "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";"$db_name +ynh_psql_execute_as_root "\connect $db_name +CREATE EXTENSION IF NOT EXISTS unaccent;" +ynh_psql_execute_as_root "\connect $db_name +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\";" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE From 32188648762c6566de1686a044a0239062a5d990 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 17 Mar 2019 03:52:56 +0100 Subject: [PATCH 10/17] Fix ynh_psql_execute_as_root --- scripts/remove | 3 ++- scripts/restore | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/remove b/scripts/remove index e465098..50479bb 100755 --- a/scripts/remove +++ b/scripts/remove @@ -55,7 +55,8 @@ ynh_remove_systemd_config #================================================= ynh_print_info "Removing the PostgreSQL database" -ynh_psql_execute_as_root "SELECT pg_terminate_backend (pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = '$db_name';" +ynh_psql_execute_as_root "\connect $db_name +SELECT pg_terminate_backend (pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = '$db_name';" # Remove a database if it exists, along with the associated user ynh_psql_remove_db "$db_name" "$db_name" diff --git a/scripts/restore b/scripts/restore index 1a7a0ab..8116c0c 100755 --- a/scripts/restore +++ b/scripts/restore @@ -118,10 +118,15 @@ ynh_print_info "Restoring the PostgreSQL database..." ynh_psql_test_if_first_run 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 "CREATE EXTENSION IF NOT EXISTS citext;" -ynh_psql_execute_as_root "CREATE EXTENSION IF NOT EXISTS pg_trgm;" -ynh_psql_execute_as_root "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";" +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;" +ynh_psql_execute_as_root "\connect $db_name +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\";" ynh_psql_execute_file_as_root ./db.sql "$db_name" #================================================= From a1e67a54e7b3d5e222d8c28d35e578c40fb871a6 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 17 Mar 2019 22:50:36 +0100 Subject: [PATCH 11/17] Upgrade to 0.9.999 --- README.md | 2 +- manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3cd42fb..1f0e015 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.9 +**Shipped version:** 0.9.999 ## Important points to read before installing diff --git a/manifest.json b/manifest.json index e3081ae..f1f3cf9 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.9~ynh2", + "version": "0.9.999~ynh3", "url": "https://git.pleroma.social/pleroma/pleroma", "license": "AGPL-3.0-only", "maintainer": { From ee70509ce1619f88f59f7b06618ab2dcfed18cd5 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 17 Mar 2019 23:04:59 +0100 Subject: [PATCH 12/17] Add erlang-eldap dependency --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 7427ffb..2592400 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="git build-essential openssl ssh sudo postgresql postgresql-contrib elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools" +pkg_dependencies="git build-essential postgresql postgresql-contrib elixir erlang-dev erlang-tools erlang-parsetools erlang-eldap erlang-xmerl openssl ssh sudo" #================================================= # PERSONAL HELPERS From 241f95935cab3cc052cdeea30c61b05a465e91af Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 17 Mar 2019 23:35:04 +0100 Subject: [PATCH 13/17] Force listening locally --- conf/generated_config.exs | 2 +- conf/media.conf | 5 ++++- conf/nginx.conf | 19 +++++++++++-------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/conf/generated_config.exs b/conf/generated_config.exs index 6b7eebe..8781368 100644 --- a/conf/generated_config.exs +++ b/conf/generated_config.exs @@ -8,7 +8,7 @@ use Mix.Config config :pleroma, Pleroma.Web.Endpoint, url: [host: "__DOMAIN__", scheme: "https", port: 443], secret_key_base: "__KEY__", - http: [port: __PORT__] + http: [ip: {127, 0, 0, 1}, port: __PORT__] config :pleroma, :instance, name: "__INSTANCE_NAME__", diff --git a/conf/media.conf b/conf/media.conf index 768b570..550fae5 100644 --- a/conf/media.conf +++ b/conf/media.conf @@ -1,4 +1,6 @@ - location /proxy { + rewrite ^/proxy/(.*)/(.*)/.* /proxy/$1/$2 last; + + location ~ ^/(media|proxy) { proxy_cache {APP}_media_cache; proxy_cache_key $host$uri$is_args$args; proxy_http_version 1.1; @@ -9,5 +11,6 @@ chunked_transfer_encoding on; proxy_ignore_headers Cache-Control; proxy_hide_header Cache-Control; + proxy_pass http://localhost:__PORT__; } diff --git a/conf/nginx.conf b/conf/nginx.conf index 6be7e2c..e1fb8e7 100755 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,6 +4,17 @@ if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } + + # Standard nginx configuration + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $http_host; + + proxy_pass http://localhost:__PORT__; + + client_max_body_size 16m; + add_header 'Access-Control-Allow-Origin' '*' always; add_header 'Access-Control-Allow-Methods' 'POST, PUT, DELETE, GET, PATCH, OPTIONS' always; add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, Idempotency-Key' always; @@ -24,14 +35,6 @@ # Uncomment this only after you get HTTPS working. # add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $http_host; - - proxy_pass http://localhost:__PORT__; - - client_max_body_size 16m; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; From 69b0ad9bb0e73cc671edeabb56a288c0037655d5 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 18 Mar 2019 00:07:48 +0100 Subject: [PATCH 14/17] Back to erlang repo --- scripts/install | 11 ++++++----- scripts/remove | 4 ++-- scripts/restore | 11 ++++++----- scripts/upgrade | 11 ++++++----- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/scripts/install b/scripts/install index 425ee92..bc35183 100755 --- a/scripts/install +++ b/scripts/install @@ -107,18 +107,19 @@ port=$(ynh_find_port 8095) ynh_app_setting_set $app port $port #================================================= -# INSTALL ERLANG and ELIXIR +# 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 + 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 - 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 + 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 diff --git a/scripts/remove b/scripts/remove index 50479bb..ffa9bc3 100755 --- a/scripts/remove +++ b/scripts/remove @@ -74,8 +74,8 @@ ynh_remove_app_dependencies #================================================= ynh_print_info "Removing erlang and elixir..." -sudo apt remove -y esl-erlang -sudo apt remove -y elixir +ynh_secure_remove "/etc/apt/sources.list.d/erlang-solutions.list" +apt-key del A14F4FCA #================================================= # REMOVE APP MAIN DIR diff --git a/scripts/restore b/scripts/restore index 8116c0c..1002244 100755 --- a/scripts/restore +++ b/scripts/restore @@ -90,18 +90,19 @@ chown -R "$app":"$app" "$final_path" #================================================= # SPECIFIC RESTORATION #================================================= -# INSTALL ERLANG and ELIXIR +# 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 + 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 - 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 + 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 #================================================= # REINSTALL DEPENDENCIES diff --git a/scripts/upgrade b/scripts/upgrade index 62f883e..840844c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -140,18 +140,19 @@ then fi #================================================= -# INSTALL ERLANG and ELIXIR +# 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 + 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 - 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 + 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 #================================================= # UPGRADE DEPENDENCIES From 9be842e73d837a652ef8621ae98b4f6b03a660e0 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 18 Mar 2019 04:36:44 +0100 Subject: [PATCH 15/17] Update check_process --- check_process | 1 + 1 file changed, 1 insertion(+) diff --git a/check_process b/check_process index 285320a..8cbb681 100755 --- a/check_process +++ b/check_process @@ -21,6 +21,7 @@ setup_private=1 setup_public=1 upgrade=1 + upgrade=1 from_commit=4b73b1c40775141ed1f1bf6f1c9ac4bb69d93d46 backup_restore=1 multi_instance=1 incorrect_path=1 From 80b66a55a72326e2e2db71e3e8b42b221c8fa3ed Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 18 Mar 2019 20:38:27 +0100 Subject: [PATCH 16/17] Update upgrade --- scripts/upgrade | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 840844c..e2cfa40 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -144,6 +144,10 @@ fi #================================================= ynh_print_info "Installing erlang and elixir ..." +#remove old erlang packages +sudo apt remove -y esl-erlang +sudo apt remove -y elixir + 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 From 073aae276c347fd887745971ba4f7073d40348d3 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 20 Mar 2019 01:18:54 +0100 Subject: [PATCH 17/17] Update check_process --- check_process | 1 - 1 file changed, 1 deletion(-) diff --git a/check_process b/check_process index 8cbb681..285320a 100755 --- a/check_process +++ b/check_process @@ -21,7 +21,6 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=4b73b1c40775141ed1f1bf6f1c9ac4bb69d93d46 backup_restore=1 multi_instance=1 incorrect_path=1