Граф коммитов

11575 Коммитов

Автор SHA1 Сообщение Дата
Jesse Hallam
beef13ae46 MM-18721: disable SIGPIPE handling (#12394)
We recently added support for handling SIGPIPE cleanly, in order to safely shutdown plugins in the event that the STDOUT/STDERR had been closed unexpectedly. Unfortunately, this signal is also emitted when writing to a closed socket connection: an event that occurs frequently for a webserver. Normally, if no signal handler is registered for same, the Go subsystem distinguishes the file descriptor and ignores those from the network. But once a handler is registered, all SIGPIPEs are passed through: and sadly there is no way to distinguish the original file descriptor.

We don't strictly need the SIGPIPE handling for development any longer since `make stop-server` no longer shuts down the logrus process which explained the majority of hanging plugin processes. It remains suboptimal that a signal can terminate the server and leave plugin processes hanging, but the current symptoms are worse.
2019-09-30 15:44:56 -03:00
Jesse Hallam
841099194d MM-18636: fix wrong merge conflict (#12386)
I resolved a merge conflict incorrectly when submitting MM-18636, and
want to remove the unused code I left behind.
2019-09-30 14:23:00 -03:00
Nikhil Ranjan
e5ba0a0a18 Converting to structured logging the file app/oauth.go (#12135) 2019-09-29 12:42:53 +02:00
Scott Bishel
cee19b0332 MM-18013 Allow configuration of SAML crypto hashing algorithms (#12362)
* MM-18013 Add SAML Algorithms to config.

* set defaults to current values, add validation for settings

* update to use simplier config entry
2019-09-27 12:13:31 -06:00
Claudio Costa
de8e798052 [MM-18638] Send mlog console output to stderr (#12366)
* Send server logs to stderr

* Update comment
2019-09-27 17:40:16 +02:00
Jesse Hallam
340287890a MM-18636: limit configuration writes to 4Mb (#12266)
* MM-18636: limit configuration writes to 4Mb

By default, MySQL silently truncates writes that exceed the column type in question. Change the column type from `TEXT` to `MEDIUMTEXT` to allow writes to the `Configurations` and `ConfigurationFiles` table to exceed 65535 bytes.  This is a backwards compatible migration, but does require a rewrite of the table.

However, MySQL is further constrained by the default `max_allowed_packet` value of 4Mb, so limit writes accordingly.

Fixes: https://mattermost.atlassian.net/browse/MM-18636

* simplify unit tests

* fix import
2019-09-27 09:10:38 -03:00
Jesse Hallam
975055a7e7 MM-18894: Update production marketplace URL (#12378) 2019-09-26 23:59:44 -03:00
Jesse Hallam
74533371b2 MM-18115: fix segment v3 usage (#12317)
* diagnostics_test.go: fix spacing

* diagnostics_test.go: explicitly assert payload

This fails, since the package is currently receiving struct pointers and won't set the MessageId or Timestamp on the corresponding Message.

* MM-18115: fix segment v3 usage

In v5.14, we updated [github.com/segmentio/analytics-go](https://github.com/segmentio/analytics-go) to v3 as part of https://mattermost.atlassian.net/browse/MM-12389. As noted in the [migration guide](https://segment.com/docs/sources/server/go/#migrating-from-v2), the API subtly changed to expect a struct value and not a struct pointer:

```go
// in v2, you would call the `Track` method with a `Track` struct.
client.Track(&track)

// in v3, you would call the `Enqueue` method with a `Track` struct.
// Note that a pointer is not used here.
client.Enqueue(track)
```

Unfortunately, we kept passing a pointer, and the package didn't complain since it only required an interface -- which the pointer to these structs still implemented. Internally, it only checked for the value types, and failed to annotate our payloads with the requisite metadata. Upstream, segment.io accepted the payload, but then discarded it silently.

This has since been reported and fixed in https://github.com/segmentio/analytics-go/pull/146, but isn't yet part of a tagged release of the package.

Fix our code to pass struct values instead.

Fixes: MM-18115
2019-09-26 23:49:43 -03:00
Jesse Hallam
993947c70a MM-18741: clarify error message (#12357)
Clarify the error message that is emitted by the server when failing to parse the configuration.

Fixes: MM-18741
2019-09-26 23:47:13 -03:00
Martin Kraft
d82584a783 MM-18668: Fix for scan error selecting null SchemeGuest columns. (#12370) 2019-09-26 14:11:55 -04:00
Michael Kochell
1a4d7869cb [MM-18628] Fix flaky OpenGraph test (#12365)
* use local httptest server instead of github.com

* use switch statements
2019-09-26 13:54:51 -04:00
Pavel Biryukov
af3ffeed1a Fix wrong error check (#12310) 2019-09-26 13:26:48 +02:00
Micah Thompson
effb6d8003 MM-18253 Refactor "manualtesting/manual_testing.go" to use str… (#12363) 2019-09-26 07:19:52 +02:00
Ben Schumacher
9a363f559e [MM-18625] Make config.DatabaseStore.String() more robust (#12309) 2019-09-26 07:17:39 +02:00
Ben Schumacher
b8f0546c19 [MM-18193] Use vendor folder when compiling test plugins (#12188) 2019-09-24 23:02:59 +02:00
Christopher Speller
7966397f1f Defaulting to using go modules vendored (#12040) 2019-09-24 22:01:53 +02:00
Jesús Espino
99f13ed0e6 Use seconds instead of nanoseconds for the store time layer metrics (#12321)
* Use nanoseconds instead of seconds for the api metrics

* Using seconds instead of nanoseconds in the store layer metrics
2019-09-24 20:00:19 +02:00
Maria A Nunez
f257109953 Revert "MM-16809: Added EnsureChannel Helper (#11852)" (#12314)
This reverts commit 5aa24aedc8.
2019-09-24 13:48:33 -04:00
Carlos Tadeu Panato Junior
c3ffac4f6b bump mattermost/mattermost-build-server to use go 1.12.9 (#12239)
* bump mattermost/mattermost-build-server to use go 1.12.9
2019-09-24 19:29:57 +02:00
Ogundele Olumide
1f9d14e24c chore: refactor to use structured logging (#12256) 2019-09-24 18:30:23 +02:00
Marc Argent
d0a138a35e GH-12049 use structured logging (#12258) 2019-09-24 18:30:13 +02:00
Nikhil Ranjan
7ba491ac2d Converting to structured logging the file app/notification_pus… (#12126) 2019-09-24 17:10:47 +02:00
Nikhil Ranjan
7464449478 Convert app/config_test.go t.Fatal calls into assert/require c… (#12220) 2019-09-24 16:49:23 +02:00
Nikhil Ranjan
d130131a88 Convert app/web_hub_test.go t.Fatal calls into assert/require… (#12222) 2019-09-24 16:44:01 +02:00
Ben Schumacher
4faf8a96b9 Bump app version to 5.18 (#12259) 2019-09-24 16:37:49 +02:00
Ogundele Olumide
be340bb7c7 MM-18317 Migrate tests from import_validators_test.go to use t… (#12129) 2019-09-24 15:37:47 +02:00
Nikhil Ranjan
49a900554f MM-18256 Converting to structured logging the file utils/licen… (#12094) 2019-09-24 15:37:21 +02:00
Nikhil Ranjan
230a518059 MM-18288 Converting to structured logging the file app/web_hub… (#12133) 2019-09-24 15:35:20 +02:00
Phillip Ahereza
14bf82ad03 [MM-18320] Migrate tests from "app/email_batching_test.go" to… (#12079) 2019-09-24 15:33:58 +02:00
Micah Thompson
fa6b98df3c Migrate tests from 'app/oauth_test.go' to use testify (#12155) 2019-09-24 15:32:13 +02:00
Nikhil Ranjan
69eb2faf3d Convert app/login_test.go t.Fatal calls into assert/require ca… (#12221) 2019-09-24 15:25:24 +02:00
sowmiyamuthuraman
3802c1e4d3 Replace t.fatal() to testify require/assert calls (#12174) 2019-09-24 15:23:30 +02:00
Darrell Richards
a3c5cd5760 GH-12100 Mirgrated tests in app/channel_test.go (#12217) 2019-09-24 15:22:09 +02:00
Renil Joseph
945a099c06 MM-18383: updated tests using fatal to use assert (#12175) 2019-09-24 15:10:58 +02:00
Scott Bishel
d6b134aecc MM-18344 Honour absolute paths to SAML certificates (#12237)
* MM-18344 Honour absolute paths to SAML certificates

* fixes from code review

* update text
2019-09-24 06:44:12 -06:00
Scott Bishel
1de5f29de4 MM-17620 - Web: Error when entering an invalid MFA token is unclear (#12238) 2019-09-24 06:43:40 -06:00
Darrell Richards
417dd7997a GH-12196 Converting to structured logging in app/import_functions.go (#12205)
* Updated Logging for mlog and removed fmt

* Changed up wording from last PR.
2019-09-20 12:45:28 -06:00
Nikhil Ranjan
c4d6b0213e Convert app/notification_email_test.go t.Fatal calls into asse… (#12227)
* Convert app/notification_email_test.go t.Fatal calls into assert/require calls

* changes as per review

* using require.Regexp instead of require.True
2019-09-20 09:04:10 -06:00
Nikhil Ranjan
8cd9dac632 Convert app/user_agent_test.go t.Fatal calls into assert/requi… (#12224) 2019-09-20 16:53:48 +02:00
Shota Gvinepadze
32bc585446 [MM-18121] Fix config set panic (#12083)
* Fix config set panic

* Change error message

* Add a test case

* Update error string
2019-09-20 17:48:19 +04:00
Jesús Espino
e236eb74fa Add prometheous metrics for each api handler (#12254) 2019-09-20 15:09:58 +02:00
Ben Schumacher
05fae599b8 [MM-18625] Fix database source parsing on go 1.12.8 (#12250) 2019-09-20 06:22:40 +02:00
Jesse Hallam
33cf37bbc0 MM: 16479: ensure replacement file finishes io.Copy (#12249)
* simplify FileWillBeUploaded

* MM-16479: ensure replacement file finishes io.Copy
2019-09-19 22:02:19 -03:00
Ogundele Olumide
22ec2d169c chore: migrate t.fatal to testify (#12231)
- convert  t.fatal to require or assert
2019-09-19 18:33:24 -04:00
Akil Darjean
9b5b2831ee Migrate tests from 'app/command_mute_test.go' to use testify (#12240) 2019-09-19 18:01:30 +01:00
tejashreecd
e42c40b4b5 [MM-11854] Migrates some CI/CD steps to circleci (#11978)
* [MM-11854] Migrates some CI/CD steps to circleci

* [MM-11854] Empty commit to trigger CI/CD build

* update circleci config

* update build image
2019-09-19 12:43:21 +02:00
Ankit R Gadiya
d1017a089a Moved Push to S3, Clean Checkout and Build Docker before Test (#12027) 2019-09-19 10:37:02 +02:00
Jesús Espino
ecbc5ef5e1 Fixing autocomplete endpoint for in/out of channels (#12147) 2019-09-18 20:27:32 +02:00
sowmiyamuthuraman
be0d13578d Refactor "app/authorization.go" to use structured logging (#12233) 2019-09-18 20:02:22 +02:00
Carlos Tadeu Panato Junior
c7b583ccdd use mkdirall instead of mkdir (#12032)
* use mkdirall instead of mkdir

* revert

* create the folder here
2019-09-18 18:39:01 +02:00