* Updated links to legacy domain about.mm.com
* Legacy link updates
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* Reverting - only need to change en.json
* about.mm.com URL updates
* mattermost.org URL updates
* forum.mm.org URL update
* Update .github/ISSUE_TEMPLATE.md
* Update .github/ISSUE_TEMPLATE.md
* Un-deleted language files
* Update README.md
* Update tests/test-config.json
* fix some test due to url updating (#19787)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
* revamp db version and add applied migrations endpoint
* replace old schema version with new
* add db version subcommand
* add to local api
* reflect review comments
* log errors
* remove setting the version from model.CurrentVersion
* fix a test
* use different field for schema version
* add build hash and current version to the support packet
* add tests
* update test to use new assets
* Revert "[MM-41576] Revamp database schema version (#19586)"
This reverts commit 645fee3fe3.
* Revert "MM-42049 - license endpoint not working (#19686)"
This reverts commit 4fe89e5847.
* revamp db version and add applied migrations endpoint
* replace old schema version with new
* add db version subcommand
* add to local api
* reflect review comments
* log errors
* remove setting the version from model.CurrentVersion
* fix a test
* MM-42378: Fix server crash while loading license
The user service needs to be created before
loading license.
https://mattermost.atlassian.net/browse/MM-42378
```release-note
NONE
```
* Further fix
```release-note
NONE
```
After refactoring the channels init, the
config service under channels won't have
the config hash until the product gets
started. This caused an issue during
cluster initialization.
Therefore moved it after the product start.
```release-note
NONE
```
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This is more of a general refactor of the initialization
process which should allow us to pass services more
easily.
The changes are minimal to keep the scope limited.
For now, the objective is to pass the file service
to the Channels product. For that, it was required
to move some of the enterprise interfaces under Channels
from Server.
We also create a filestore field in the server to
avoid creating filestore reference every time
we make a filestore operation. This will be later
passed on to the Channels product.
Also removed an unnecessary test.
The test was working so far because we were creating
the filebackend every time for every request. But
we should go via UpdateConfig call which would fail,
were we to assign an invalid filestore name.
So we were actually testing for a different thing.
Therefore, removed the test.
```release-note
NONE
```
We create the basic boilerplate to pass services
to each product. The basic idea is to have a map
containing service names and the services.
The server will pass all services to all products.
But it is on the product, to choose what services
they will actually consume.
Each product will cast the received service to
an interface with the methods that product requires.
https://mattermost.atlassian.net/browse/MM-40813
```release-note
NONE
```
* Working on refactoring jobs service
* Making more consistent with the previous existing code
* Remove no longer needed functions
* Making a base PeridicScheduler to use it in most of the schedulers implementations
* Removing accidental complexity from on of the jobs
* Removing accidental complexity from expirynotify
* Fixing compilation from previous commit
* Remove accidental complexity from the export_delete job
* Simplifying the workers by making a reusable worker
* Using simple worker for export_delete job
* Simpliying export process job
* Simpliying extract content job
* Simpliying import delete job
* Simpliying import process job
* Simpliying product noticies job
* Simpliying fix crt channel unreads job (only removing the uneeded register function)
* Simpliying migrations job (only removing the uneeded register function)
* fixup
* Simpliying plugins job (only removing the uneeded register function)
* Simpliying bleve indexing job (only removing the uneeded register function)
* Simpliying resend invitation email job (only removing the uneeded register function)
* Fixing tests
* Simplifying migration tests infrastructure
* Adding missed license to files
* Adding an empty file to imports package to ensure this package exist even without enterprise repo
* Regenerating einterfaces mocks
* Adding missed license to files
* Updating i18n/en.json file
* help fixing enterprise tests compilation
* Adding new DailyScheduler
* Fixing typo and changing the waitTime type for periodic sechduler
* Making the daily scheduler more generic
* Adding comments to clarify not used parameters in interface scheduler interface implementations
* Using merror to handle multiple errors in jobs workers
* Fixing linter errors
* Addressing PR review comments
* Reverting go.tools.mod changes
* Removing the static check for worker type in the model (moving it to the insertion of new jobs
* Moving migrations job to the jobs directory
* Fixing (and improving a bit) tests
* Apply suggestions from code review
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
* Fixing enterprise tests
* Removing unneeded InitWorkers/InitSchedulers calls
* Fix expirenotify job when error happens
* Fixing govet errors
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
* config: bugfix on path resolution; fail if given config does not exist
* reflect review comments
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
We don't do instrumentation of Sentry transactions
anywhere in the code. Only opentracing code is present.
One has to explicitly add custom instrumentation for it
to work: https://docs.sentry.io/platforms/go/performance/instrumentation/custom-instrumentation/
It's likely someone is running custom code and sending
transaction data to Sentry. It's not super hard to pick
off the sentry DSN string from the binary.
The PR is more of a best effort to stop any future
transaction events to be sent.
```release-note
NONE
```
* [MM-40407] - Do not show the Renew Now if the license id does not exist in the portal
* improvements
* impl mock
* fix translations
* feedback impl
* fix typo
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Move enterprise features under Channels
We move the EE features which are Channels related.
While here, we also move some code under *Server.Start()
from NewServer.
```release-note
NONE
```
* move saml and ldap back to server
```release-note
NONE
```
* fix test
```release-note
NONE
```
* try again
```release-note
NONE
```
Summary
The addition of the TotalMsgCountRoot and MsgCountRoot columns to support CRT caused several issues with previously read threads and channels being marked as unread. Previously we attempted to fix this purely in a SQL migration [MM-35345][MM-35494] fixes for incorrect mentions and unreads for threads and channels #17803 but that turned out to be too heavy and it was decided to break up some of the fixes into async jobs.
This PR implements an async job to mark channels as read if there are no user posts since the last time the user viewed the channel.
Ticket Link
https://mattermost.atlassian.net/browse/MM-37013
* Move pluginCommands into Channels
We move pluginCommands, pluginCommandsLock
into Channels.
We also move the plugin related route handlers
under Channels and move the init code under
NewChannels. To achieve this, the router initialization
is bumped up.
Along with it, we clean up some App methods
which were just wrappers over Channel methods.
Instead, we call the Channel method directly
to make things more readable and easy to understand.
```release-note
NONE
```
* fix tests
```release-note
NONE
```
* Move plugins under Channels
We move all plugin related fields under *Channels.
This essentially migrates several methods from being under
*Server to under *Channels.
We also move the plugin startup and shutdown code
to be under Channels.Start and Channels.Shutdown.
While here, we remove the getPluginPublicKeyFiles
method which was a one-line method which uselessly
returned an error.
Lastly, we fix the product initialization order which
was incorrect previously. Products are dependent on
the main server.
So startup should be products -> server.
And shutdown should be server -> products.
```release-note
NONE
```
* Added app layer
```release-note
NONE
```
* Incorporate suggestions
```release-note
NONE
```
* Fix PluginHealthCheckJob
We were incorrectly calling to start PluginHealthCheckJob
without initializing the plugins environment.
To fix this, we move the code inside initPlugins right after
the environment is initialized.
To respond to config changes, we call it again from pluginsEnvironment.Shutdown
which gets called from ConfigListener when plugins are disabled. And initPlugins
is anyways called again from ConfigListener which plugins are enabled,
so we can avoid checking for PluginSettings.Enable again in the call.
We also rename the method to better indicate its nature.
During this, we also uncover and fix another bug where disabling
plugins would not shut down plugins at all because we were calling
s.GetPluginsEnvironment() directly which returns nil if plugins
were disabled. The approach we follow is to manually acquire the lock
whenever we need access to the struct ignoring config setting.
We fix that as well.
https://community-daily.mattermost.com/boards/workspace/zyoahc9uapdn3xdptac6jb69ic/285b80a3-257d-41f6-8cf4-ed80ca9d92e5/495cdb4d-c13a-4992-8eb9-80cfee2819a4?c=6ef6178c-3512-4e57-8edd-1d2b66a09c9e
```release-note
NONE
```
* Fix test
```release-note
NONE
```
* Move some more atomic values under Channels
The following fields were moved:
```
asymmetricSigningKey atomic.Value
clientConfig atomic.Value
clientConfigHash atomic.Value
limitedClientConfig atomic.Value
```
And also moved the initialization order from NewServer
to Channels.Start to better reflect the order of things.
Removed AsymmetricSigningKey from ConfigService
as it was no longer used.
Removed calling regenerateClientConfig during startup explicitly
because it was anyways called from ensureAsymmetricSigningKey.
https://community-daily.mattermost.com/boards/workspace/zyoahc9uapdn3xdptac6jb69ic/285b80a3-257d-41f6-8cf4-ed80ca9d92e5/495cdb4d-c13a-4992-8eb9-80cfee2819a4?c=87df1e15-588e-49ff-8bd1-ffa9651b8c82
```release-note
NONE
```
* Fix lint error
```release-note
NONE
```
- Make it a Server method.
- Pass Server instead of App.
- Remove global app instance from NewServer, rather
create local instances whenever needed.
- Remove App from Websocket router, and create dynamically
on every request.
- Remove HubStart and HubStop from App methods.
- Explicitly using s.Log instead of the global logger
to indicate dependency on Server. We could have passed the logger
explicitly but it doesn't look ideal.
```release-note
NONE
```
* Improve API4 initialization
- Refactored openGraphDataCache to be inside app layer.
- Moved the cache instance from global variable to be inside server.
- Moved out the app instantiation from the global commands package
to be instantiated on every call. Only the server instance is passed.
- Moved InitLocal to be called from inside Init.
```release-note
NONE
```
* Remove commented line
```release-note
NONE
```
* Add functionality to cleanup old jobs
Historically, we never cleaned up old jobs from the DB
leading to them being accumulated forever.
This PR introduces functionality to cleanup old jobs
older than a defined threshold.
The functionality is set to false by default and has
to be enabled for it to work.
```release-note
2 new config settings were added.
JobSettings.CleanupOldJobs: This indicates whether to clean up old jobs
from the DB or not. Default is false.
JobSettings.CleanupJobsThresholdHours: This defines the time gap in hours beyond
which older jobs will be removed. This has no effect if the above config
setting is set to false. Default is -1
```
* fix copy pasta
```release-note
NONE
```
* address review comments
```release-note
NONE
```
* Fix lint
```release-note
NONE
```
* Use single config option for everything
```release-note
NONE
```
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Move Channels into App
In this PR, we make Channels as part of App
instead of Server. This is part of the transition period
of moving fields from Server to Channels.
For now, Channels contains Server. So the hierarchy is
App -> Channels -> Server.
And as a first step, we also move httpService to Channels.
```release-note
NONE
```
* Fixing another test
```release-note
NONE
```
* new method
```release-note
NONE
```
* Creating empty Channels shell
This is the first step in moving to a product-based
isolated architecture.
For now, Channels is empty and does not contain anything.
Next step is to change App to contain Channels instead
of Server. Some of the initialization code in NewServer
would need to be moved inside NewChannels.
This would complete the full pass-through mode of accessing
everything.
The last step would be to gradually move Channels related
fields from Server into Channels, keeping Server to be
just the global level struct.
```release-note
NONE
```
* fix vet failure
```release-note
NONE
```
Fix an issue where context fields logged by server on behalf of plugins didn't contain correct name/value pairs:
- bump Logr version to add key/value methods to sugar logger
- expose factory args when configuring logging with custom target types (needed for FocalBoard to create log target adapter that converts typed fields into slices of interface{} as per plugin logging API)
- We move logging statements to the upper layer.
Store functions are low-level methods and should return error
upwards rather than logging.
- Used IN instead of any (array ()) which is equivalent.
- Made the delay to be of type time.Duration and un-exported it.
- Unexported the batch size constant.
```release-note
NONE
```