From cf89f044522097a9d4a10729c2c46d9b79cac455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 21 Dec 2018 17:07:37 +0000 Subject: [PATCH 1/5] Upgrade synapse to 0.34.0 --- README.md | 2 +- conf/armv7_jessie.src | 4 ++-- conf/armv7_stretch.src | 4 ++-- conf/python_source.src | 4 ++-- manifest.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b0a2dbf..800a126 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Instant messaging server matrix network. Yunohost chatroom with matrix : [https://riot.im/app/#/room/#yunohost:matrix.org](https://riot.im/app/#/room/#yunohost:matrix.org) -**Shipped version:** 0.33.9 +**Shipped version:** 0.34.0 Configuration ------------- diff --git a/conf/armv7_jessie.src b/conf/armv7_jessie.src index 99ef24b..a5a5106 100644 --- a/conf/armv7_jessie.src +++ b/conf/armv7_jessie.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v0.33.9/matrix-synapse_0.33.9-jessie-bin1_armv7l.tar.gz -SOURCE_SUM=ffa759ee9ae7aa0c96cc9c00a039df7e8f723dd81719bb603f2a535168a4e382 +SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v0.34.0/matrix-synapse_0.34.0-jessie-bin1_armv7l.tar.gz +SOURCE_SUM=a2b86b39f359377281dc8c0e55565fd482a52ceb3c24e0a9befc4bb165e39575 # (Optional) Program to check the integrity (sha256sum, md5sum...) # default: sha256 SOURCE_SUM_PRG=sha256sum diff --git a/conf/armv7_stretch.src b/conf/armv7_stretch.src index c98f13d..a110add 100644 --- a/conf/armv7_stretch.src +++ b/conf/armv7_stretch.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v0.33.9/matrix-synapse_0.33.9-stretch-bin1_armv7l.tar.gz -SOURCE_SUM=875b79987b739604dc80bf8a7861f1c21a1834f836644a069de1ff22ee3801b0 +SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v0.34.0/matrix-synapse_0.34.0-stretch-bin1_armv7l.tar.gz +SOURCE_SUM=db28673e98572d104cfb58b4a4faa27a2e856fdd3c981f4b5addc26b7be66939 # (Optional) Program to check the integrity (sha256sum, md5sum...) # default: sha256 SOURCE_SUM_PRG=sha256sum diff --git a/conf/python_source.src b/conf/python_source.src index 35fee7d..e54d34d 100644 --- a/conf/python_source.src +++ b/conf/python_source.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/matrix-org/synapse/archive/v0.33.9.tar.gz -SOURCE_SUM=a0870c157598a494774fd9b6faf7041f9c3d62ec10d88986232c5d404de93aa4 +SOURCE_URL=https://github.com/matrix-org/synapse/archive/v0.34.0.tar.gz +SOURCE_SUM=e0e380a60668738dacb9ce944d45af19367dc3f7e502a6e649898e9b6d81b8dc SOURCE_FORMAT=tar.gz SOURCE_FILENAME=synapse_source.tar.gz SOURCE_EXTRACT=false diff --git a/manifest.json b/manifest.json index 2559ce9..267a8c3 100644 --- a/manifest.json +++ b/manifest.json @@ -9,7 +9,7 @@ "en": "Instant messaging server who use matrix", "fr": "Un serveur de messagerie instantané basé sur matrix" }, - "version": "0.33.9~ynh1", + "version": "0.34.0~ynh1", "url": "http://matrix.org", "license": "Apache-2.0", "maintainer": { From 3ff83f5962740076c4575a333242faf9ee9d001f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 21 Dec 2018 08:51:45 +0100 Subject: [PATCH 2/5] Migrate to python3 --- scripts/_common.sh | 1 + scripts/install | 19 +++++++------------ scripts/restore | 2 +- scripts/upgrade | 25 ++++++++++++++++--------- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index e69de29..6cac827 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -0,0 +1 @@ +dependances="coturn build-essential python3-dev libffi-dev python3-pip python3-setuptools sqlite3 libssl-dev python3-venv libxml2-dev libxslt1-dev python3-lxml libjpeg-dev libpq-dev postgresql acl" diff --git a/scripts/install b/scripts/install index f227bdb..66c63b3 100644 --- a/scripts/install +++ b/scripts/install @@ -92,8 +92,8 @@ ynh_app_setting_set $app cli_port $cli_port # WARNING : theses command are used in INSTALL, UPGRADE, RESTORE # For any update do it in all files -ynh_install_app_dependencies coturn build-essential python2.7-dev libffi-dev python-pip python-setuptools sqlite3 libssl-dev python-virtualenv libxml2-dev libxslt1-dev python-lxml libjpeg-dev libpq-dev postgresql acl -pip install --upgrade virtualenv +ynh_install_app_dependencies $dependances +pip3 install --upgrade virtualenv #================================================= # CREATE DEDICATED USER @@ -138,7 +138,7 @@ then ynh_setup_source $final_path/ "armv7_$(lsb_release --codename --short)" else # Install virtualenv if it don't exist - test -e $final_path/bin || virtualenv -p python2.7 $final_path + test -e $final_path/bin/python3 || python3 -m venv $final_path # Install synapse in virtualenv PS1=${PS1:-} @@ -147,17 +147,12 @@ else # We set all necessary environement variable to create a python virtualenvironnement. source $final_path/bin/activate - pip install --upgrade pip - pip install --upgrade setuptools - pip install --upgrade cffi ndg-httpsclient psycopg2 lxml + pip3 install --upgrade pip + pip3 install --upgrade setuptools + pip3 install --upgrade cffi ndg-httpsclient psycopg2 lxml ynh_setup_source "/tmp" "python_source" - pip install --upgrade "/tmp/synapse_source.tar.gz" - - # Fix issue with msgpack see https://github.com/YunoHost-Apps/synapse_ynh/issues/29 - test -e $final_path/lib/python2.7/site-packages/msgpack/__init__.py || (\ - pip uninstall -y msgpack-python msgpack; \ - pip install msgpack-python) + pip3 install --upgrade "/tmp/synapse_source.tar.gz" # This function was defined when we called "source $final_path/bin/activate". With this function we undo what "$final_path/bin/activate" does deactivate diff --git a/scripts/restore b/scripts/restore index 1da0302..6b30cb9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -59,7 +59,7 @@ ynh_restore # WARNING : theses command are used in INSTALL, UPGRADE, RESTORE # For any update do it in all files -ynh_install_app_dependencies coturn build-essential python2.7-dev libffi-dev python-pip python-setuptools sqlite3 libssl-dev python-virtualenv libxml2-dev libxslt1-dev python-lxml libjpeg-dev libpq-dev postgresql acl +ynh_install_app_dependencies $dependances pip install --upgrade virtualenv #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index deede78..48190a4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -74,12 +74,24 @@ fi #================================================= # STANDARD UPGRADE STEPS +#================================================= +# INSTALL DEPENDENCIES +#================================================= + +# WARNING : theses command are used in INSTALL, UPGRADE, RESTORE +# For any update do it in all files +ynh_install_app_dependencies $dependances +pip install --upgrade virtualenv + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= # Install/upgrade synapse in virtualenv +# Clean venv is it was on python2.7 +test -e $final_path/bin/python3 || ynh_secure_remove $final_path + # WARNING : these commands are used in INSTALL, UPGRADE # For any update do it in all files @@ -88,7 +100,7 @@ then ynh_setup_source $final_path/ "armv7_$(lsb_release --codename --short)" else # Install virtualenv if it don't exist - test -e $final_path/bin || virtualenv -p python2.7 $final_path + test -e $final_path/bin/python3 || python3 -m venv $final_path # Install synapse in virtualenv PS1=${PS1:-} @@ -97,17 +109,12 @@ else # We set all necessary environement variable to create a python virtualenvironnement. source $final_path/bin/activate - pip install --upgrade setuptools - pip install --upgrade cffi ndg-httpsclient psycopg2 lxml + pip3 install --upgrade setuptools + pip3 install --upgrade cffi ndg-httpsclient psycopg2 lxml # Download and check the checksum for the synapse source ynh_setup_source "/tmp" "python_source" - pip install --upgrade "/tmp/synapse_source.tar.gz" - - # Fix issue with msgpack see https://github.com/YunoHost-Apps/synapse_ynh/issues/29 - test -e $final_path/lib/python2.7/site-packages/msgpack/__init__.py || (\ - pip uninstall -y msgpack-python msgpack; \ - pip install msgpack-python) + pip3 install --upgrade "/tmp/synapse_source.tar.gz" # This function was defined when we called "source $final_path/bin/activate". With this function we undo what "$final_path/bin/activate" does deactivate From e1a805b44110ba6b94a15315dda6302ee4aa5bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 21 Dec 2018 22:56:52 +0100 Subject: [PATCH 3/5] Update test URL --- check_process | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_process b/check_process index f0a8272..20cad3a 100644 --- a/check_process +++ b/check_process @@ -1,13 +1,13 @@ ;; General ; Manifest domain="domain.tld" (DOMAIN) - path="/_matrix/client/#/login" (PATH) + path="/_matrix/static/" (PATH) is_public=1 (PUBLIC|public=1|private=0) ; Checks pkg_linter=1 setup_sub_dir=1 setup_root=0 - setup_nourl=0 + setup_nourl=1 setup_private=0 setup_public=1 upgrade=1 From 1daa2be9340d5c277b3d47253db6bfbca6ba35ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 22 Dec 2018 22:33:33 +0100 Subject: [PATCH 4/5] Fix upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 48190a4..cbdc8a2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -81,7 +81,7 @@ fi # WARNING : theses command are used in INSTALL, UPGRADE, RESTORE # For any update do it in all files ynh_install_app_dependencies $dependances -pip install --upgrade virtualenv +pip3 install --upgrade virtualenv #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE From f6291e482fd3d2ce31b23babcb815f12c4990aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 22 Dec 2018 22:38:03 +0100 Subject: [PATCH 5/5] Reverse setup nourl --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index 20cad3a..8963b91 100644 --- a/check_process +++ b/check_process @@ -7,7 +7,7 @@ pkg_linter=1 setup_sub_dir=1 setup_root=0 - setup_nourl=1 + setup_nourl=0 setup_private=0 setup_public=1 upgrade=1