diff --git a/nixos/tests/mattermost/default.nix b/nixos/tests/mattermost/default.nix index bc795c2f5940..075781583c00 100644 --- a/nixos/tests/mattermost/default.nix +++ b/nixos/tests/mattermost/default.nix @@ -58,11 +58,20 @@ import ../make-test-python.nix ( UserNoticesEnabled = false; }; }; + package = pkgs.mattermost.override { + removeFreeBadge = true; + removeUserLimit = true; + }; } mattermostConfig; # Upgrade to the latest Mattermost. specialisation.latest.configuration = { - services.mattermost.package = lib.mkForce pkgs.mattermostLatest; + services.mattermost.package = lib.mkForce ( + pkgs.mattermostLatest.override { + removeFreeBadge = true; + removeUserLimit = true; + } + ); system.stateVersion = lib.mkVMOverride (lib.versions.majorMinor lib.version); }; } diff --git a/pkgs/by-name/ma/mattermost/mattermost-remove-free-banner.patch b/pkgs/by-name/ma/mattermost/mattermost-remove-free-banner.patch new file mode 100644 index 000000000000..d3365beed9c2 --- /dev/null +++ b/pkgs/by-name/ma/mattermost/mattermost-remove-free-banner.patch @@ -0,0 +1,85 @@ +diff --git a/webapp/channels/src/components/global_header/left_controls/product_menu/product_branding_team_edition/product_branding_free_edition.tsx b/webapp/channels/src/components/global_header/left_controls/product_menu/product_branding_team_edition/product_branding_free_edition.tsx +index 93cb8ab263..3d12cd5e54 100644 +--- a/webapp/channels/src/components/global_header/left_controls/product_menu/product_branding_team_edition/product_branding_free_edition.tsx ++++ b/webapp/channels/src/components/global_header/left_controls/product_menu/product_branding_team_edition/product_branding_free_edition.tsx +@@ -57,7 +57,6 @@ const ProductBrandingFreeEdition = (): JSX.Element => { + width={116} + height={20} + /> +- {badgeText} + + ); + }; +diff --git a/webapp/channels/src/components/header_footer_route/header.scss b/webapp/channels/src/components/header_footer_route/header.scss +index c2e6fbd187..bc1cedcff1 100644 +--- a/webapp/channels/src/components/header_footer_route/header.scss ++++ b/webapp/channels/src/components/header_footer_route/header.scss +@@ -47,20 +47,7 @@ + } + + .freeBadge { +- position: relative; +- top: 1px; +- display: flex; +- align-self: center; +- padding: 2px 6px; +- border-radius: var(--radius-s); +- margin-left: 12px; +- background: rgba(var(--center-channel-color-rgb), 0.08); +- color: rgba(var(--center-channel-color-rgb), 0.75); +- font-family: 'Open Sans', sans-serif; +- font-size: 10px; +- font-weight: 600; +- letter-spacing: 0.025em; +- line-height: 16px; ++ display: none !important; + } + } + } +@@ -83,12 +70,6 @@ + margin-top: 12px; + } + } +- +- &.has-free-banner.has-custom-site-name { +- .header-back-button { +- bottom: -20px; +- } +- } + } + + @media screen and (max-width: 699px) { +diff --git a/webapp/channels/src/components/widgets/menu/menu_items/menu_item.scss b/webapp/channels/src/components/widgets/menu/menu_items/menu_item.scss +index dee9b57f8c..8ef4aa073a 100644 +--- a/webapp/channels/src/components/widgets/menu/menu_items/menu_item.scss ++++ b/webapp/channels/src/components/widgets/menu/menu_items/menu_item.scss +@@ -316,14 +316,7 @@ + } + + .MenuStartTrial { +- display: flex; +- flex-direction: column; +- align-items: flex-start; +- padding: 8px 20px; +- border-radius: 4px; +- margin-top: 0; +- font-size: 12px; +- line-height: 16px; ++ display: none !important; + + button { + padding: 3px 0; +diff --git a/webapp/channels/webpack.config.js b/webapp/channels/webpack.config.js +index f29f19f9ab..ab85fc3b86 100644 +--- a/webapp/channels/webpack.config.js ++++ b/webapp/channels/webpack.config.js +@@ -469,6 +469,9 @@ if (targetIsDevServer) { + historyApiFallback: { + index: '/static/root.html', + }, ++ client: { ++ overlay: false, ++ }, + }, + performance: false, + optimization: { diff --git a/pkgs/by-name/ma/mattermost/mattermost-remove-user-limit.patch b/pkgs/by-name/ma/mattermost/mattermost-remove-user-limit.patch new file mode 100644 index 000000000000..2667c1e82cd2 --- /dev/null +++ b/pkgs/by-name/ma/mattermost/mattermost-remove-user-limit.patch @@ -0,0 +1,16 @@ +diff --git a/server/channels/app/limits.go b/server/channels/app/limits.go +index 4c88c1f049..3c1af8d02f 100644 +--- a/server/channels/app/limits.go ++++ b/server/channels/app/limits.go +@@ -10,8 +10,8 @@ import ( + ) + + const ( +- maxUsersLimit = 200 +- maxUsersHardLimit = 250 ++ maxUsersLimit = 10000000 ++ maxUsersHardLimit = 10000000 + ) + + func (a *App) GetServerLimits() (*model.ServerLimits, *model.AppError) { + \ No newline at end of file diff --git a/pkgs/by-name/ma/mattermost/package.nix b/pkgs/by-name/ma/mattermost/package.nix index 922a2836ad19..2acd3e9e4a1c 100644 --- a/pkgs/by-name/ma/mattermost/package.nix +++ b/pkgs/by-name/ma/mattermost/package.nix @@ -13,6 +13,8 @@ nixosTests, latestVersionInfo ? null, + removeUserLimit ? false, + removeFreeBadge ? false, versionInfo ? { # ESR releases only. Note: if NixOS would release with an ESR that goes out # of support during the lifetime of the NixOS release, it is acceptable @@ -136,6 +138,14 @@ buildMattermost rec { ''; }; + patches = + lib.optionals removeFreeBadge [ + ./mattermost-remove-free-banner.patch + ] + ++ lib.optionals removeUserLimit [ + ./mattermost-remove-user-limit.patch + ]; + # Needed because buildGoModule does not support go workspaces yet. # We use go 1.22's workspace vendor command, which is not yet available # in the default version of go used in nixpkgs, nor is it used by upstream: