Add net/mattermost-server

This commit is contained in:
Jeroen 2022-11-01 09:52:19 +01:00
commit 01ed292e7d
Signed by: jeroen
GPG Key ID: 7C7028F783798BAB
14 changed files with 4126 additions and 0 deletions

View File

@ -0,0 +1,4 @@
D/patches////
D/pkg////
/Makefile/1.69/Mon Oct 17 15:14:28 2022//
/distinfo/1.62/Mon Oct 17 15:14:28 2022//

View File

@ -0,0 +1 @@
ports/net/mattermost-server

View File

@ -0,0 +1,52 @@
COMMENT = open source Slack-alternative
V = 7.4.0
# mattermost-server-vendored distfile generated by fetching archive from
# https://github.com/mattermost/mattermost-server/archive/refs/tags/v{$V}.tar.gz
# and running "go mod tidy" + "go mod vendor"
DISTNAME = mattermost-server-vendored-${V}
PKGNAME = mattermost-server-${V}
MASTER_SITES = https://distfiles.laylo.io/
MASTER_SITES0 = https://releases.mattermost.com/${V}/
DISTFILES += ${DISTNAME}${EXTRACT_SUFX} \
mattermost-${V}-linux-amd64${EXTRACT_SUFX}:0
CATEGORIES = net
HOMEPAGE = https://mattermost.com/
MAINTAINER = Jeroen Janssen <jeroen@laylo.io>
# MIT
PERMIT_PACKAGE = Yes
WANTLIB += c pthread
MODULES = lang/go
ALL_TARGET = github.com/mattermost/mattermost-server
MODGO_LDFLAGS = -X github.com/mattermost/mattermost-server/model.BuildNumber=${V}
NO_TEST = Yes
post-extract:
cp ${WRKDIR}/mattermost/config/config.json ${WRKDIST}/config/
pre-configure:
${SUBST_CMD} ${WRKDIST}/config/config.json ${WRKDIST}/utils/fileutils/fileutils.go \
${WRKDIST}/config/file.go
do-build:
cd ${WRKSRC}/cmd/mattermost && \
${MODGO_BUILD_CMD}
do-install:
${INSTALL_PROGRAM} ${MODGO_WORKSPACE}/bin/mattermost ${PREFIX}/bin/
${INSTALL_DATA_DIR} ${PREFIX}/share/mattermost/
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/mattermost/
cp ${WRKSRC}/config/config.json ${PREFIX}/share/examples/mattermost/
.for _d in client fonts i18n templates
cp -Rp ${WRKDIR}/mattermost/${_d} ${PREFIX}/share/mattermost/
.endfor
.include <bsd.port.mk>

View File

@ -0,0 +1,4 @@
SHA256 (mattermost-7.4.0-linux-amd64.tar.gz) = N4wvgrTmg1J06IPmpLlPHOHNNB+bH2BBQgEsv9GWCN0=
SHA256 (mattermost-server-vendored-7.4.0.tar.gz) = Llw/OAjkRr5VuEuevpav+qJGy8kPHfofEyvltGQBTAE=
SIZE (mattermost-7.4.0-linux-amd64.tar.gz) = 341792682
SIZE (mattermost-server-vendored-7.4.0.tar.gz) = 23219217

View File

@ -0,0 +1,4 @@
/patch-config_config_json/1.29/Mon Oct 17 15:14:28 2022//
/patch-config_file_go/1.6/Mon Oct 17 15:14:28 2022//
/patch-utils_fileutils_fileutils_go/1.4/Mon Oct 17 15:14:28 2022//
D

View File

@ -0,0 +1 @@
ports/net/mattermost-server/patches

View File

@ -0,0 +1,131 @@
Index: config/config.json
--- config/config.json.orig
+++ config/config.json
@@ -12,7 +12,7 @@
"TLSStrictTransportMaxAge": 63072000,
"TLSOverwriteCiphers": [],
"UseLetsEncrypt": false,
- "LetsEncryptCertificateCacheFile": "./config/letsencrypt.cache",
+ "LetsEncryptCertificateCacheFile": "${LOCALSTATEDIR}/mattermost/letsencrypt.cache",
"Forward80To443": false,
"TrustedProxyIPHeader": [],
"ReadTimeout": 300,
@@ -90,7 +90,7 @@
"EnableInlineLatex": true,
"EnableAPIChannelDeletion": false,
"EnableLocalMode": false,
- "LocalModeSocketLocation": "/var/tmp/mattermost_local.socket",
+ "LocalModeSocketLocation": "${LOCALSTATEDIR}/mattermost/mattermost_local.socket",
"EnableAWSMetering": false,
"SplitKey": "",
"FeatureFlagSyncIntervalSeconds": 30,
@@ -146,14 +146,14 @@
"ReplicaLagSettings": []
},
"LogSettings": {
- "EnableConsole": true,
+ "EnableConsole": false,
"ConsoleLevel": "INFO",
"ConsoleJson": true,
"EnableColor": false,
"EnableFile": true,
"FileLevel": "INFO",
"FileJson": true,
- "FileLocation": "",
+ "FileLocation": "${LOCALSTATEDIR}/log/mattermost",
"EnableWebhookDebugging": true,
"EnableDiagnostics": true,
"EnableSentry": true,
@@ -170,14 +170,14 @@
"AdvancedLoggingConfig": ""
},
"NotificationLogSettings": {
- "EnableConsole": true,
+ "EnableConsole": false,
"ConsoleLevel": "INFO",
"ConsoleJson": true,
"EnableColor": false,
"EnableFile": true,
"FileLevel": "INFO",
"FileJson": true,
- "FileLocation": "",
+ "FileLocation": "${LOCALSTATEDIR}/log/mattermost",
"AdvancedLoggingConfig": ""
},
"PasswordSettings": {
@@ -194,7 +194,7 @@
"MaxFileSize": 104857600,
"MaxImageResolution": 33177600,
"DriverName": "local",
- "Directory": "./data/",
+ "Directory": "${LOCALSTATEDIR}/mattermost/data/",
"EnablePublicLink": false,
"ExtractContent": true,
"ArchiveRecursion": false,
@@ -225,11 +225,11 @@
"EnableSMTPAuth": false,
"SMTPUsername": "",
"SMTPPassword": "",
- "SMTPServer": "",
- "SMTPPort": "10025",
+ "SMTPServer": "localhost",
+ "SMTPPort": "25",
"SMTPServerTimeout": 10,
"ConnectionSecurity": "",
- "SendPushNotifications": true,
+ "SendPushNotifications": false,
"PushNotificationServer": "https://push-test.mattermost.com",
"PushNotificationContents": "full",
"PushNotificationBuffer": 1000,
@@ -260,13 +260,13 @@
"SupportSettings": {
"TermsOfServiceLink": "https://mattermost.com/terms-of-use/",
"PrivacyPolicyLink": "https://mattermost.com/privacy-policy/",
- "AboutLink": "https://docs.mattermost.com/about/product.html/",
+ "AboutLink": "https://docs.mattermost.com/about/product.html",
"HelpLink": "https://mattermost.com/default-help/",
"ReportAProblemLink": "https://mattermost.com/default-report-a-problem/",
"SupportEmail": "",
"CustomTermsOfServiceEnabled": false,
"CustomTermsOfServiceReAcceptancePeriod": 365,
- "EnableAskCommunityLink": true
+ "EnableAskCommunityLink": false
},
"AnnouncementSettings": {
"EnableBanner": false,
@@ -372,7 +372,7 @@
},
"ComplianceSettings": {
"Enable": false,
- "Directory": "./data/",
+ "Directory": "${LOCALSTATEDIR}/mattermost/data/",
"EnableDaily": false,
"BatchSize": 30000
},
@@ -529,8 +529,8 @@
"EnableUploads": false,
"AllowInsecureDownloadURL": false,
"EnableHealthCheck": true,
- "Directory": "./plugins",
- "ClientDirectory": "./client/plugins",
+ "Directory": "${LOCALSTATEDIR}/mattermost/plugins",
+ "ClientDirectory": "${LOCALSTATEDIR}/mattermost/client/plugins",
"Plugins": {},
"PluginStates": {
"com.mattermost.apps": {
@@ -605,11 +605,11 @@
"AdvancedTextEditor": true
},
"ImportSettings": {
- "Directory": "./import",
+ "Directory": "${LOCALSTATEDIR}/mattermost/import",
"RetentionDays": 30
},
"ExportSettings": {
- "Directory": "./export",
+ "Directory": "${LOCALSTATEDIR}/mattermost/export",
"RetentionDays": 30
}
-}
\ No newline at end of file
+}

View File

@ -0,0 +1,12 @@
Index: config/file.go
--- config/file.go.orig
+++ config/file.go
@@ -66,7 +66,7 @@ func resolveConfigFilePath(path string) (string, error
// Search for the relative path to the file in the config folder, taking into account
// various common starting points.
- if configFile := fileutils.FindFile(filepath.Join("config", path)); configFile != "" {
+ if configFile := fileutils.FindFile(filepath.Join("${SYSCONFDIR}/mattermost", path)); configFile != "" {
return configFile, nil
}

View File

@ -0,0 +1,16 @@
Index: utils/fileutils/fileutils.go
--- utils/fileutils/fileutils.go.orig
+++ utils/fileutils/fileutils.go
@@ -10,11 +10,7 @@ import (
func CommonBaseSearchPaths() []string {
paths := []string{
- ".",
- "..",
- "../..",
- "../../..",
- "../../../..",
+ "${PREFIX}/share/mattermost",
}
// this enables the server to be used in tests from a different repository

View File

@ -0,0 +1,4 @@
/DESCR/1.2/Mon Oct 17 15:14:28 2022//
/PLIST/1.56/Mon Oct 17 15:14:28 2022//
/mattermost.rc/1.4/Mon Oct 17 15:14:28 2022//
D

View File

@ -0,0 +1 @@
ports/net/mattermost-server/pkg

View File

@ -0,0 +1,2 @@
Mattermost is an open source, private cloud, Slack-alternative.
It's written in Golang and React and runs as a single binary.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,11 @@
#!/bin/ksh
daemon="${TRUEPREFIX}/bin/mattermost"
daemon_user="_mattermost"
. /etc/rc.d/rc.subr
rc_bg=YES
rc_reload=NO
rc_cmd $1