diff --git a/README.md b/README.md index abc439f..1e0951b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ A puppeting bridge between Matrix and Discord packaged as a YunoHost service. Me **Attention: always backup and restore the Yunohost matrix_synapse et mautrix_discord apps together!** -**Shipped version:** 0.6.5~ynh2 +**Shipped version:** 0.6.5~ynh3 ## Documentation and resources - Official admin documentation: diff --git a/README_es.md b/README_es.md index 615648f..e19c186 100644 --- a/README_es.md +++ b/README_es.md @@ -21,7 +21,7 @@ A puppeting bridge between Matrix and Discord packaged as a YunoHost service. Me **Attention: always backup and restore the Yunohost matrix_synapse et mautrix_discord apps together!** -**Versión actual:** 0.6.5~ynh2 +**Versión actual:** 0.6.5~ynh3 ## Documentaciones y recursos - Documentación administrador oficial: diff --git a/README_eu.md b/README_eu.md index 500e26d..acc86ed 100644 --- a/README_eu.md +++ b/README_eu.md @@ -21,7 +21,7 @@ A puppeting bridge between Matrix and Discord packaged as a YunoHost service. Me **Attention: always backup and restore the Yunohost matrix_synapse et mautrix_discord apps together!** -**Paketatutako bertsioa:** 0.6.5~ynh2 +**Paketatutako bertsioa:** 0.6.5~ynh3 ## Dokumentazioa eta baliabideak - Administratzaileen dokumentazio ofiziala: diff --git a/README_fr.md b/README_fr.md index ba976ef..a2d7c74 100644 --- a/README_fr.md +++ b/README_fr.md @@ -20,7 +20,7 @@ Un pont entre Matrix et Discord présenté comme un service YunoHost. Les messag **Attention : toujours sauvegarder et restaurer les applications matrix_synapse et mautrix_discord de Yunohost ensemble ! -**Version incluse :** 0.6.5~ynh2 +**Version incluse :** 0.6.5~ynh3 ## Documentations et ressources - Documentation officielle de l’admin : diff --git a/README_gl.md b/README_gl.md index 94ece76..4bec332 100644 --- a/README_gl.md +++ b/README_gl.md @@ -21,7 +21,7 @@ A puppeting bridge between Matrix and Discord packaged as a YunoHost service. Me **Attention: always backup and restore the Yunohost matrix_synapse et mautrix_discord apps together!** -**Versión proporcionada:** 0.6.5~ynh2 +**Versión proporcionada:** 0.6.5~ynh3 ## Documentación e recursos - Documentación oficial para admin: diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 2eac993..a693108 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -21,7 +21,7 @@ A puppeting bridge between Matrix and Discord packaged as a YunoHost service. Me **Attention: always backup and restore the Yunohost matrix_synapse et mautrix_discord apps together!** -**分发版本:** 0.6.5~ynh2 +**分发版本:** 0.6.5~ynh3 ## 文档与资源 - 官方管理文档: diff --git a/manifest.toml b/manifest.toml index 18ca30d..4150834 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Matrix-Discord bridge" description.en = "Matrix / Synapse puppeting bridge for Discord" description.fr = "Passerelle Matrix / Synapse pour Discord" -version = "0.6.5~ynh2" +version = "0.6.5~ynh3" maintainers = ["fflorent"] diff --git a/scripts/_common.sh b/scripts/_common.sh index 8a31c04..674ce8d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -2,6 +2,16 @@ APP_BIN=mautrix-discord +#================================================= +# PERSONAL HELPERS +#================================================= + +get_synapse_db_name() { + # Parameters: synapse instance identifier + # Returns: database name + ynh_app_setting_get --app="$1" --key=db_name +} + apply_permissions() { set -o noglob # Disable globbing to avoid expansions when passing * as value. declare values="list$role" diff --git a/scripts/install b/scripts/install index 35c6880..b7710a5 100755 --- a/scripts/install +++ b/scripts/install @@ -14,7 +14,7 @@ server_name=$(ynh_app_setting_get --app $synapse_instance --key server_name) domain=$(ynh_app_setting_get --app $synapse_instance --key domain) ynh_app_setting_set --app=$app --key=server_name --value=$server_name ynh_app_setting_set --app=$app --key=domain --value=$domain -synapse_db_name="matrix_$synapse_instance" +synapse_db_name="$(get_synapse_db_name $synapse_instance)" synapse_version=$(yunohost app info $synapse_instance | grep -oP "version:\s*\K.*") diff --git a/scripts/restore b/scripts/restore index 1742f10..a22c121 100755 --- a/scripts/restore +++ b/scripts/restore @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers server_name=$(ynh_app_setting_get --app=$app --key=server_name) -synapse_db_name="matrix_$synapse_instance" +synapse_db_name="$(get_synapse_db_name $synapse_instance)" bot_synapse_db_user="@$botname:$server_name" async_media=$(ynh_app_setting_get --app=$app --key=async_media) diff --git a/scripts/upgrade b/scripts/upgrade index 038403f..cf77d39 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -11,7 +11,7 @@ source /usr/share/yunohost/helpers server_name=$(ynh_app_setting_get --app=$app --key=server_name) -synapse_db_name="matrix_$synapse_instance" +synapse_db_name="$(get_synapse_db_name $synapse_instance)" bot_synapse_db_user="@$botname:$server_name" appserviceid=$app