Skip to content

Commit 4cf3296

Browse files
MM-31575 ENV var license override (#4204)
* MM-31575 ENV var license override Documentation for: https://mattermost.atlassian.net/browse/MM-31575 Updated: - Self-Managed Admin Guide > Configure Mattermost > Configuration Settings - Changed the following bolded lines to proper headings: "Configuration in Database", "Environment Variables", and "Load Custom Configuration Defaults" - Added new subsection "Override Mattermost License File" * Fixed typo "In a high-availability environment, using an environment variable to override a server license only affect[s] the individual app server and doesn't propagate to other servers in the cluster." * Update source/administration/config-settings.rst Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> * Update source/administration/config-settings.rst Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>
1 parent b175ece commit 4cf3296

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

source/administration/config-settings.rst

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ Mattermost configuration settings are maintained in the ``config.json`` configur
88

99
Mattermost must have write permissions to ``config.json``, otherwise changes made in the System Console will have no effect.
1010

11-
On new installations starting from version 5.14, the ``default.json`` file used to create the initial ``config.json`` has been removed from the binary and replaced with a build step that generates a fresh ``config.json``. This is to ensure the initial configuration file has all the correct defaults provided in the server code. Existing ``config.json`` files are not affected by this change.
11+
On new installations starting from v5.14, the ``default.json`` file used to create the initial ``config.json`` has been removed from the binary and replaced with a build step that generates a fresh ``config.json``. This is to ensure the initial configuration file has all the correct defaults provided in the server code. Existing ``config.json`` files are not affected by this change.
1212

13-
**Configuration in Database**
13+
Configuration in Database
14+
--------------------------
1415

1516
Storing configuration in the database is supported in v5.10 and later. Please see more information on how to set this up `here <https://docs.mattermost.com/administration/config-in-database.html>`_.
1617

17-
**Environment Variables**
18+
Environment Variables
19+
---------------------
1820

19-
Starting from Mattermost version 3.8, you can use environment variables to manage the configuration. Environment variables override settings in ``config.json``. If a change to a setting in ``config.json`` requires a restart for it to take effect, then changes to the corresponding environment variable also require a server restart.
21+
Starting from Mattermost v3.8, you can use environment variables to manage the configuration. Environment variables override settings in ``config.json``. If a change to a setting in ``config.json`` requires a restart for it to take effect, then changes to the corresponding environment variable also require a server restart.
2022

2123
The name of the environment variable for any setting can be derived from the name of that setting in ``config.json``. For example, to derive the name of the Site URL setting:
2224

@@ -37,14 +39,26 @@ For any setting that is not set in ``config.json`` or in environment variables,
3739
.. warning::
3840
Database connection strings for the database read and search replicas need to be formatted using `URL encoding <https://www.w3schools.com/tags/ref_urlencode.asp>`__. Incorrectly formatted strings may cause some characters to terminate the string early, resulting in issues when the connection string is parsed.
3941

40-
**Load Custom Configuration Defaults**
42+
Override Mattermost License File
43+
--------------------------------
44+
45+
Starting from Mattermost v5.26, you can use an environment variable to override any license in the database or file configuration without replacing those licenses.
46+
47+
When starting the server, specify the license key as ``MM_LICENSE`` with the contents of a license file.
48+
49+
.. note::
50+
If ``MM_LICENSE`` is set to a non-empty string, but the license specified is not valid, the Mattermost server will be started without a license.
51+
52+
In a High Availability deployment, using an environment variable to override a server license only affects the individual app server and doesn't propagate to other servers in the cluster.
53+
54+
Load Custom Configuration Defaults
55+
----------------------------------
4156

4257
Starting from Mattermost v5.30, you can load a set of custom configuration defaults using an environment variable. This custom configuration applies only if the values are not already present in the current server configuration.
4358

4459
1. Create a JSON file that contains the custom configuration defaults. For example, ``custom.json``.
4560
2. When starting the server, point the custom defaults environment variable to the defaults file: ``MM_CUSTOM_DEFAULTS_PATH=custom.json``.
4661

47-
4862
.. contents::
4963
:depth: 2
5064
:local:

0 commit comments

Comments
 (0)