Commit Graph

522 Commits

Author SHA1 Message Date
Andreas Linz
cf9b9802a8 Set a proper HTTP user-agent header (#9482)
Previously, mattermost-server would always request with the default
user-agent of Go's net/http package that is `Go-http-client/1.1` or
something similar.
This has several disadvantages, one is that the default user-agent
made it pretty hard to distinguish mattermost requests from other
service requests in a network log for example.

Now a user-agent of the form `mattermost-<current-version>` is set in
the client.

- [x] Added or updated unit tests (required for all new features)
2018-10-03 10:28:44 -07:00
Carlos Tadeu Panato Junior
ad4443d06d fix gofmt for go 1.11 (#9516)
* fix gofmt for go 1.11

* fix test

* comment out one test
2018-10-01 10:19:11 -07:00
Jesse Hallam
34a1da9717 emit CustomTermsOfService in license (#9472) 2018-09-27 11:24:57 +01:00
Harshil Sharma
af275fe924 #MM-12130 changes for custom service terms (#9450)
* #MM-12130 changes for custom service terms

* Fixed styling

* Added getServiceTerms API

* removed unnecessary panic

* removed custom service terms text from flat config

* reverted user sql store as those changes are no longer needed

* added tests

* Updated a config key to be more standard

* Added copyright info

* Loading service terms only if the feature is enabled

* Loading service terms only if the feature is enabled

* removed unused index

* added createservice termns API

* made a param to bool instead of string

* added createservice termns API

* review fixes

* fixed styling

* Minor refactoring

* removed saveConfig and loadConfig magic

* added empty service terms text check to createServiceTerms API

* refactoed some urls to be terms_of_service instead of service_terms

* removed check for support settings

* changed URLs in tests

* removed unused code

* fixed a bug

* added service termd id in conif

* fixed a test

* review fixes

* minor fixes

* Fixed TestCreateServiceTerms
2018-09-26 16:49:22 -04:00
Harrison Healey
4e59a27293 Move HTTPService and ConfigService into services package (#9422)
* Move HTTPService and ConfigService into utils package

* Re-add StaticConfigService

* Move config and http services into their own packages
2018-09-26 12:42:51 -04:00
Jesús Espino
a08df883b4 Move file backend to its own service (#9435)
* Move file backend to its own service

* Moving utils/inbucket to mailservice package
2018-09-20 10:07:03 -07:00
Carlos Tadeu Panato Junior
fba0f8e8b2 Merge release-5.3 2018-09-12 15:07:33 +02:00
Jesse Haka
4e33aeb581 fix s3 memory usage (#9373) 2018-09-10 19:35:01 +02:00
cpanato
4cf6913c1c Merge remote-tracking branch 'upstream/release-5.3' into release-5.3-daily-merge-20180904 2018-09-04 23:27:39 +02:00
Jesse Hallam
b98ef658ad MM-11720: disable loading plugin specific config from the environment (#9334)
There are numerous issues here, including some non-determinism in the viper library (fixable) and some annoying behaviour regarding periods in keys, often used by plugin ids (fix unknown). Let's defer the handling of same until we can get our config loading library to do what we need it to do vs. having to hack around viper all the time.
2018-09-03 17:08:25 +02:00
Carlos Tadeu Panato Junior
153b119092 Merge release-5.3 2018-09-03 14:48:14 +02:00
Daniel Schalla
531897b1f0 add megacheck as makefile target (#9288)
Fix code issues in channel_test.go

Fix Channel Test Issues detected by Megacheck

Fix API Emoji Test Issues detected by Megacheck

Fixed API Issues Reported by Megacheck

Fixed App issues reported by megacheck

Remaining fixes

removed test added by mistake from old HEAD

gofmt

Store Fixes

simplified returns

Fix test for multi member channel delete

revert to delete unused function
2018-09-03 14:08:40 +02:00
Christopher Speller
9f46512759 MM-11693 Allow connections to /plugins for interactive message buttons. (#9333)
* Allow connetions to /plugins for interactive message buttons.

* Adding siteurl to exclusions for AllowedUntrustedInternalConnections

* Adding subpath support for allowing interactive message buttons plugin connections.
2018-09-02 09:30:10 +02:00
Joram Wilander
9599f1a52f If no origin header is set for WebSocket, do not fail upgrade (#9287) 2018-08-24 11:09:48 +01:00
Carlos Tadeu Panato Junior
5876b52ecd Merge release-5.2 2018-08-24 11:36:39 +02:00
George Goldberg
d2945cdd77 MM-11782: Make archived channels experimental and off-by-default. (#9281)
* MM-11782: Make archived channels experimental and off-by-default.

* Fix test.
2018-08-22 21:12:51 +02:00
cpanato
620d55810d Merge remote-tracking branch 'upstream/release-5.2' into release-5.2-daily-merge-20180810 2018-08-10 15:03:18 +02:00
Harrison Healey
4299ef312b MM-11382 Remove special handling of PluginSettings when loading config (#9234)
* MM-11382 Only override PluginSettings from environment when necessary

* MM-11382 Remove special handling of PluginSettings when loading config

* Add extra unit test
2018-08-10 10:10:29 +02:00
Harrison Healey
99cf15b56e Update serverside markdown parser to respect unicode and capitalized links (#9235) 2018-08-08 12:13:04 +02:00
Harrison Healey
ecfba2c2e9 MM-11175 Add logic to server to understand markdown images with dimensions (#9159) 2018-08-01 11:43:58 -04:00
Martin Kraft
5872bf9c2f Pr 9039 (#9187)
* MM-11065: Allow to search and get archived channels from the API

* Fixing more tests

* Add some unit tests

* Add includeDeleted parameter to session permissions check function

* More test fixing

* Adding archive channels list in channels search

* Add restriction for archived channel edition

* Reverting permissions checks modification

* Changed the query parameter to include_deleted

* Enable search archive channels as true by default

* Adding tests for verify search on deleted channels

* Allowing to override archive channels during the imports

* Fixed test

* Search in archive channels from the API must be explicitly requested

* Removing includeDeleted parameter from GetChannelByName and GetChannelByNameForTeam

* Back to ViewArchivedChannels config

* Fixing tests

* Reverting GetChannelByName parameter

* Add include deleted parameter on GetChannel functions in plugins api

* Fixing tests
2018-07-30 15:06:08 -04:00
Christopher Speller
90e5e279c1 Fix file streaming to close files. (#9168) 2018-07-26 10:52:24 -07:00
Harrison Healey
c8d3e42139 MM-11451 Added autolinking to Markdown parser (#9151)
* MM-11451 Added autolinking to Markdown parser

* Added missing headers

* Added mailto and tel links
2018-07-24 07:40:01 -07:00
Chris Duarte
da124f018d Add ExperimentalSidebarPreference in the config (#9013)
* Add ExperimentalSidebarPreference in the config

* Override Sidebar preference based on GroupUnread settings

* Rename to ExperimentalChannelOrganization

* Add Sidebar config in diagnostics

* Fix diagnostics for experimental_channel_organization
2018-07-23 11:18:24 -04:00
Yusuke Nemoto
6104c37761 Break HTML blocks to individual strings (#8903)
* Modifying message and templates about mfa_change

* Modifying message and templates about password_change

* Modify message and template about password_reset

* Modify message and template about singin_change

* Modify message and template about email_info

* Modify message and template about change_username

* Modify message about change_email

* Add missing props

* Add argument

* Modify message and template about token_added

* Modify messages and template about notification_email

* Modify message and template about deactivate_email

* Fix style

* Remove unused message

* Remove br tags

* Modify message and code about invite_mail

* Add missing message
2018-07-20 12:52:20 -04:00
Adrian
a575411f15 Fix invalid markdown text ranges (#9126)
second Range value is the end pos, not the length... 🙈
2018-07-18 19:55:50 -07:00
Adrian
88eef609ab Merge consecutive text nodes when inspecting markdown (#9112)
* Fix assertion order

expected/actual were in wrong order, resulting in misleading output in
case of failing tests

* Merge consesutive markdown text nodes

This ensures that parser quirks such as "hello!" being parsed as
two separate nodes ("hello" and "!") are not exposed to code inspecting
a markdown strings.
2018-07-16 11:12:31 -04:00
Adrian
e135cc99e1 Expose range information for markdown text nodes [WIP] (#9067)
* Track positions of markdown text

* Add tests for markdown text ranges
2018-07-11 12:12:46 -04:00
Christopher Speller
74e5d8ae66 MM-11120 Adding setting to disable email invitations and rate limiting. (#9063)
* Adding setting to disable email invitations.

* Adding a setting and rate limiting for email invite sending.

* Modifying email rate limit to 20/user/hour

* Adding EnableEmailInvitations to client side config and command.
2018-07-10 10:54:25 +02:00
Jesse Hallam
57bf7203f3 subpath: rewrite manifest.json too (#9017) 2018-06-29 03:27:42 +05:30
Kenny Au
437f9f5b64 Gfycat integration (#8971)
* Gfycat integration

* Added gfycat api credentials to config.
2018-06-27 15:35:15 -04:00
Daniel Schalla
ecefa6cdd1 Implementation of File Exists Function; Delete FileInfos upon Permanent User Delete (#8958)
Check if file was deleted on FS

Warning message if file couldnt be removed
2018-06-25 12:12:59 -04:00
Jesús Espino
d9390244af MM-8810: Add CSV Compliance export (#8966)
* MM-8810: Add CSV Compliance export

* Only allowing to schedule actiances export throught the cli

* De-duplicating some code

* Fixes on texts

* Fixes on translations
2018-06-22 11:15:19 +02:00
Jesse Hallam
dd35ad43ca MM-10370: serve subpath (#8968)
* factor out GetSubpathFromConfig

* mv web/subpath.go to utils/subpath.go

* serve up web, api and ws on /subpath if configured

* pass config to utils.RenderWeb(App)?Error

This allows the methods to extract the configured subpath and redirect
to the appropriate `/subpath/error` handler.

* ensure GetSubpathFromConfig returns trailing slashes deterministically

* fix error 404 handling

* redirect /subpath to /subpath/

This is necessary for the static handler to match, otherwise none of the
registered routes find anything. This also makes it no longer necessary
to add trailing slashes in the root router.
2018-06-21 11:31:51 -07:00
Harrison Healey
07c785e294 MM-10730 Added support for empty environment variables to viper (#8973) 2018-06-21 16:30:20 +02:00
Jesús Espino
344836dfb2 Add missed translations (#8959) 2018-06-19 19:40:26 +02:00
Harrison Healey
6d8140337e MM-8701 Limit the number of client config fields sent before user logs in (#8954)
* MM-8701 Limit the number of client config fields sent before user logs in

* Fixed missing client config field

* Reduced duplication between limited and regular client config
2018-06-18 12:39:22 -04:00
Carlos Tadeu Panato Junior
c8b99b97df Update html2text lib to use the original repo (#8900) 2018-06-14 19:27:21 +02:00
Harrison Healey
d0cda0500e MM-10769 Rename references to spf13/viper to mattermost/viper (#8948) 2018-06-14 08:15:02 -07:00
Corey Hulen
656c8a62d1 Prototype for CBA (#8475)
* Prototype for CBA

* Fixing gofmt issues

* Do not require password if logging in with certificate

* Fixing issues from feedback

* Adding unit tests

* Fixing feedback
2018-06-12 10:16:39 -07:00
Jesse Hallam
0ba0af889e MM-6839: searching for paths relative to executable (#8915)
* MM-6839: search relative to executable (#8853)

* MM-6839: searching for paths relative to executable

In addition to searching relative to the current working directory, also
search relative to the location of the binary. This helps locate config
and i18n files when invoking an absolute path to the mattermost binary.

* MM-6839: find mattermost/ binary using utils.FindFile

* add unit tests for utils.FindFile to exclude directories

* fix filtering out directories in FindFile

* fix platform invoking ./bin/mattermost
2018-06-06 07:18:24 -07:00
Saturnino Abril
312edbe531 [MM-10718] Move custom branding to TE (#8871)
* move custom branding to TE
* move brand's enterprise code to server and remove BrandInterface
2018-06-02 06:33:59 +08:00
George Goldberg
27e7841a73 Merge branch 'advanced-permissions-phase-2' 2018-05-31 10:25:31 +01:00
Harrison Healey
2fe8878749 MM-9547 Added config setting to control url autolinking schemes (#8862)
* MM-9547 Added config setting to control autolinking schemes

* Renamed AutolinkingSchemes to CustomUrlSchemes
2018-05-30 10:48:04 -04:00
Christopher Speller
2f6039f23f Revert "MM-6839: search relative to executable (#8853)" (#8876)
This reverts commit d3cf110620.
2018-05-29 13:21:42 -07:00
Jesse Hallam
d3cf110620 MM-6839: search relative to executable (#8853)
* MM-6839: searching for paths relative to executable

In addition to searching relative to the current working directory, also
search relative to the location of the binary. This helps locate config
and i18n files when invoking an absolute path to the mattermost binary.

* MM-6839: find mattermost/ binary using utils.FindFile
2018-05-29 10:55:49 -04:00
Carlos Tadeu Panato Junior
4f5fdb6f89 fix bad merge (#8869) 2018-05-29 14:00:46 +02:00
Martin Kraft
c180cdbd1c Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-28 10:35:27 -04:00
Carlos Tadeu Panato Junior
c3e9c41440 [MM-1915] Add Deactivate Account - server side (#8699) 2018-05-28 16:20:08 +02:00
Martin Kraft
be177caf5f Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-28 08:20:12 -04:00