Commit Graph

183 Commits

Author SHA1 Message Date
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
Jesse Hallam
f106417103 MM-10367: rewrite subpath assets on startup (#8944)
Examine ServiceSettings.SiteURL on startup and rewrite assets
accordingly if not in a development environment.

Also export `mattermost config subpath` command to manually do same.

This accompanies a webapp PR to use the updated `root.html` to define
the necessary webpack asset path for dynamically loading assets.
2018-06-14 08:26:22 -07:00
George Goldberg
1b821c7319 MM-10684: Show logs on Slack Import CLI. (#8936) 2018-06-11 15:48:32 +01: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
George Goldberg
27e7841a73 Merge branch 'advanced-permissions-phase-2' 2018-05-31 10:25:31 +01:00
Christopher Speller
af4e907f5e MM-10731 Revert site url kill server (#8877)
* Revert "MM-9983 Requiring SiteURL to be set. (#8769)"

This reverts commit 0432f995ec.

* Add log message for SiteURL not being set.
2018-05-30 09:58:24 -04:00
George Goldberg
994ccf475f Add note about clearing caches when permissions reset CLI done. (#8823)
* Add note about clearing caches when permissions reset CLI done.

* Adjust text.
2018-05-30 11:21:36 +01: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
Jesús Espino
e88fe4bb1d MM-8853: Adding MANAGE_EMOJIS and MANAGE_OTHERS_EMOJIS permissions (#8860)
* MM-8853: Adding MANAGE_EMOJIS and MANAGE_OTHERS_EMOJIS permissions

* MM-8853: Removing unnecesary emoji enterprise feature

* Create emojis migration

* Adding MANAGE_EMOJIS and MANAGE_OTHERS_EMOJIS always to system admins

* Simplifing permissions checks

* Revert "Simplifing permissions checks"

This reverts commit e2cafc1905.
2018-05-29 15:58:12 +01: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
Martin Kraft
4c683aff76 Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-22 12:54:00 -04:00
Christopher Speller
88a8703766 Fixing CMD docs. (#8827) 2018-05-18 10:34:37 -07:00
Christopher Speller
0432f995ec MM-9983 Requiring SiteURL to be set. (#8769)
* Requiring SiteURL to be set.

* Modifying to make tests pass.

* Fixing test.
2018-05-18 08:37:43 -07:00
Martin Kraft
c6ba5c32d6 Merge fix. 2018-05-18 08:41:44 -04:00
Martin Kraft
78d95a25f7 Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-18 08:23:02 -04:00
Christopher Speller
11cbb59747 Renaming platform binary to mattermost. (#8801) 2018-05-17 12:40:40 -07:00
Martin Kraft
e0390632b3 MM-10264: Adds CLI command to import and export permissions. (#8787)
* MM-10264: Adds CLI command to import and export permissions.

* MM-10264: Changes Scheme Name to DisplayName and adds Name slug field.

* MM-10264: Changes display name max size.

* MM-10264: Another merge fix.

* MM-10264: Changes for more Schemes methods checking for migration.

* MM-10264: More updates for Schemes migration checking.
2018-05-17 11:37:00 -04:00
Martin Kraft
6f31d90e2f Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-17 07:53:16 -04:00
George Goldberg
b9b76b275a MM-10234: Make CLI roles command advanced-permissions aware. (#8771)
* MM-10234: Make CLI roles command advanced-permissions aware.

* Fix for loop scope.

* Fix style.
2018-05-17 10:18:49 +01:00
Joram Wilander
1f6c271b3b MM-8708 Remove api package (#8784)
* Remove api package

* Remove api dependency from cmd package

* Remove EnableAPIv3 setting

* Update web tests

* Add more websocket tests

* Move some ws and oauth tests to api4 package

* Move command tests into api4 package

* Test fixes

* Fix msg command test

* Add some app file tests
2018-05-16 13:43:22 -04:00
Derrick Anderson
228bc4bd1d Merge remote-tracking branch 'origin/release-4.10' into merge410rc5 2018-05-15 11:19:27 -04:00
Joram Wilander
47250c6629 Refactor context out of API packages (#8755)
* Refactor context out of API packages

* Update function names per feedback

* Move webhook handlers to web and fix web tests

* Move more webhook tests out of api package

* Fix static handler
2018-05-14 10:24:58 -04:00
Carlos Tadeu Panato Junior
527bf9d3d3 [MM-9720] fix bugs when trying to change for a in use email and check the number of parameters (#8772) 2018-05-11 12:58:03 -04:00
Christopher Speller
d8dd271e43 MM-4998 Adding LoginIdAttribute to allow LDAP users to change their login ID without losing their account (#8756)
* Adding LoginIdAttribute

* Modifying LDAP to use loginIDAttribute.

* Adding IDAttribute migration and AD objectGUID support.

* Removing unused idea.

* Fix typo.
2018-05-10 09:46:09 -07:00
Christopher Speller
686c2fbab7 Structured logging (#8673)
* Implementing structured logging

* Changes to en.json to allow refactor to run.

* Fixing global logger

* Structured logger initalization.

* Add caller.

* Do some log redirection.

* Auto refactor

* Cleaning up l4g reference and removing dependancy.

* Removing junk.

* Copyright headers.

* Fixing tests

* Revert "Changes to en.json to allow refactor to run."

This reverts commit fd8249e99b.

* Fixing some auto refactor strangeness and typo.

* Making keys more human readable.
2018-04-27 12:49:45 -07:00
George Goldberg
b13a228b04 MM-10121: CLI command to reset permissions system to default state. (#8637)
* MM-10121: CLI command to reset permissions system to default state.

* Review comment.
2018-04-18 10:18:07 +01:00
Carlos Tadeu Panato Junior
51a6e95f58 add app shutdown to make sure the goroutines finish and all process are closed (#8629)
* run the send email verification as goroutine as well

* add app shutdown to make sure all go routines finish
2018-04-17 11:06:55 -04:00
Jesús Espino
84ca98d9a9 Fixed the example text on CLI channel command (#8613) 2018-04-13 07:58:21 -07:00
Jesús Espino
8df6d5cc30 Add list command to teams command in CLI (#8612)
* Add list command to teams command in CLI

* Using App instead of Store to get the teams
2018-04-12 11:50:44 -04:00
Harrison Healey
0a6b96cb40 MM-9849 Added tracking of which settings are set through environment variables (#8586)
* MM-9849 Added tracking of which settings are set through environment variables

* Removed old version of viper

* Added forked version of viper

* Fixed unit tests

* Fixed more unit tests

* Removed copy from App.GetEnvironmentConfig
2018-04-09 18:16:11 +02:00
Jesús Espino
654042a245 Migrate Advanced Permissions Roles when needed on cli commands (#8535) 2018-04-04 09:15:52 -04:00
Jesús Espino
014a3b6a60 Fixing misspell errors (#8544) 2018-03-29 10:04:54 -04:00
Martin Kraft
e13e64711f Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1 2018-03-27 09:01:42 -04:00
Jesús Espino
a8e0fc6c5d Changing the user-0 data to sysadmin and user-1 username to user-1 (#8494) 2018-03-23 15:32:10 -04:00
Martin Kraft
5fa1b35819 Merge branch 'master' into advanced-permissions-phase-1 2018-03-23 09:08:49 -04:00
Jesse Hallam
87762ae62e Improved bulkload error handling (#8491)
* log the config file path used by the server on startup

* return an err if the bulk import command fails

* log the underlying errors that occur when importing

The code assumed all errors meant a missing resource, but it's possible
something else is at fault. Including the error helps pinpoint that more
readily.
2018-03-23 03:33:02 +08:00
Chris Duarte
74e703f58d Timezone feature (#8185)
* Add supported timezones into config

Remove Timezone list creation in favor of timezone from configs

Add Timezone field to Users table

Clean up format of SupportedTimezones in config

* Remove unwanted change

* Add test for updating user timezone

* Add empty map[string]string if Timezone is null

* Add EnableTimezoneSelection config

* Revert back to map[string]string for ClientConfig

* Refactor SupportedTimezones into timezones.json

* Include timezones.json in TestConfigFlag

* Add timezone api endpoint

* Bump varchar size to 256 and setMaxSize in user_store

* Refactor LoadConfig to LoadConfig and LoadTimezoneConfig

* Remove unnecessary argument in LoadConfig, mail_test

* Add test for timezone endpoint

* Add license header

* Refactor timezones endpoint to system.go

* Add system base route to timezone endpoint

* db timezone upgrade in db v4.9

* Avoid saving SupportedTimezones to config.json

* Add timezonePath support in config

* Remove EnableTimezoneSelection from config

* Use return statement without return parameter

* Refactor test for SupportedTimezones

* Check for supportedTimezone != nil instead of using len

* Decouple SupportedTimezones out of Config

* Fix failing test

* Add LastTeamIconUpdate back in upgrade.go

* Write timezone config in config_flag_test

* Add code fallback for default timezone support
2018-03-22 09:53:43 -04:00
George Goldberg
37f0e5e0eb Merge branch 'master' into advanced-permissions-phase-1 2018-03-19 10:53:37 +00:00
George Goldberg
fadcdd271a Merge branch 'master' into advanced-permissions-phase-1 2018-03-13 13:36:23 +00:00
Derrick Anderson
0d1177cdf9 Merge remote-tracking branch 'origin/release-4.8' into t3mergetomaster 2018-03-12 16:47:55 -04:00
Jesús Espino
2b460da1d5 Fix saml users.json parameter (#8435) 2018-03-12 14:16:22 -04:00
Carlos Tadeu Panato Junior
81acb1a14b [MM-9720] Platform command to change user email address (#8422) 2018-03-12 07:40:44 -04:00
Jesús Espino
b2dd00dd5b Adding enterprise commands support (#8327) 2018-03-07 20:04:18 +00:00
Chris
e8943936c5 general cleanup (#8387) 2018-03-07 12:36:40 -06:00
George Goldberg
901acc9703 Merge branch 'master' into advanced-permissions-phase-1 2018-03-02 15:55:03 +00:00
Jesús Espino
342d05bcfc Adding saml migration command (#8263)
* Adding saml migration command

* Texts fixed
2018-02-21 14:34:03 +01:00
George Goldberg
f8289eb286 Merge branch 'master' into advanced-permissions-phase-1 2018-02-19 11:19:39 +00:00
Christopher Speller
6d8f122a51 Upgrading server dependancies (#8308) 2018-02-16 09:47:51 -05:00
Pierre de La Morinerie
b112747de7 Send systemd READY notification (#8296)
Currently, when starting Mattermost programmatically, it's hard to tell
when the server is actually ready to receive network connections.

This isn't convenient for monitoring (the systemd service status is
"running" although the server is still booting), nor for programatic use
(where a script would need to know when the server is ready to perform
further actions).

To improve this, systemd allow processes to tell when they started
successfully. The launcher waits for this notification before
reporting the service as successfully launched.

The way processes notify systemd is by sending a `READY=1` string over
a standard unix socket, whose path is provided in an environment var.

The systemd service is then told to expect this notification:

```diff
 [Service]
-Type=simple
+Type=notify
 ExecStart=/home/vagrant/go/bin/platform
```

Now, when starting the server, systemd will actually wait for the server to
be ready before returning the control to the shell.

Additionally, during this time, querying the server status with
`service mattermost status` will report the service as "activating" – before
transitioning to "running" when the server is ready.
2018-02-15 16:47:03 -08:00