diff options
author | Julien Veyssier <eneiluj@posteo.net> | 2020-08-31 15:51:16 +0300 |
---|---|---|
committer | Julien Veyssier <eneiluj@posteo.net> | 2020-09-02 15:59:43 +0300 |
commit | 4061ff0c1f1d771840b9a8cb5dbda172e7c71208 (patch) | |
tree | e6860bbcaf53a783ad8e9b900a35f7f485175cd4 /src | |
parent | 7c5855b505aac0fa1aad8451bcec49685361b63e (diff) |
check if binary has correct owner and permissions
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/AdminSettings/MatterbridgeIntegration.vue | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/components/AdminSettings/MatterbridgeIntegration.vue b/src/components/AdminSettings/MatterbridgeIntegration.vue index bbf1ce34b..f9d16d7bb 100644 --- a/src/components/AdminSettings/MatterbridgeIntegration.vue +++ b/src/components/AdminSettings/MatterbridgeIntegration.vue @@ -49,6 +49,10 @@ <template v-else> <p class="settings-hint" v-html="description" /> + <p v-if="errorText" class="settings-hint"> + {{ errorText }} + </p> + <p> <button v-if="isInstalling"> <span class="icon icon-loading-small" /> @@ -82,6 +86,7 @@ export default { matterbridgeEnabled: loadState('talk', 'matterbridge_enable'), matterbridgeVersion: loadState('talk', 'matterbridge_version'), isInstalling: false, + error: loadState('talk', 'matterbridge_error'), } }, @@ -97,6 +102,15 @@ export default { .replace('{linkstart2}', '<a target="_blank" rel="noreferrer nofollow" class="external" href="https://apps.nextcloud.com/apps/talk_matterbridge">') .replace(/{linkend}/g, ' ↗</a>') }, + errorText() { + if (this.error === 'binary_permissions') { + return t('spreed', 'Matterbridge binary has incorrect permissions. Please make sure the Matterbridge binary file is owned by the correct user and can be executed. It can be found in "/.../nextcloud/apps/talk_matterbridge/bin/".') + } else if (this.error === 'binary') { + return t('spreed', 'Matterbridge binary was not found or couldn\'t be executed.') + } else { + return '' + } + }, }, methods: { @@ -138,12 +152,17 @@ export default { this.matterbridgeVersion = response.data.ocs.data.version this.matterbridgeEnabled = true this.saveMatterbridgeEnabled() - - this.isInstalling = false + this.error = '' } catch (e) { console.error(e) showError(t('spreed', 'Failed to execute Matterbridge binary.')) + if (e.response && e.response.data && e.response.data.ocs && e.response.data.ocs.data && e.response.data.ocs.data.error) { + this.error = e.response.data.ocs.data.error + } else { + this.error = 'binary' + } } + this.isInstalling = false }, }, } |