diff --git a/README.md b/README.md index b0a2dbf..2254fa9 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.1 Configuration ------------- diff --git a/check_process b/check_process index f0a8272..8963b91 100644 --- a/check_process +++ b/check_process @@ -1,7 +1,7 @@ ;; 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 diff --git a/conf/armv7_jessie.src b/conf/armv7_jessie.src index 99ef24b..62bc395 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.1/matrix-synapse_0.34.0.1-jessie-bin1_armv7l.tar.gz +SOURCE_SUM=211fc5b8d1534f56b40d462ce745a5011a262663c64cd9ce46427d1702069f3b # (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..133b504 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.1/matrix-synapse_0.34.0.1-stretch-bin1_armv7l.tar.gz +SOURCE_SUM=88c44e8f6a224bb58db6fb043dad686a711c614a949464ad628bec88863750a1 # (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..46373b9 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.1.tar.gz +SOURCE_SUM=69cc92ac9b3fd5097c2fa4da9c99e481bb18c9e861d5917b2acd70a0dbade0ef SOURCE_FORMAT=tar.gz SOURCE_FILENAME=synapse_source.tar.gz SOURCE_EXTRACT=false diff --git a/conf/virtualenv_activate b/conf/virtualenv_activate index df0ab76..a3b5883 100644 --- a/conf/virtualenv_activate +++ b/conf/virtualenv_activate @@ -2,17 +2,14 @@ # you cannot run it directly deactivate () { - unset -f pydoc >/dev/null 2>&1 - # reset old environment variables - # ! [ -z ${VAR+_} ] returns true if VAR is declared at all - if ! [ -z "${_OLD_VIRTUAL_PATH+_}" ] ; then - PATH="$_OLD_VIRTUAL_PATH" + if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then + PATH="${_OLD_VIRTUAL_PATH:-}" export PATH unset _OLD_VIRTUAL_PATH fi - if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then - PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME" + if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then + PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}" export PYTHONHOME unset _OLD_VIRTUAL_PYTHONHOME fi @@ -20,18 +17,18 @@ deactivate () { # This should detect bash and zsh, which have a hash command that must # be called to get it to forget past commands. Without forgetting # past commands the $PATH changes we made may not be respected - if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then - hash -r 2>/dev/null + if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then + hash -r fi - if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then - PS1="$_OLD_VIRTUAL_PS1" + if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then + PS1="${_OLD_VIRTUAL_PS1:-}" export PS1 unset _OLD_VIRTUAL_PS1 fi unset VIRTUAL_ENV - if [ ! "${1-}" = "nondestructive" ] ; then + if [ ! "${1:-}" = "nondestructive" ] ; then # Self destruct! unset -f deactivate fi @@ -48,31 +45,32 @@ PATH="$VIRTUAL_ENV/bin:$PATH" export PATH # unset PYTHONHOME if set -if ! [ -z "${PYTHONHOME+_}" ] ; then - _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME" +# this will fail if PYTHONHOME is set to the empty string (which is bad anyway) +# could use `if (set -u; : $PYTHONHOME) ;` in bash +if [ -n "${PYTHONHOME:-}" ] ; then + _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}" unset PYTHONHOME fi -if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then - _OLD_VIRTUAL_PS1="$PS1" - if [ "x" != x ] ; then - PS1="$PS1" +if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then + _OLD_VIRTUAL_PS1="${PS1:-}" + if [ "x(new) " != x ] ; then + PS1="(new) ${PS1:-}" else - PS1="(`basename \"$VIRTUAL_ENV\"`) $PS1" + if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then + # special case for Aspen magic directories + # see http://www.zetadev.com/software/aspen/ + PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1" + else + PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1" + fi fi export PS1 fi -# Make sure to unalias pydoc if it's already there -alias pydoc 2>/dev/null >/dev/null && unalias pydoc - -pydoc () { - python -m pydoc "$@" -} - # This should detect bash and zsh, which have a hash command that must # be called to get it to forget past commands. Without forgetting # past commands the $PATH changes we made may not be respected -if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then - hash -r 2>/dev/null +if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then + hash -r fi diff --git a/manifest.json b/manifest.json index 2559ce9..2726f24 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.1~ynh1", "url": "http://matrix.org", "license": "Apache-2.0", "maintainer": { 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..2735748 100644 --- a/scripts/install +++ b/scripts/install @@ -92,8 +92,7 @@ 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 #================================================= # CREATE DEDICATED USER @@ -138,26 +137,20 @@ 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:-} cp ../conf/virtualenv_activate $final_path/bin/activate ynh_replace_string __FINAL_PATH__ $final_path $final_path/bin/activate # 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..09b0280 100644 --- a/scripts/restore +++ b/scripts/restore @@ -59,8 +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 -pip install --upgrade virtualenv +ynh_install_app_dependencies $dependances #================================================= # RECREATE THE DEDICATED USER diff --git a/scripts/upgrade b/scripts/upgrade index deede78..183c100 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -74,12 +74,23 @@ 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 + #================================================= # 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,26 +99,20 @@ 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:-} cp ../conf/virtualenv_activate $final_path/bin/activate ynh_replace_string __FINAL_PATH__ $final_path $final_path/bin/activate # 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