Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilander committed Aug 23, 2016
1 parent 3433e42 commit ea979ef
Show file tree
Hide file tree
Showing 9 changed files with 293 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.swp
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: ./run.sh
37 changes: 37 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "Mattermost",
"description": "Mattermost running on Heroku",
"repository": "https://github.com/mattermost/platform",
"keywords": ["mattermost"],
"success_url": "/",
"env": {
"BUILDPACK_URL": "http://github.com/kr/heroku-buildpack-inline.git",
"MATTERMOST_DOWNLOAD_URI": {
"description": "The URI to the compiled Mattermost binary you would like to run. Defaults to latest release. See https://www.mattermost.org/download/ for download links.",
"required": true,
"value": "https://releases.mattermost.com/3.3.0/mattermost-enterprise-3.3.0-linux-amd64.tar.gz"
},
"FILE_SETTINGS__DRIVER_NAME": {
"description": "The type of file storage to use. Must be local or amazons3. WARNING: If local, files will be periodically wiped when the dyno restarts. Only use local for temporary preview instances.",
"value": "local"
},
"FILE_SETTINGS__AMAZON_S3_ACCESS_KEY_ID": {
"description": "The access key for your Amazon S3. Only required for driver name amazons3.",
"required": false,
"value": ""
},
"FILE_SETTINGS__AMAZON_S3_SECRET_ACCESS_KEY": {
"description": "The secret access key for your Amazon S3. Only required for driver name amazons3.",
"required": false,
"value": ""
},
"FILE_SETTINGS__AMAZON_S3_BUCKET": {
"description": "The name you selected for your S3 bucket in AWS. Only required for driver name amazons3.",
"required": false,
"value": ""
},
"FILE_SETTINGS__AMAZON_S3_REGION": {
"description": "The AWS region you selected when creating your S3 bucket. Refer to AWS Reference Documentation (http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) and choose this variable from the Region column.",
"value": "us-east-1"
}
}
12 changes: 12 additions & 0 deletions bin/compile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -e

BUILD_DIR=$1
CACHE_DIR=$2
ENV_DIR=$3
DOWNLOAD_URI=$(cat ${ENV_DIR}/MATTERMOST_DOWNLOAD_URI)

echo "-----> Retrieving mattermost tar from ${DOWNLOAD_URI}"
curl -s -L "${DOWNLOAD_URI}" | tar -zxf - --strip-components=1 -C ${BUILD_DIR}
mkdir data/
5 changes: 5 additions & 0 deletions bin/detect
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

echo "Mattermost"

exit 0
7 changes: 7 additions & 0 deletions bin/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

cat << EOF
---
addons:
- heroku-postgresql:hobby-dev
EOF
223 changes: 223 additions & 0 deletions config/config-heroku-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
{
"ServiceSettings": {
"SiteURL": "",
"ListenAddress": "0.0.0.0:${PORT}",
"MaximumLoginAttempts": 10,
"SegmentDeveloperKey": "",
"GoogleDeveloperKey": "",
"EnableOAuthServiceProvider": false,
"EnableIncomingWebhooks": true,
"EnableOutgoingWebhooks": true,
"EnableCommands": true,
"EnableOnlyAdminIntegrations": true,
"EnablePostUsernameOverride": false,
"EnablePostIconOverride": false,
"EnableTesting": false,
"EnableDeveloper": false,
"EnableSecurityFixAlert": true,
"EnableInsecureOutgoingConnections": false,
"EnableMultifactorAuthentication": false,
"AllowCorsFrom": "",
"SessionLengthWebInDays": 30,
"SessionLengthMobileInDays": 30,
"SessionLengthSSOInDays": 30,
"SessionCacheInMinutes": 10,
"WebsocketSecurePort": 443,
"WebsocketPort": 80,
"WebserverMode": "gzip",
"EnableCustomEmoji": false,
"RestrictCustomEmojiCreation": "all"
},
"TeamSettings": {
"SiteName": "Mattermost",
"MaxUsersPerTeam": 50,
"EnableTeamCreation": true,
"EnableUserCreation": true,
"EnableOpenServer": false,
"RestrictCreationToDomains": "",
"RestrictTeamNames": true,
"EnableCustomBrand": false,
"CustomBrandText": "",
"CustomDescriptionText": "",
"RestrictDirectMessage": "any",
"RestrictTeamInvite": "all",
"RestrictPublicChannelManagement": "all",
"RestrictPrivateChannelManagement": "all",
"UserStatusAwayTimeout": 300
},
"SqlSettings": {
"DriverName": "postgres",
"DataSource": "${DATABASE_URL}",
"DataSourceReplicas": [],
"MaxIdleConns": 10,
"MaxOpenConns": 10,
"Trace": false,
"AtRestEncryptKey": "7rAh6iwQCkV4cA1Gsg3fgGOXJAQ43QVg"
},
"LogSettings": {
"EnableConsole": true,
"ConsoleLevel": "DEBUG",
"EnableFile": true,
"FileLevel": "INFO",
"FileFormat": "",
"FileLocation": "",
"EnableWebhookDebugging": true
},
"PasswordSettings": {
"MinimumLength": 5,
"Lowercase": false,
"Number": false,
"Uppercase": false,
"Symbol": false
},
"FileSettings": {
"MaxFileSize": 52428800,
"DriverName": "local",
"Directory": "./data/",
"EnablePublicLink": false,
"PublicLinkSalt": "A705AklYF8MFDOfcwh3I488G8vtLlVip",
"ThumbnailWidth": 120,
"ThumbnailHeight": 100,
"PreviewWidth": 1024,
"PreviewHeight": 0,
"ProfileWidth": 128,
"ProfileHeight": 128,
"InitialFont": "luximbi.ttf",
"AmazonS3AccessKeyId": "${FILE_SETTINGS__AMAZON_S3_ACCESS_KEY_ID}",
"AmazonS3SecretAccessKey": "${FILE_SETTINGS__AMAZON_S3_SECRET_ACCESS_KEY}",
"AmazonS3Bucket": "${FILE_SETTINGS__AMAZON_S3_BUCKET}",
"AmazonS3Region": "${FILE_SETTINGS__AMAZON_S3_REGION}",
"AmazonS3Endpoint": "",
"AmazonS3BucketEndpoint": "",
"AmazonS3LocationConstraint": false,
"AmazonS3LowercaseBucket": false
},
"EmailSettings": {
"EnableSignUpWithEmail": true,
"EnableSignInWithEmail": true,
"EnableSignInWithUsername": true,
"SendEmailNotifications": false,
"RequireEmailVerification": false,
"FeedbackName": "",
"FeedbackEmail": "",
"FeedbackOrganization": "",
"SMTPUsername": "",
"SMTPPassword": "",
"SMTPServer": "",
"SMTPPort": "",
"ConnectionSecurity": "",
"InviteSalt": "bjlSR4QqkXFBr7TP4oDzlfZmcNuH9YoS",
"PasswordResetSalt": "vZ4DcKyVVRlKHHJpexcuXzojkE5PZ5eL",
"SendPushNotifications": false,
"PushNotificationServer": "",
"PushNotificationContents": "generic",
"EnableEmailBatching": false,
"EmailBatchingBufferSize": 256,
"EmailBatchingInterval": 30
},
"RateLimitSettings": {
"EnableRateLimiter": true,
"PerSec": 10,
"MemoryStoreSize": 10000,
"VaryByRemoteAddr": true,
"VaryByHeader": ""
},
"PrivacySettings": {
"ShowEmailAddress": true,
"ShowFullName": true
},
"SupportSettings": {
"TermsOfServiceLink": "https://about.mattermost.com/default-terms/",
"PrivacyPolicyLink": "https://about.mattermost.com/default-privacy-policy/",
"AboutLink": "https://about.mattermost.com/default-about/",
"HelpLink": "https://about.mattermost.com/default-help/",
"ReportAProblemLink": "https://about.mattermost.com/default-report-a-problem/",
"SupportEmail": "[email protected]"
},
"GitLabSettings": {
"Enable": false,
"Secret": "",
"Id": "",
"Scope": "",
"AuthEndpoint": "",
"TokenEndpoint": "",
"UserApiEndpoint": ""
},
"GoogleSettings": {
"Enable": false,
"Secret": "",
"Id": "",
"Scope": "profile email",
"AuthEndpoint": "https://accounts.google.com/o/oauth2/v2/auth",
"TokenEndpoint": "https://www.googleapis.com/oauth2/v4/token",
"UserApiEndpoint": "https://www.googleapis.com/plus/v1/people/me"
},
"Office365Settings": {
"Enable": false,
"Secret": "",
"Id": "",
"Scope": "User.Read",
"AuthEndpoint": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
"TokenEndpoint": "https://login.microsoftonline.com/common/oauth2/v2.0/token",
"UserApiEndpoint": "https://graph.microsoft.com/v1.0/me"
},
"LdapSettings": {
"Enable": false,
"LdapServer": "",
"LdapPort": 389,
"ConnectionSecurity": "",
"BaseDN": "",
"BindUsername": "",
"BindPassword": "",
"UserFilter": "",
"FirstNameAttribute": "",
"LastNameAttribute": "",
"EmailAttribute": "",
"UsernameAttribute": "",
"NicknameAttribute": "",
"IdAttribute": "",
"SyncIntervalMinutes": 60,
"SkipCertificateVerification": false,
"QueryTimeout": 60,
"MaxPageSize": 0,
"LoginFieldName": ""
},
"ComplianceSettings": {
"Enable": false,
"Directory": "./data/",
"EnableDaily": false
},
"LocalizationSettings": {
"DefaultServerLocale": "en",
"DefaultClientLocale": "en",
"AvailableLocales": ""
},
"SamlSettings": {
"Enable": false,
"Verify": false,
"Encrypt": false,
"IdpUrl": "",
"IdpDescriptorUrl": "",
"AssertionConsumerServiceURL": "",
"IdpCertificateFile": "",
"PublicCertificateFile": "",
"PrivateKeyFile": "",
"FirstNameAttribute": "",
"LastNameAttribute": "",
"EmailAttribute": "",
"UsernameAttribute": "",
"NicknameAttribute": "",
"LocaleAttribute": "",
"LoginButtonText": "With SAML"
},
"NativeAppSettings": {
"AppDownloadLink": "https://about.mattermost.com/downloads/",
"AndroidAppDownloadLink": "https://about.mattermost.com/mattermost-android-app/",
"IosAppDownloadLink": "https://about.mattermost.com/mattermost-ios-app/"
},
"ClusterSettings": {
"Enable": false,
"InterNodeListenAddress": ":8075",
"InterNodeUrls": []
}
}
Binary file added lib/envsubst
Binary file not shown.
7 changes: 7 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export FILE_SETTINGS__AMAZON_S3_ACCESS_KEY_ID=${FILE_SETTINGS__AMAZON_S3_ACCESS_KEY_ID:=""}
export FILE_SETTINGS__AMAZON_S3_SECRET_ACCESS_KEY=${FILE_SETTINGS__AMAZON_S3_SECRET_ACCESS_KEY:=""}
export FILE_SETTINGS__AMAZON_S3_BUCKET=${FILE_SETTINGS__AMAZON_S3_BUCKET:=""}

lib/envsubst < config/config-heroku-template.json > config/config-heroku.json

bin/platform -config=config/config-heroku.json

0 comments on commit ea979ef

Please sign in to comment.