Merge pull request #43 from YunoHost-Apps/fix-upgrade-script-refactor

Fix upgrade script after refactor
This commit is contained in:
Dante 2022-12-07 11:32:09 +00:00 committed by GitHub
commit f00b873ca8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 13 deletions

View file

@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
A puppeting bridge between Matrix and Telegram packaged as a YunoHost service. Messages, notifications (and sometimes media) are bridged between a Telegram user and a Matrix user. Currently the Matrix user can NOT invite other Matrix user in a bridged Telegram room, so only someone with a Telegram account can participate to Telegram group conversations. The ["Mautrix-Telegram"](https://docs.mau.fi/bridges/python/telegram/index.html) bridge is a Synapse App Service and relies on postgresql. Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) should be installed beforehand. A puppeting bridge between Matrix and Telegram packaged as a YunoHost service. Messages, notifications (and sometimes media) are bridged between a Telegram user and a Matrix user. Currently the Matrix user can NOT invite other Matrix user in a bridged Telegram room, so only someone with a Telegram account can participate to Telegram group conversations. The ["Mautrix-Telegram"](https://docs.mau.fi/bridges/python/telegram/index.html) bridge is a Synapse App Service and relies on postgresql. Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) should be installed beforehand.
**Shipped version:** 0.12.2~ynh3 **Shipped version:** 0.12.2~ynh4
## Disclaimers / important information ## Disclaimers / important information
## List of known public services ## List of known public services

View file

@ -21,7 +21,7 @@ La passerelle ["Mautrix-Telegram"](https://docs.mau.fi/bridges/python/telegram/i
** Attention : sauvegardez et restaurez toujours les deux applications Yunohost matrix-synapse et mautrix_telegram en même temps!** ** Attention : sauvegardez et restaurez toujours les deux applications Yunohost matrix-synapse et mautrix_telegram en même temps!**
**Version incluse :** 0.12.2~ynh3 **Version incluse :** 0.12.2~ynh4
## Avertissements / informations importantes ## Avertissements / informations importantes
## Liste de passerelles publiques ## Liste de passerelles publiques

View file

@ -6,7 +6,7 @@
"en": "Telegram puppeting bridge for Matrix/Synapse", "en": "Telegram puppeting bridge for Matrix/Synapse",
"fr": "Passerelle Telegram pour Matrix/Synapse" "fr": "Passerelle Telegram pour Matrix/Synapse"
}, },
"version": "0.12.2~ynh3", "version": "0.12.2~ynh4",
"url": "https://docs.mau.fi/bridges/python/telegram/index.html", "url": "https://docs.mau.fi/bridges/python/telegram/index.html",
"upstream": { "upstream": {
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",

View file

@ -160,11 +160,7 @@ mkdir -p /var/log/$app
python3 -m venv $final_path python3 -m venv $final_path
export HOME=$final_path export HOME=$final_path
$final_path/bin/pip3 install --upgrade pip setuptools wheel $final_path/bin/pip3 install --upgrade pip setuptools wheel
$final_path/bin/pip3 install --upgrade $final_path/src/mautrix-telegram.tar.gz[speedups,qr_login] # metrics,e2be,hq_thumbnails,sqlite,formattednumbers $final_path/bin/pip3 install --upgrade $final_path/src/mautrix-telegram.tar.gz[e2be,speedups,qr_login] # metrics,hq_thumbnails,sqlite,formattednumbers
if [ $encryption -eq 1 ]; then
$final_path/bin/pip3 install --upgrade $final_path/src/mautrix-telegram.tar.gz[e2be]
fi
#================================================= #=================================================
# REGISTER SYNAPSE APP-SERVICE # REGISTER SYNAPSE APP-SERVICE

View file

@ -76,6 +76,29 @@ then
ynh_app_setting_set --app=$app --key=appserviceid --value=$appserviceid ynh_app_setting_set --app=$app --key=appserviceid --value=$appserviceid
fi fi
# If db_name doesn't exist, create it
if [ -z "$db_name" ]
then
db_name=$(ynh_app_setting_get --app=$app --key=mautrix_bridge_db_name)
# db_name and db_user share the same value
db_user=$db_name
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
fi
# If db_pwd doesn't exist, create it
if [ -z "$db_pwd" ]
then
db_pwd=$(ynh_app_setting_get --app=$app --key=mautrix_bridge_db_pwd)
ynh_app_setting_set --app=$app --key=psqlpwd --value=$db_pwd
fi
# If synapse_registration_path doesn't exist, create it
if [ -z "$synapse_registration_path" ]
then
synapse_registration_path=$(ynh_app_setting_get --app=$app --key=app_service_registration_path)
ynh_app_setting_set --app=$app --key=synapse_registration_path --value=$synapse_registration_path
fi
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
@ -140,11 +163,7 @@ ynh_script_progression --message="Upgrading Mautrix-Bridge Python Module..." --w
python3 -m venv $final_path python3 -m venv $final_path
export HOME=$final_path export HOME=$final_path
$final_path/bin/pip3 install --upgrade pip setuptools wheel $final_path/bin/pip3 install --upgrade pip setuptools wheel
$final_path/bin/pip3 install --upgrade $final_path/src/mautrix-telegram.tar.gz[speedups,qr_login] # metrics,e2be,hq_thumbnails,sqlite,formattednumbers $final_path/bin/pip3 install --upgrade $final_path/src/mautrix-telegram.tar.gz[e2be,speedups,qr_login] # metrics,hq_thumbnails,sqlite,formattednumbers
if [ $encryption -eq 1 ]; then
$final_path/bin/pip3 install --upgrade $final_path/src/mautrix-telegram.tar.gz[e2be]
fi
#================================================= #=================================================
# REGISTER SYNAPSE APP-SERVICE # REGISTER SYNAPSE APP-SERVICE