mirror of
https://github.com/YunoHost-Apps/mautrix_telegram_ynh.git
synced 2024-09-03 19:45:55 +02:00
Merge pull request #43 from YunoHost-Apps/fix-upgrade-script-refactor
Fix upgrade script after refactor
This commit is contained in:
commit
f00b873ca8
5 changed files with 28 additions and 13 deletions
|
@ -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.
|
||||
|
||||
|
||||
**Shipped version:** 0.12.2~ynh3
|
||||
**Shipped version:** 0.12.2~ynh4
|
||||
## Disclaimers / important information
|
||||
|
||||
## List of known public services
|
||||
|
|
|
@ -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!**
|
||||
|
||||
|
||||
**Version incluse :** 0.12.2~ynh3
|
||||
**Version incluse :** 0.12.2~ynh4
|
||||
## Avertissements / informations importantes
|
||||
|
||||
## Liste de passerelles publiques
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Telegram puppeting bridge for 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",
|
||||
"upstream": {
|
||||
"license": "AGPL-3.0-or-later",
|
||||
|
|
|
@ -160,11 +160,7 @@ mkdir -p /var/log/$app
|
|||
python3 -m venv $final_path
|
||||
export HOME=$final_path
|
||||
$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
|
||||
|
||||
if [ $encryption -eq 1 ]; then
|
||||
$final_path/bin/pip3 install --upgrade $final_path/src/mautrix-telegram.tar.gz[e2be]
|
||||
fi
|
||||
$final_path/bin/pip3 install --upgrade $final_path/src/mautrix-telegram.tar.gz[e2be,speedups,qr_login] # metrics,hq_thumbnails,sqlite,formattednumbers
|
||||
|
||||
#=================================================
|
||||
# REGISTER SYNAPSE APP-SERVICE
|
||||
|
|
|
@ -76,6 +76,29 @@ then
|
|||
ynh_app_setting_set --app=$app --key=appserviceid --value=$appserviceid
|
||||
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
|
||||
#=================================================
|
||||
|
@ -140,11 +163,7 @@ ynh_script_progression --message="Upgrading Mautrix-Bridge Python Module..." --w
|
|||
python3 -m venv $final_path
|
||||
export HOME=$final_path
|
||||
$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
|
||||
|
||||
if [ $encryption -eq 1 ]; then
|
||||
$final_path/bin/pip3 install --upgrade $final_path/src/mautrix-telegram.tar.gz[e2be]
|
||||
fi
|
||||
$final_path/bin/pip3 install --upgrade $final_path/src/mautrix-telegram.tar.gz[e2be,speedups,qr_login] # metrics,hq_thumbnails,sqlite,formattednumbers
|
||||
|
||||
#=================================================
|
||||
# REGISTER SYNAPSE APP-SERVICE
|
||||
|
|
Loading…
Reference in a new issue