From 82328112765bef41d5fe0579866af14911d83fbe Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Sun, 16 Dec 2018 18:03:00 +0100 Subject: [PATCH] new: [mattermost] charm handles itself the websocket when in relation with apache --- mattermost/metadata.yml | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/mattermost/metadata.yml b/mattermost/metadata.yml index b90367f..592f955 100644 --- a/mattermost/metadata.yml +++ b/mattermost/metadata.yml @@ -1,5 +1,5 @@ -# description: "Mattermost" -# maintainer: "Valentin Lab " +description: "Mattermost" +maintainer: "Valentin Lab " ## We fix image here to be sure of what we install docker-image: docker.0k.io/mattermost-team # docker-image: docker.0k.io/mattermost-enterprise @@ -13,4 +13,32 @@ host-resources: - /etc/localtime:ro docker-compose: - restart: unless-stopped \ No newline at end of file + restart: unless-stopped + +uses: + postgres-database: + constraint: required + auto: pair + solves: + database: "main storage" + log-rotate: + constraint: recommended + auto: pair + solves: + disk-leak: "/mattermost/logs" + web-proxy: + constraint: recommended + auto: pair + solves: + proxy: "Public access" + default-options: + apache-custom-rules: + - !var-expand | + ProxyPreserveHost On + + # Set web sockets + RewriteEngine On + RewriteCond %{REQUEST_URI} /api/v[0-9]+/(users/)?websocket [NC,OR] + RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC,OR] + RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC] + RewriteRule .* ws://${MASTER_BASE_SERVICE_NAME}:8000%{REQUEST_URI} [P,QSA,L]