diff --git a/README.md b/README.md index 639ba8a..f53a080 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/README_fr.md b/README_fr.md index c6388a0..1c2e568 100644 --- a/README_fr.md +++ b/README_fr.md @@ -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 diff --git a/manifest.json b/manifest.json index 25c6a76..f7c5137 100644 --- a/manifest.json +++ b/manifest.json @@ -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", diff --git a/scripts/install b/scripts/install index 415c55f..68abed4 100755 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index df3fee4..09995cc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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