mirror of
https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh.git
synced 2024-09-03 19:46:01 +02:00
Merge pull request #65 from YunoHost-Apps/prevent-collision-botname
Prevent collision botname
This commit is contained in:
commit
845d0f9a57
8 changed files with 17 additions and 4 deletions
|
@ -24,7 +24,7 @@ Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh)
|
||||||
** Attention: always backup and restore the Yunohost matrix_synapse et mautrix_whatsapp apps together!**
|
** Attention: always backup and restore the Yunohost matrix_synapse et mautrix_whatsapp apps together!**
|
||||||
|
|
||||||
|
|
||||||
**Shipped version:** 0.7.0~ynh1
|
**Shipped version:** 0.7.0~ynh2
|
||||||
|
|
||||||
## Disclaimers / important information
|
## Disclaimers / important information
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ C'est pourquoi [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_y
|
||||||
** Attention : sauvegardez et restaurez toujours les deux applications Yunohost matrix_synapse et mautrix_whatsapp en même temps!**
|
** Attention : sauvegardez et restaurez toujours les deux applications Yunohost matrix_synapse et mautrix_whatsapp en même temps!**
|
||||||
|
|
||||||
|
|
||||||
**Version incluse :** 0.7.0~ynh1
|
**Version incluse :** 0.7.0~ynh2
|
||||||
|
|
||||||
## Avertissements / informations importantes
|
## Avertissements / informations importantes
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ appservice:
|
||||||
|
|
||||||
# The unique ID of this appservice.
|
# The unique ID of this appservice.
|
||||||
#id: whatsapp
|
#id: whatsapp
|
||||||
id: __BOTNAME__
|
id: __APPSERVICEID__
|
||||||
# Appservice bot details.
|
# Appservice bot details.
|
||||||
bot:
|
bot:
|
||||||
# Username of the appservice bot.
|
# Username of the appservice bot.
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"en": "Matrix / Synapse puppeting bridge for WhatsApp",
|
"en": "Matrix / Synapse puppeting bridge for WhatsApp",
|
||||||
"fr": "Passerelle Matrix / Synapse pour WhatsApp"
|
"fr": "Passerelle Matrix / Synapse pour WhatsApp"
|
||||||
},
|
},
|
||||||
"version": "0.7.0~ynh1",
|
"version": "0.7.0~ynh2",
|
||||||
"url": "https://github.com/mautrix/whatsapp",
|
"url": "https://github.com/mautrix/whatsapp",
|
||||||
"upstream": {
|
"upstream": {
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
|
|
|
@ -23,6 +23,7 @@ ynh_abort_if_errors
|
||||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
appserviceid=$YNH_APP_INSTANCE_NAME
|
||||||
synapsenumber=$YNH_APP_ARG_SYNAPSENUMBER
|
synapsenumber=$YNH_APP_ARG_SYNAPSENUMBER
|
||||||
botname=$YNH_APP_ARG_BOTNAME
|
botname=$YNH_APP_ARG_BOTNAME
|
||||||
bot_synapse_adm=$YNH_APP_ARG_BOT_SYNAPSE_ADM
|
bot_synapse_adm=$YNH_APP_ARG_BOT_SYNAPSE_ADM
|
||||||
|
@ -61,6 +62,7 @@ test ! -e "$final_path" || ynh_die --message="This path already contains a folde
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Storing installation settings..." --weight=7
|
ynh_script_progression --message="Storing installation settings..." --weight=7
|
||||||
|
|
||||||
|
ynh_app_setting_set --app=$app --key=appserviceid --value=$appserviceid
|
||||||
ynh_app_setting_set --app=$app --key=botname --value=$botname
|
ynh_app_setting_set --app=$app --key=botname --value=$botname
|
||||||
ynh_app_setting_set --app=$app --key=bot_synapse_adm --value=$bot_synapse_adm
|
ynh_app_setting_set --app=$app --key=bot_synapse_adm --value=$bot_synapse_adm
|
||||||
ynh_app_setting_set --app=$app --key=encryption --value=$encryption
|
ynh_app_setting_set --app=$app --key=encryption --value=$encryption
|
||||||
|
|
|
@ -16,6 +16,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=5
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
appserviceid=$(ynh_app_setting_get --app=$app --key=appserviceid)
|
||||||
botname=$(ynh_app_setting_get --app=$app --key=botname)
|
botname=$(ynh_app_setting_get --app=$app --key=botname)
|
||||||
synapse_instance=$(ynh_app_setting_get --app=$app --key=synapse_instance)
|
synapse_instance=$(ynh_app_setting_get --app=$app --key=synapse_instance)
|
||||||
server_name=$(ynh_app_setting_get --app=$app --key=server_name)
|
server_name=$(ynh_app_setting_get --app=$app --key=server_name)
|
||||||
|
|
|
@ -32,6 +32,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_user=$db_name
|
db_user=$db_name
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
server_name=$(ynh_app_setting_get --app=$app --key=server_name)
|
server_name=$(ynh_app_setting_get --app=$app --key=server_name)
|
||||||
|
appserviceid=$(ynh_app_setting_get --app=$app --key=appserviceid)
|
||||||
botname=$(ynh_app_setting_get --app=$app --key=botname)
|
botname=$(ynh_app_setting_get --app=$app --key=botname)
|
||||||
synapse_instance=$(ynh_app_setting_get --app=$app --key=synapse_instance)
|
synapse_instance=$(ynh_app_setting_get --app=$app --key=synapse_instance)
|
||||||
bot_synapse_adm=$(ynh_app_setting_get --app=$app --key=bot_synapse_adm)
|
bot_synapse_adm=$(ynh_app_setting_get --app=$app --key=bot_synapse_adm)
|
||||||
|
|
|
@ -16,6 +16,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=5
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
appserviceid=$(ynh_app_setting_get --app=$app --key=appserviceid)
|
||||||
botname=$(ynh_app_setting_get --app=$app --key=botname)
|
botname=$(ynh_app_setting_get --app=$app --key=botname)
|
||||||
encryption=$(ynh_app_setting_get --app=$app --key=encryption)
|
encryption=$(ynh_app_setting_get --app=$app --key=encryption)
|
||||||
botadmin=$(ynh_app_setting_get --app=$app --key=botadmin)
|
botadmin=$(ynh_app_setting_get --app=$app --key=botadmin)
|
||||||
|
@ -97,6 +98,14 @@ then
|
||||||
ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd
|
ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If appserviceid doesn't exist, create it
|
||||||
|
if [ -z "$appserviceid" ]
|
||||||
|
then
|
||||||
|
appserviceid=$app
|
||||||
|
ynh_app_setting_set --app=$app --key=appserviceid --value=$appserviceid
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# If db_name doesn't exist, create it
|
# If db_name doesn't exist, create it
|
||||||
#if [ -z "$mautrix_whatsapp_db_name" ]; then
|
#if [ -z "$mautrix_whatsapp_db_name" ]; then
|
||||||
# mautrix_whatsapp_db_name=$(ynh_sanitize_dbid --db_name=$app)
|
# mautrix_whatsapp_db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||||
|
|
Loading…
Add table
Reference in a new issue