summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-11-16 11:38:25 -0500
committerChristopher Speller <crspeller@gmail.com>2015-11-16 11:38:25 -0500
commit48d2f86b90b3e0b02cb28f3e8b6e4d454f9cb869 (patch)
tree7ba35bc8353d5398934bb73692ec40ee47a81404
parentd03b3830976c96aab59cb78177cfd0e82cc05b8d (diff)
parent49a459d696fc8fee0b508990fca571fb8d2f2654 (diff)
downloadchat-48d2f86b90b3e0b02cb28f3e8b6e4d454f9cb869.tar.gz
chat-48d2f86b90b3e0b02cb28f3e8b6e4d454f9cb869.tar.bz2
chat-48d2f86b90b3e0b02cb28f3e8b6e4d454f9cb869.zip
Merge release branch 'release-1.2'
-rw-r--r--CHANGELOG.md2
-rw-r--r--api/post.go8
-rw-r--r--config/config.json4
-rw-r--r--doc/integrations/webhooks/Outgoing-Webhooks.md4
-rw-r--r--docker/1.2/Dockerfile2
-rw-r--r--docker/1.2/config_docker.json4
-rw-r--r--docker/dev/config_docker.json4
-rw-r--r--docker/local/config_docker.json4
-rw-r--r--model/version.go1
-rw-r--r--web/web.go2
10 files changed, 21 insertions, 14 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 74c5b5208..3e423557d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -98,7 +98,7 @@ Multiple settings were added to [`config.json`](./config/config.json). These opt
- Added: `"RestrictTeamNames": true` to control whether team names can contain reserved words like www, admin, support, test, etc.
- Added: `"EnableTeamListing": false` to control whether teams can be listed on the root page of the site
- Under `ServiceSettings` in `config.json`
- - Added: `EnableOutgoingWebhooks": true` to turn on outgoing webhooks
+ - Added: `EnableOutgoingWebhooks": false` to control whether outgoing webhooks are enabled
#### Database Changes from v1.1 to v1.2
diff --git a/api/post.go b/api/post.go
index 3892d4ee8..ef70e1336 100644
--- a/api/post.go
+++ b/api/post.go
@@ -229,6 +229,14 @@ func handlePostEventsAndForget(c *Context, post *model.Post, triggerWebhooks boo
func handleWebhookEventsAndForget(c *Context, post *model.Post, team *model.Team, channel *model.Channel, user *model.User) {
go func() {
+ if !utils.Cfg.ServiceSettings.EnableOutgoingWebhooks {
+ return
+ }
+
+ if channel.Type != model.CHANNEL_OPEN {
+ return
+ }
+
hchan := Srv.Store.Webhook().GetOutgoingByTeam(c.Session.TeamId)
hooks := []*model.OutgoingWebhook{}
diff --git a/config/config.json b/config/config.json
index a927620b5..932bed8a2 100644
--- a/config/config.json
+++ b/config/config.json
@@ -5,8 +5,8 @@
"SegmentDeveloperKey": "",
"GoogleDeveloperKey": "",
"EnableOAuthServiceProvider": false,
- "EnableIncomingWebhooks": true,
- "EnableOutgoingWebhooks": true,
+ "EnableIncomingWebhooks": false,
+ "EnableOutgoingWebhooks": false,
"EnablePostUsernameOverride": false,
"EnablePostIconOverride": false,
"EnableTesting": false,
diff --git a/doc/integrations/webhooks/Outgoing-Webhooks.md b/doc/integrations/webhooks/Outgoing-Webhooks.md
index 008245715..5fbbb9d87 100644
--- a/doc/integrations/webhooks/Outgoing-Webhooks.md
+++ b/doc/integrations/webhooks/Outgoing-Webhooks.md
@@ -1,7 +1,5 @@
# Outgoing Webhooks
-#### [To be released in Mattermost v1.2, available now on master]
-
Outgoing webhooks allow external applications, written in the programming language of your choice--to receive HTTP POST requests whenever a user posts to a certain channel, with a trigger word at the beginning of the message, or a combination of both. If the external application responds appropriately to the HTTP request, as response post can be made in the channel where the original post occurred.
A couple key points:
@@ -36,7 +34,7 @@ Which would render in a Mattermost message as follows:
---
### Enabling Outgoing Webhooks
-Outgoing webhooks should be enabled on your Mattermost instance by default, but if they are not you'll need to get your system administrator to enable them. If you are the system administrator you can enable them by doing the following:
+Outgoing webhooks are off by default, and can be enabled by the system administrator. If you are the system administrator you can enable them by doing the following:
1. Login to your Mattermost team account that has the system administrator role.
1. Enable outgoing webhooks from **System Console -> Service Settings**.
diff --git a/docker/1.2/Dockerfile b/docker/1.2/Dockerfile
index cb2b58f53..e00c4e5ca 100644
--- a/docker/1.2/Dockerfile
+++ b/docker/1.2/Dockerfile
@@ -34,7 +34,7 @@ VOLUME /var/lib/mysql
WORKDIR /mattermost
# Copy over files
-ADD https://github.com/mattermost/platform/releases/download/v1.2.0/mattermost.tar.gz /
+ADD https://github.com/mattermost/platform/releases/download/v1.2.1/mattermost.tar.gz /
RUN tar -zxvf /mattermost.tar.gz --strip-components=1 && rm /mattermost.tar.gz
ADD config_docker.json /
ADD docker-entry.sh /
diff --git a/docker/1.2/config_docker.json b/docker/1.2/config_docker.json
index 80e6ab14e..c23a72cd1 100644
--- a/docker/1.2/config_docker.json
+++ b/docker/1.2/config_docker.json
@@ -5,8 +5,8 @@
"SegmentDeveloperKey": "",
"GoogleDeveloperKey": "",
"EnableOAuthServiceProvider": false,
- "EnableIncomingWebhooks": true,
- "EnableOutgoingWebhooks": true,
+ "EnableIncomingWebhooks": false,
+ "EnableOutgoingWebhooks": false,
"EnablePostUsernameOverride": false,
"EnablePostIconOverride": false,
"EnableTesting": false,
diff --git a/docker/dev/config_docker.json b/docker/dev/config_docker.json
index 80e6ab14e..c23a72cd1 100644
--- a/docker/dev/config_docker.json
+++ b/docker/dev/config_docker.json
@@ -5,8 +5,8 @@
"SegmentDeveloperKey": "",
"GoogleDeveloperKey": "",
"EnableOAuthServiceProvider": false,
- "EnableIncomingWebhooks": true,
- "EnableOutgoingWebhooks": true,
+ "EnableIncomingWebhooks": false,
+ "EnableOutgoingWebhooks": false,
"EnablePostUsernameOverride": false,
"EnablePostIconOverride": false,
"EnableTesting": false,
diff --git a/docker/local/config_docker.json b/docker/local/config_docker.json
index 80e6ab14e..c23a72cd1 100644
--- a/docker/local/config_docker.json
+++ b/docker/local/config_docker.json
@@ -5,8 +5,8 @@
"SegmentDeveloperKey": "",
"GoogleDeveloperKey": "",
"EnableOAuthServiceProvider": false,
- "EnableIncomingWebhooks": true,
- "EnableOutgoingWebhooks": true,
+ "EnableIncomingWebhooks": false,
+ "EnableOutgoingWebhooks": false,
"EnablePostUsernameOverride": false,
"EnablePostIconOverride": false,
"EnableTesting": false,
diff --git a/model/version.go b/model/version.go
index 6eae436bc..af99717cd 100644
--- a/model/version.go
+++ b/model/version.go
@@ -12,6 +12,7 @@ import (
// It should be maitained in chronological order with most current
// release at the front of the list.
var versions = []string{
+ "1.2.1",
"1.2.0",
"1.1.0",
"1.0.0",
diff --git a/web/web.go b/web/web.go
index ffc791cb7..02ceb69ba 100644
--- a/web/web.go
+++ b/web/web.go
@@ -989,7 +989,7 @@ func incomingWebhook(c *api.Context, w http.ResponseWriter, r *http.Request) {
}
text := parsedRequest.Text
- if len(text) == 0 {
+ if len(text) == 0 && parsedRequest.Attachments == nil {
c.Err = model.NewAppError("incomingWebhook", "No text specified", "")
return
}