From 348e931a20ea676d9a464256e6ad851440d5101a Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 28 Sep 2015 07:55:59 -0400 Subject: [PATCH 01/32] Updating dockerfiles and version.go --- docker/0.5/Dockerfile | 100 -------------- docker/0.5/Dockerrun.aws.json | 13 -- docker/0.5/docker-entry.sh | 122 ------------------ docker/0.5/main.cf | 28 ---- docker/0.6/Dockerrun.aws.zip | Bin 867 -> 0 bytes docker/0.6/config_docker.json | 99 -------------- docker/{0.6 => 1.0}/Dockerfile | 8 +- docker/1.0/Dockerrun.aws.zip | Bin 0 -> 1107 bytes .../.ebextensions/01_files.config | 0 .../Dockerrun.aws/Dockerrun.aws.json | 2 +- docker/1.0/config_docker.json | 89 +++++++++++++ docker/{0.6 => 1.0}/docker-entry.sh | 0 model/version.go | 2 +- 13 files changed, 94 insertions(+), 369 deletions(-) delete mode 100644 docker/0.5/Dockerfile delete mode 100755 docker/0.5/Dockerrun.aws.json delete mode 100755 docker/0.5/docker-entry.sh delete mode 100644 docker/0.5/main.cf delete mode 100644 docker/0.6/Dockerrun.aws.zip delete mode 100644 docker/0.6/config_docker.json rename docker/{0.6 => 1.0}/Dockerfile (80%) create mode 100644 docker/1.0/Dockerrun.aws.zip rename docker/{0.6 => 1.0}/Dockerrun.aws/.ebextensions/01_files.config (100%) rename docker/{0.6 => 1.0}/Dockerrun.aws/Dockerrun.aws.json (75%) create mode 100644 docker/1.0/config_docker.json rename docker/{0.6 => 1.0}/docker-entry.sh (100%) diff --git a/docker/0.5/Dockerfile b/docker/0.5/Dockerfile deleted file mode 100644 index fec69280e0..0000000000 --- a/docker/0.5/Dockerfile +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. -# See License.txt for license information. -FROM ubuntu:14.04 - -# Install Dependancies -RUN apt-get update && apt-get install -y build-essential -RUN apt-get install -y curl -RUN curl -sL https://deb.nodesource.com/setup | bash - -RUN apt-get install -y nodejs -RUN apt-get install -y ruby-full -RUN gem install compass - -# Postfix -RUN apt-get install -y postfix - -# -# Install GO -# - -RUN apt-get update && apt-get install -y \ - gcc libc6-dev make git mercurial \ - --no-install-recommends \ - && rm -rf /var/lib/apt/lists/* - -ENV GOLANG_VERSION 1.4.2 - -RUN curl -sSL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz \ - | tar -v -C /usr/src -xz - -RUN cd /usr/src/go/src && ./make.bash --no-clean 2>&1 - -ENV PATH /usr/src/go/bin:$PATH - -RUN mkdir -p /go/src /go/bin && chmod -R 777 /go -ENV GOPATH /go -ENV PATH /go/bin:$PATH -WORKDIR /go - -# --------------------------------------------------------------------------------------------------------------------- - -# -# Install SQL -# - -ENV MYSQL_ROOT_PASSWORD=mostest -ENV MYSQL_USER=mmuser -ENV MYSQL_PASSWORD=mostest -ENV MYSQL_DATABASE=mattermost_test - -RUN groupadd -r mysql && useradd -r -g mysql mysql - -RUN apt-get update && apt-get install -y perl --no-install-recommends && rm -rf /var/lib/apt/lists/* - -RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5 - -ENV MYSQL_MAJOR 5.6 -ENV MYSQL_VERSION 5.6.25 - -RUN echo "deb http://repo.mysql.com/apt/debian/ wheezy mysql-${MYSQL_MAJOR}" > /etc/apt/sources.list.d/mysql.list - -RUN apt-get update \ - && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install mysql-server \ - && rm -rf /var/lib/apt/lists/* \ - && rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql - -RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/my.cnf - -VOLUME /var/lib/mysql -# --------------------------------------------------------------------------------------------------------------------- - -# -# Install Redis -# - -RUN apt-get update && apt-get install -y wget -RUN wget http://download.redis.io/redis-stable.tar.gz; \ - tar xvzf redis-stable.tar.gz; \ - cd redis-stable; \ - make install - -# --------------------------------------------------------------------------------------------------------------------- - -# Copy over files -ADD https://github.com/mattermost/platform/archive/v0.50.tar.gz /go/src/github.com/mattermost/ -RUN mkdir /go/src/github.com/mattermost/platform && tar -zxvf /go/src/github.com/mattermost/v0.50.tar.gz -C /go/src/github.com/mattermost/platform --strip-components=1 - -# Insert postfix config -ADD ./main.cf /etc/postfix/ - -RUN go get github.com/tools/godep -RUN cd /go/src/github.com/mattermost/platform; godep restore -RUN go install github.com/mattermost/platform -RUN cd /go/src/github.com/mattermost/platform/web/react; npm install - -RUN chmod +x /go/src/github.com/mattermost/platform/docker/docker-entry.sh -ENTRYPOINT /go/src/github.com/mattermost/platform/docker/docker-entry.sh - -# Ports -EXPOSE 80 diff --git a/docker/0.5/Dockerrun.aws.json b/docker/0.5/Dockerrun.aws.json deleted file mode 100755 index 04c7f42247..0000000000 --- a/docker/0.5/Dockerrun.aws.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "AWSEBDockerrunVersion": "1", - "Image": { - "Name": "mattermost/platform:helium", - "Update": "true" - }, - "Ports": [ - { - "ContainerPort": "80" - } - ], - "Logging": "/var/log/" -} diff --git a/docker/0.5/docker-entry.sh b/docker/0.5/docker-entry.sh deleted file mode 100755 index cfa589041f..0000000000 --- a/docker/0.5/docker-entry.sh +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/bash -# Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. -# See License.txt for license information. - -mkdir -p web/static/js - -echo "127.0.0.1 dockerhost" >> /etc/hosts -/etc/init.d/networking restart - -echo configuring mysql - -# SQL!!! -set -e - -get_option () { - local section=$1 - local option=$2 - local default=$3 - ret=$(my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) - [ -z $ret ] && ret=$default - echo $ret -} - - -# Get config -DATADIR="$("mysqld" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" -SOCKET=$(get_option mysqld socket "$DATADIR/mysql.sock") -PIDFILE=$(get_option mysqld pid-file "/var/run/mysqld/mysqld.pid") - -if [ ! -d "$DATADIR/mysql" ]; then - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" ]; then - echo >&2 'error: database is uninitialized and MYSQL_ROOT_PASSWORD not set' - echo >&2 ' Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?' - exit 1 - fi - - mkdir -p "$DATADIR" - chown -R mysql:mysql "$DATADIR" - - echo 'Running mysql_install_db' - mysql_install_db --user=mysql --datadir="$DATADIR" --rpm --keep-my-cnf - echo 'Finished mysql_install_db' - - mysqld --user=mysql --datadir="$DATADIR" --skip-networking & - for i in $(seq 30 -1 0); do - [ -S "$SOCKET" ] && break - echo 'MySQL init process in progress...' - sleep 1 - done - if [ $i = 0 ]; then - echo >&2 'MySQL init process failed.' - exit 1 - fi - - # These statements _must_ be on individual lines, and _must_ end with - # semicolons (no line breaks or comments are permitted). - # TODO proper SQL escaping on ALL the things D: - - tempSqlFile=$(mktemp /tmp/mysql-first-time.XXXXXX.sql) - cat > "$tempSqlFile" <<-EOSQL - -- What's done in this file shouldn't be replicated - -- or products like mysql-fabric won't work - SET @@SESSION.SQL_LOG_BIN=0; - - DELETE FROM mysql.user ; - CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; - GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; - DROP DATABASE IF EXISTS test ; - EOSQL - - if [ "$MYSQL_DATABASE" ]; then - echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" >> "$tempSqlFile" - fi - - if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then - echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" >> "$tempSqlFile" - - if [ "$MYSQL_DATABASE" ]; then - echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" >> "$tempSqlFile" - fi - fi - - echo 'FLUSH PRIVILEGES ;' >> "$tempSqlFile" - - mysql -uroot < "$tempSqlFile" - - rm -f "$tempSqlFile" - kill $(cat $PIDFILE) - for i in $(seq 30 -1 0); do - [ -f "$PIDFILE" ] || break - echo 'MySQL init process in progress...' - sleep 1 - done - if [ $i = 0 ]; then - echo >&2 'MySQL hangs during init process.' - exit 1 - fi - echo 'MySQL init process done. Ready for start up.' -fi - -chown -R mysql:mysql "$DATADIR" - -mysqld & - -sleep 5 - -# ------------------------ - -echo starting postfix -/etc/init.d/postfix restart - -echo starting redis -redis-server & - -echo starting react processor -cd /go/src/github.com/mattermost/platform/web/react && npm start & - -echo starting go web server -cd /go/src/github.com/mattermost/platform/; go run mattermost.go -config=config_docker.json & - -echo starting compass watch -cd /go/src/github.com/mattermost/platform/web/sass-files && compass watch diff --git a/docker/0.5/main.cf b/docker/0.5/main.cf deleted file mode 100644 index ed97d37efd..0000000000 --- a/docker/0.5/main.cf +++ /dev/null @@ -1,28 +0,0 @@ -myorigin = mattermost.com -myhostname = mattermost.com - -smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) -biff = no - -append_dot_mydomain = no - -readme_directory = no - -# TLS parameters -smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem -smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key -smtpd_use_tls=no -smtp_use_tls=no -smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache -smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache - -smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination -alias_maps = hash:/etc/aliases -alias_database = hash:/etc/aliases -mydestination = localhost, localhost.localdomain, localhost -relayhost = -mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 -mailbox_size_limit = 0 -recipient_delimiter = + -inet_interfaces = all -inet_protocols = all diff --git a/docker/0.6/Dockerrun.aws.zip b/docker/0.6/Dockerrun.aws.zip deleted file mode 100644 index 342c1549a6edd0e4b24586835f7e44c82103d51b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 867 zcmWIWW@h1H0D-rD67FCIl;C5KVbDuWO06hK%`48#&nwms4dG;9uJyScdKHLEE4UdL zS-vtdFtCUKbp!y-0nr>_bNGCHj_d~VqJh$~80Hul#;0ZGq!#NX=jWwmro)ZhhiUBA zbAefh4S3ide4poZdY*KvlSE4T4auhD)t#N%lBY8#Upjn!Y2pTEAAP6!EkDlNO(xwr48b6f&9$oWSA@B9o`<%C)J+D5mY^cn-_~z|Ko@}$kW1cBtCWcmBj%GcJByE4k zy#AuEX>VU}v86d(W#6HMl3#awFRr*JBf~qvR#to|i{G1=TMs!AA!6*n=e}QWm-!4} zh+G0tz+^=YfOa64SZR;FF67bk!EPV4Na+ZHjn zvT@JoJ#=vK=8Z2*kJdP?7qsb$_;#f$Gi%DE8{$7}W` / RUN apt-get update \ && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install mysql-server \ + && apt-get -y install perl wget mysql-server \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql @@ -36,8 +34,8 @@ VOLUME /var/lib/mysql WORKDIR /mattermost # Copy over files -ADD https://github.com/mattermost/platform/releases/download/v0.6.0/mattermost.tar.gz / -RUN tar -zxvf /mattermost.tar.gz --strip-components=1 +ADD https://github.com/mattermost/platform/releases/download/v1.0.0-rc1/mattermost.tar.gz / +RUN tar -zxvf /mattermost.tar.gz --strip-components=1 && rm /mattermost.tar.gz ADD config_docker.json / ADD docker-entry.sh / diff --git a/docker/1.0/Dockerrun.aws.zip b/docker/1.0/Dockerrun.aws.zip new file mode 100644 index 0000000000000000000000000000000000000000..3c0f9fdbee5619c951111b64eee02cecd0f9f03f GIT binary patch literal 1107 zcmWIWW@h1H00B2!8+R}RO7JnrFu3F=XQvhwmFDRsmKW=XhHx@4Pgds)1L4vNZU#n{ z7t9O{EGa-80dR8+ZBWgT!7xWJH7T{CBsH%%Gd~Y%YOgA17zkrARRm}{2Ls4dK3|_B zyMerDMg|6L0;U=m#;0ZGq!#NX=jWwmrh}ahvf!;6h9z6i1!f&K;9-04eV)_ldD5*; z5-I67B%6{~cXnz^p3aG1WXi5r-G^quCn{5Wqnp^RN4R57*NrYi0t*Zk~u!;`zN zu3uPnpCRT*AbaR#lla`|w;JZlt~d&v+}-0j?T7oR={|F;E8YZX{80LPbj@Fdyw_Ln zbKZLPy!yPdp)%{@o3|Tzvdt2Yd8UM!7+Q5Xn)NJ_wEZ3P`is7%y?w#OmgaPoeTNcC ze%&$1IwX8rfZ_9P)AiaJ!0@>Q#0nVUgA$i|S;hHz z;6Tv;1_+iw(e2sIb;v=$wfbN^M{xJ-l1b;>xg1>twhDARURRxQmveHb?}`1^v$smU zvweQfV1BCPn*8Tkn-@PnZuI?O*3Q+M4l^AYyFG7ImxOgIs-1QJV%X#^czT|dVQ%v$ zwQs2#&s_G}>;2nlrq9EBPC3WFe00&7+f;4zzh5**ljGXKB9li&Q=OZVZTd~@Clr?! zOq{L1Df5Kn)sUZz0p5&Ea?H3=tOU^KARxf-))7Rb_!*dfSt02cBb6b{#7w=&W_nHZXyB086q+jQ{`u literal 0 HcmV?d00001 diff --git a/docker/0.6/Dockerrun.aws/.ebextensions/01_files.config b/docker/1.0/Dockerrun.aws/.ebextensions/01_files.config similarity index 100% rename from docker/0.6/Dockerrun.aws/.ebextensions/01_files.config rename to docker/1.0/Dockerrun.aws/.ebextensions/01_files.config diff --git a/docker/0.6/Dockerrun.aws/Dockerrun.aws.json b/docker/1.0/Dockerrun.aws/Dockerrun.aws.json similarity index 75% rename from docker/0.6/Dockerrun.aws/Dockerrun.aws.json rename to docker/1.0/Dockerrun.aws/Dockerrun.aws.json index f6f7cf726a..9fdded15e5 100755 --- a/docker/0.6/Dockerrun.aws/Dockerrun.aws.json +++ b/docker/1.0/Dockerrun.aws/Dockerrun.aws.json @@ -1,7 +1,7 @@ { "AWSEBDockerrunVersion": "1", "Image": { - "Name": "mattermost/platform:0.6", + "Name": "mattermost/platform:1.0", "Update": "true" }, "Ports": [ diff --git a/docker/1.0/config_docker.json b/docker/1.0/config_docker.json new file mode 100644 index 0000000000..06fee9bd5c --- /dev/null +++ b/docker/1.0/config_docker.json @@ -0,0 +1,89 @@ +{ + "ServiceSettings": { + "ListenAddress": ":80", + "MaximumLoginAttempts": 10, + "SegmentDeveloperKey": "", + "GoogleDeveloperKey": "", + "EnableOAuthServiceProvider": false, + "EnableIncomingWebhooks": false, + "EnableTesting": false + }, + "TeamSettings": { + "SiteName": "Mattermost", + "MaxUsersPerTeam": 50, + "EnableTeamCreation": true, + "EnableUserCreation": true, + "RestrictCreationToDomains": "" + }, + "SqlSettings": { + "DriverName": "mysql", + "DataSource": "mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8", + "DataSourceReplicas": [], + "MaxIdleConns": 10, + "MaxOpenConns": 10, + "Trace": false, + "AtRestEncryptKey": "7rAh6iwQCkV4cA1Gsg3fgGOXJAQ43QV" + }, + "LogSettings": { + "EnableConsole": false, + "ConsoleLevel": "INFO", + "EnableFile": true, + "FileLevel": "INFO", + "FileFormat": "", + "FileLocation": "" + }, + "FileSettings": { + "DriverName": "local", + "Directory": "/mattermost/data/", + "EnablePublicLink": true, + "PublicLinkSalt": "LhaAWC6lYEKHTkBKsvyXNIOfUIT37AX", + "ThumbnailWidth": 120, + "ThumbnailHeight": 100, + "PreviewWidth": 1024, + "PreviewHeight": 0, + "ProfileWidth": 128, + "ProfileHeight": 128, + "InitialFont": "luximbi.ttf", + "AmazonS3AccessKeyId": "", + "AmazonS3SecretAccessKey": "", + "AmazonS3Bucket": "", + "AmazonS3Region": "" + }, + "EmailSettings": { + "EnableSignUpWithEmail": true, + "SendEmailNotifications": false, + "RequireEmailVerification": false, + "FeedbackName": "", + "FeedbackEmail": "", + "SMTPUsername": "", + "SMTPPassword": "", + "SMTPServer": "", + "SMTPPort": "", + "ConnectionSecurity": "", + "InviteSalt": "bjlSR4QqkXFBr7TP4oDzlfZmcNuH9Yo", + "PasswordResetSalt": "vZ4DcKyVVRlKHHJpexcuXzojkE5PZ5e", + "ApplePushServer": "", + "ApplePushCertPublic": "", + "ApplePushCertPrivate": "" + }, + "RateLimitSettings": { + "EnableRateLimiter": true, + "PerSec": 10, + "MemoryStoreSize": 10000, + "VaryByRemoteAddr": true, + "VaryByHeader": "" + }, + "PrivacySettings": { + "ShowEmailAddress": true, + "ShowFullName": true + }, + "GitLabSettings": { + "Enable": false, + "Secret": "", + "Id": "", + "Scope": "", + "AuthEndpoint": "", + "TokenEndpoint": "", + "UserApiEndpoint": "" + } +} \ No newline at end of file diff --git a/docker/0.6/docker-entry.sh b/docker/1.0/docker-entry.sh similarity index 100% rename from docker/0.6/docker-entry.sh rename to docker/1.0/docker-entry.sh diff --git a/model/version.go b/model/version.go index 8f0c76ebe2..233fc37476 100644 --- a/model/version.go +++ b/model/version.go @@ -12,7 +12,7 @@ import ( // It should be maitained in chronological order with most current // release at the front of the list. var versions = []string{ - "0.8.0", + "1.0.0", "0.7.1", "0.7.0", "0.6.0", From ce74afd9edc8bc1aec7cd168e7d7388c1f0bf67e Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 28 Sep 2015 08:05:40 -0400 Subject: [PATCH 02/32] Fixing version unit test --- model/version_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/version_test.go b/model/version_test.go index da40006be5..24dbedaa6a 100644 --- a/model/version_test.go +++ b/model/version_test.go @@ -36,7 +36,7 @@ func TestSplitVersion(t *testing.T) { } func TestGetPreviousVersion(t *testing.T) { - if major, minor := GetPreviousVersion("0.8.0"); major != 0 || minor != 7 { + if major, minor := GetPreviousVersion("1.0.0"); major != 0 || minor != 7 { t.Fatal(major, minor) } From 8b698523642da4fe8925c40c74c0f084e5d2cb43 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 28 Sep 2015 08:38:53 -0400 Subject: [PATCH 03/32] Fixing Dockerrun.aws.zip file --- docker/1.0/Dockerrun.aws.zip | Bin 1107 -> 711 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/docker/1.0/Dockerrun.aws.zip b/docker/1.0/Dockerrun.aws.zip index 3c0f9fdbee5619c951111b64eee02cecd0f9f03f..8c2c16e10802d050a41a4a3846ad9ed5834d4df7 100644 GIT binary patch delta 126 zcmcc2ah!GXK1L}PAqE+S$*&ksOk5zrA`4_sJoQb7kx7nOgn@y9gQ3O7#{Ju->$Nk0 zyh}hV#2^7A85kIW_-!MIHCdQNXL1I!l#ncv)RM+0K&gqR3wmY8hM!p6tMz{Ic{ KDE1AclK}vJ%Np4L delta 506 zcmX@kdYPj>z?+$civa}OY;D}Z3@E|JAj9C2pPZdqR8*R$msnn`9~#2Rz&u%k)0@a9cwm@-1bT{LN#i^Woj`w?PYz(> xGH3w?!M9DMMv@c>NaX(|8! From 209c2a02703d39e9abb8d478fa48a7ae4b46f4a1 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Mon, 28 Sep 2015 11:05:51 -0400 Subject: [PATCH 04/32] Update Mac developer setup to use Docker Toolbox --- doc/install/dev-setup.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/install/dev-setup.md b/doc/install/dev-setup.md index b90b6a3511..c63bde5129 100644 --- a/doc/install/dev-setup.md +++ b/doc/install/dev-setup.md @@ -3,13 +3,14 @@ Developer Machine Setup ### Mac OS X ### -1. Download and set up Boot2Docker +1. Download and set up Docker Toolbox 1. Follow the instructions at http://docs.docker.com/installation/mac/ - 1. Use the Boot2Docker command-line utility - 2. If you do command-line setup use: `boot2docker init eval “$(boot2docker shellinit)”` - 2. Get your Docker IP address with `boot2docker ip` + 2. Start a new docker host + `docker-machine create -d virtualbox dev` + 2. Get the IP address of your docker host + `docker-machine ip dev` 3. Add a line to your /etc/hosts that goes ` dockerhost` - 4. Run `boot2docker shellinit` and copy the export statements to your ~/.bash_profile + 4. Run `docker-machine env dev` and copy the export statements to your ~/.bash_profile 2. Download Go (version 1.4.2) from http://golang.org/dl/ 3. Set up your Go workspace 1. `mkdir ~/go` From dffa56d4b44a4a2508103491cb889eb21c66411c Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Mon, 28 Sep 2015 13:10:14 -0400 Subject: [PATCH 05/32] Fix images in welcome email. --- api/user.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/user.go b/api/user.go index 9ed4404f14..92a77e68a4 100644 --- a/api/user.go +++ b/api/user.go @@ -198,7 +198,7 @@ func CreateUser(c *Context, team *model.Team, user *model.User) *model.User { l4g.Error("Encountered an issue joining default channels user_id=%s, team_id=%s, err=%v", ruser.Id, ruser.TeamId, err) } - fireAndForgetWelcomeEmail(ruser.Email, team.DisplayName, c.GetTeamURLFromTeam(team)) + fireAndForgetWelcomeEmail(ruser.Email, team.DisplayName, c.GetSiteURL(), c.GetTeamURLFromTeam(team)) if user.EmailVerified { if cresult := <-Srv.Store.User().VerifyEmail(ruser.Id); cresult.Err != nil { l4g.Error("Failed to set email verified err=%v", cresult.Err) @@ -218,12 +218,13 @@ func CreateUser(c *Context, team *model.Team, user *model.User) *model.User { } } -func fireAndForgetWelcomeEmail(email, teamDisplayName, teamURL string) { +func fireAndForgetWelcomeEmail(email, teamDisplayName, siteURL, teamURL string) { go func() { subjectPage := NewServerTemplatePage("welcome_subject") subjectPage.Props["TeamDisplayName"] = teamDisplayName bodyPage := NewServerTemplatePage("welcome_body") + bodyPage.Props["SiteURL"] = siteURL bodyPage.Props["TeamURL"] = teamURL if err := utils.SendMail(email, subjectPage.Render(), bodyPage.Render()); err != nil { From 7110aa42d9b0110de6375681aa83edb06dad2645 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Mon, 28 Sep 2015 11:10:18 -0700 Subject: [PATCH 06/32] Fixing gitlab settings in admin console --- .../admin_console/gitlab_settings.jsx | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/web/react/components/admin_console/gitlab_settings.jsx b/web/react/components/admin_console/gitlab_settings.jsx index 1e10c55921..eaea15b8ff 100644 --- a/web/react/components/admin_console/gitlab_settings.jsx +++ b/web/react/components/admin_console/gitlab_settings.jsx @@ -12,7 +12,7 @@ export default class GitLabSettings extends React.Component { this.handleSubmit = this.handleSubmit.bind(this); this.state = { - Allow: this.props.config.GitLabSettings.Allow, + Enable: this.props.config.GitLabSettings.Enable, saveNeeded: false, serverError: null }; @@ -21,12 +21,12 @@ export default class GitLabSettings extends React.Component { handleChange(action) { var s = {saveNeeded: true, serverError: this.state.serverError}; - if (action === 'AllowTrue') { - s.Allow = true; + if (action === 'EnableTrue') { + s.Enable = true; } - if (action === 'AllowFalse') { - s.Allow = false; + if (action === 'EnableFalse') { + s.Enable = false; } this.setState(s); @@ -37,7 +37,7 @@ export default class GitLabSettings extends React.Component { $('#save-button').button('loading'); var config = this.props.config; - config.GitLabSettings.Allow = React.findDOMNode(this.refs.Allow).checked; + config.GitLabSettings.Enable = React.findDOMNode(this.refs.Enable).checked; config.GitLabSettings.Secret = React.findDOMNode(this.refs.Secret).value.trim(); config.GitLabSettings.Id = React.findDOMNode(this.refs.Id).value.trim(); config.GitLabSettings.Scope = React.findDOMNode(this.refs.Scope).value.trim(); @@ -88,7 +88,7 @@ export default class GitLabSettings extends React.Component {
@@ -96,21 +96,21 @@ export default class GitLabSettings extends React.Component { @@ -134,7 +134,7 @@ export default class GitLabSettings extends React.Component { placeholder='Ex "jcuS8PuvcpGhpgHhlcpT1Mx42pnqMxQY"' defaultValue={this.props.config.GitLabSettings.Secret} onChange={this.handleChange} - disabled={!this.state.Allow} + disabled={!this.state.Enable} />

{'Obtain this value via the instructions above for logging into GitLab.'}

@@ -156,7 +156,7 @@ export default class GitLabSettings extends React.Component { placeholder='Ex "jcuS8PuvcpGhpgHhlcpT1Mx42pnqMxQY"' defaultValue={this.props.config.GitLabSettings.Id} onChange={this.handleChange} - disabled={!this.state.Allow} + disabled={!this.state.Enable} />

{'Obtain this value via the instructions above for logging into GitLab'}

@@ -178,7 +178,7 @@ export default class GitLabSettings extends React.Component { placeholder='Not currently used by GitLab. Please leave blank' defaultValue={this.props.config.GitLabSettings.Scope} onChange={this.handleChange} - disabled={!this.state.Allow} + disabled={!this.state.Enable} />

{'This field is not yet used by GitLab OAuth. Other OAuth providers may use this field to specify the scope of account data from OAuth provider that is sent to Mattermost.'}

@@ -200,7 +200,7 @@ export default class GitLabSettings extends React.Component { placeholder='Ex ""' defaultValue={this.props.config.GitLabSettings.AuthEndpoint} onChange={this.handleChange} - disabled={!this.state.Allow} + disabled={!this.state.Enable} />

{'Enter /oauth/authorize (example http://localhost:3000/oauth/authorize).'}

@@ -222,7 +222,7 @@ export default class GitLabSettings extends React.Component { placeholder='Ex ""' defaultValue={this.props.config.GitLabSettings.TokenEndpoint} onChange={this.handleChange} - disabled={!this.state.Allow} + disabled={!this.state.Enable} />

{'Enter /oauth/token.'}

@@ -244,7 +244,7 @@ export default class GitLabSettings extends React.Component { placeholder='Ex ""' defaultValue={this.props.config.GitLabSettings.UserApiEndpoint} onChange={this.handleChange} - disabled={!this.state.Allow} + disabled={!this.state.Enable} />

{'Enter /api/v3/user.'}

From fdc0851be58455417968b70a10a0d4829274d86a Mon Sep 17 00:00:00 2001 From: hmhealey Date: Mon, 28 Sep 2015 15:44:02 -0400 Subject: [PATCH 07/32] Changed mobile search bar to use the colour of the sidebar header --- web/react/utils/utils.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 61dcae6d8a..27b8ff0de0 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -580,6 +580,7 @@ export function applyTheme(theme) { changeCss('.sidebar--left .team__header, .sidebar--menu .team__header', 'background:' + theme.sidebarHeaderBg, 1); changeCss('.modal .modal-header', 'background:' + theme.sidebarHeaderBg, 1); changeCss('#navbar .navbar-default', 'background:' + theme.sidebarHeaderBg, 1); + changeCss('@media screen and (max-width: 768px) { .search-bar__container', 'background:' + theme.sidebarHeaderBg, 1); } if (theme.sidebarHeaderTextColor) { From 5b67abf34bccee1425b980675865319eb3c7602c Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Mon, 28 Sep 2015 14:58:14 -0700 Subject: [PATCH 08/32] Better parsing of the website's title when viewing a channel --- web/react/components/sidebar.jsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx index 14664ed4d5..6033f200f3 100644 --- a/web/react/components/sidebar.jsx +++ b/web/react/components/sidebar.jsx @@ -268,14 +268,19 @@ export default class Sidebar extends React.Component { } } updateTitle() { - var channel = ChannelStore.getCurrent(); + const channel = ChannelStore.getCurrent(); if (channel) { - if (channel.type === 'D') { - var teammateUsername = Utils.getDirectTeammate(channel.id).username; - document.title = teammateUsername + ' ' + document.title.substring(document.title.lastIndexOf('-')); - } else { - document.title = channel.display_name + ' ' + document.title.substring(document.title.lastIndexOf('-')); + let currentSiteName = ''; + if (global.window.config.SiteName != null) { + currentSiteName = global.window.config.SiteName; } + + let currentChannelName = channel.display_name; + if (channel.type === 'D') { + currentChannelName = Utils.getDirectTeammate(channel.id).username; + } + + document.title = currentChannelName + ' - ' + this.props.teamDisplayName + ' ' + currentSiteName; } } onScroll() { From 4bba2606385b3f2b69043f6c79e35fc1d7dbe168 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Mon, 28 Sep 2015 21:09:15 -0700 Subject: [PATCH 09/32] PLT-28 working on production setup doc --- doc/install/prod-ubuntu.md | 170 +++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 doc/install/prod-ubuntu.md diff --git a/doc/install/prod-ubuntu.md b/doc/install/prod-ubuntu.md new file mode 100644 index 0000000000..fb0466cd8b --- /dev/null +++ b/doc/install/prod-ubuntu.md @@ -0,0 +1,170 @@ +# Production Installation on Ubuntu 14.04 LTS + +## Install Ubuntu Server 14.04 LTS +1. Set up 3 machines with Ubuntu 14.04 with 2GB of RAM or more. The servers will be used for the Load Balancer, Mattermost, and Database. +1. Make sure the system is up to date with the most recent security patches. + * ```~$ sudo apt-get update``` + * ```~$ sudo apt-get upgrade``` + +## Setup Database Server +1. For the purposes of this guide we will assume this server has an IP address of 10.10.10.1 +1. Install PostgreSQL 9.3+ (or MySQL 5.2+) + * ```~$ sudo apt-get install postgresql postgresql-contrib``` +1. PostgreSQL created a user account called `postgres`. You will need to log into that account with: + * ```~$ sudo -i -u postgres``` +1. You can get a PostgreSQL prompt by typing: + * ```~$ psql``` +1. Create the Mattermost database by typing: + * ```postgres=# CREATE DATABASE mattermost;``` +1. Create the Mattermost user by typing: + * ```postgres=# CREATE USER mmuser WITH PASSWORD 'mmuser_password';``` +1. Grant the user access to the Mattermost database by typing: + * ```postgres=# GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;``` +1. You can exit out of PostgreSQL by typing: + * ```postgre=# \q``` +1. You can exit the postgres account by typing: + * ```~$ exit``` + +## Setup Mattermost Server +1. For the purposes of this guide we will assume this server has an IP address of 10.10.10.2 +1. Download the lastest Mattermost Server by typing: + * ```~$ wget https://github.com/mattermost/platform/releases/download/v1.0.0/mattermost.tar.gz``` +1. Unzip the Mattermost Server by typing: + * ```~$ tar -xvzf mattermost.tar.gz``` +1. For the sake of making this guide simple we located the files at `/home/ubuntu/mattermost`, in the future we will give guidance for storing under `/opt`. +1. We have also elected to run the Mattermost Server as the `ubuntu` account for simplicity. We recommend settings up and running the service under a `mattermost` user account with limited permissions. +1. Create the stoarge directory for files. We assume you will have attached a large drive for storage of images and files. For this setup we will assume the directory is located at `/mattermost/data`. + * Create the direcotry by typing: + * ```~$ sudo mkdir -p /mattermost/data``` + * Set the ubuntu account as the directory owner by typing: + * ```~$ sudo chown -R ubuntu /mattermost``` +1. Configure Mattermost Server by editing the config.json file at /home/ubuntu/mattermost/config` + * ```~$ cd ~/mattermost/config``` + * Edit the file by typing: + * ```~$ vi config.json``` + * replace `DriverName": "mysql"` with `DriverName": "postgres"` + * replace `"DataSource": "mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8"` with `"DataSource": "postgres://mmuser:mmuser_password@10.10.10.1:5432/mattermost?sslmode=disable&connect_timeout=10"` + * Optionally you may continue to edit configuration settings in `config.json` or use the System Console described in a later section to finish the configuration. +1. Test the Mattermost Server + * ```~$ cd ~/mattermost/bin``` + * Run the Mattermost Server by typing: + * ```~$ ./platform``` + * You should see a console log like `Server is listening on :8065` letting you know the service is running. + * Stop the server for now by typing `ctrl-c` +1. Setup Mattermost to use the Ubuntu Upstart daemon which handles supervision of the Mattermost process. + * ```~$ sudo touch /etc/init/mattermost.conf``` + * ```~$ sudo vi /etc/init/mattermost.conf``` + * Copy the following lines into `/etc/init/mattermost.conf` + * ```start on runlevel [2345] + stop on runlevel [016] + respawn + chdir /home/ubuntu/mattermost + setuid ubuntu + exec bin/platform + ``` + * You can manage the process by typing: + * ```~$ sudo start mattermost``` + * Verify the service is running by typing: + * ```~$ curl http://10.10.10.2:8065``` + * You should see a page titles *Mattermost - Signup* + * You can also stop the process by running the command `~$ sudo stop mattermost`, but we will skip this step for now. + +## Setup Nginx Server +1. For the purposes of this guide we will assume this server has an IP address of 10.10.10.3 +1. We use Nginx for proxying request to the Mattermost Server. The main benefits are: + * SSL terminiation + * http to https redirect + * Port mapping :80 to :8065 + * Standard request logs +1. Install Nginx on Ubuntu with + * ```~$ sudo apt-get install nginx``` +1. Verify Nginx is running + * ```~$ curl http://10.10.10.3``` + * You should see a *Welcome to nginx!* page +1. You can manage Nginx with the following commands + * ```~$ sudo service nginx stop``` + * ```~$ sudo service nginx start``` + * ```~$ sudo service nginx restart``` +1. Map a FQDN (fully qualified domain name) like **mattermost.example.com** to point to the Nginx server. +1. Configure Nginx to proxy connections from the internet to the Mattermost Server + * Create a configuration for Mattermost + * ```~$ sudo touch /etc/nginx/sites-available/mattermost``` + * Below is a sample configuration with the minimum settings required to configure Mattermost. + * ``` + server { + location / { + client_max_body_size 50M; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Frame-Options SAMEORIGIN; + proxy_pass http://localhost:8065; + } + }``` + * Remove the existing file with + * ```~$ sudo rm /etc/nginx/sites-enabled/default``` + * Link the mattermost config by typing: + * ```sudo ln -s /etc/nginx/sites-available/mattermost /etc/nginx/sites-enabled/mattermost``` + * Restart Nginx by typing: + * ```~$ sudo service nginx restart``` + * Verify you can see Mattermost thru the proxy by typing: + * ```~$ curl http://localhost``` + * You should see a page titles *Mattermost - Signup* + + + + + + + + + + + + + + + +1. Download [latest stable compiled verison of Mattermost](https://github.com/mattermost/platform/releases) from GitHub +2. Set up machine with Ubuntu 14.04 with 2GB of RAM or similar +3. Install and configure Ngnix as a proxy to Mattermost +4. Install SSL certificate +5. Configure proxy pass thru +6. Install Postgres 9.3+ or MySQL 5.2+ (optionally, this install could be made on another machine) +7. Create a database using following SQL commands: + + ``` + DROP DATABASE mattermost; + CREATE DATABASE mattermost; + CREATE USER mmuser WITH PASSWORD 'mostest'; + GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser; + ``` +8. Replace and configure SQL settings section of config.json file with: + + ``` +"DriverName": "mysql", +"DataSource": "mmuser:mostest@tcp(localhost:3306)/mattermost?charset=utf8mb4,utf8", +"DataSourceReplicas": ["mmuser:mostest@tcp(localhost:3306)/mattermost?charset=utf8mb4,utf8"], + ``` +or + ``` +"DriverName": "postgres", +"DataSource": "postgres://mmuser:password@localhost:5432/mattermost?sslmode=disable&connect_timeout=10", +"DataSourceReplicas": ["postgres://mmuser:password@localhost:5432/mattermost?sslmode=disable&connect_timeout=10"], +``` +9. [Set up email notifications](https://github.com/mattermost/platform/blob/master/doc/config/smtp-email-setup.md) +10. On Ubuntu configure upstart to manage the mattermost process (or configure something similar using systemd) then copy following lines to /etc/init/mattermost.conf + + ``` + start on runlevel [2345] + stop on runlevel [016] + respawn + chdir /home/ubuntu/mattermost + setuid ubuntu + exec bin/platform + ``` +11. Run `sudo start mattermost` +12. Then `curl localhost:8065` \ No newline at end of file From c82f2530d7019ee24fa7791cced98a37bccccd94 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Mon, 28 Sep 2015 21:55:49 -0700 Subject: [PATCH 10/32] Finishing directions --- doc/install/prod-ubuntu.md | 120 +++++++++++++++++++++---------------- 1 file changed, 67 insertions(+), 53 deletions(-) diff --git a/doc/install/prod-ubuntu.md b/doc/install/prod-ubuntu.md index fb0466cd8b..2abeda6cb5 100644 --- a/doc/install/prod-ubuntu.md +++ b/doc/install/prod-ubuntu.md @@ -92,6 +92,7 @@ * Below is a sample configuration with the minimum settings required to configure Mattermost. * ``` server { + server_name mattermost.example.com; location / { client_max_body_size 50M; proxy_set_header Upgrade $http_upgrade; @@ -114,57 +115,70 @@ * ```~$ curl http://localhost``` * You should see a page titles *Mattermost - Signup* - - - - - - - - - - - - - - -1. Download [latest stable compiled verison of Mattermost](https://github.com/mattermost/platform/releases) from GitHub -2. Set up machine with Ubuntu 14.04 with 2GB of RAM or similar -3. Install and configure Ngnix as a proxy to Mattermost -4. Install SSL certificate -5. Configure proxy pass thru -6. Install Postgres 9.3+ or MySQL 5.2+ (optionally, this install could be made on another machine) -7. Create a database using following SQL commands: - - ``` - DROP DATABASE mattermost; - CREATE DATABASE mattermost; - CREATE USER mmuser WITH PASSWORD 'mostest'; - GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser; - ``` -8. Replace and configure SQL settings section of config.json file with: - - ``` -"DriverName": "mysql", -"DataSource": "mmuser:mostest@tcp(localhost:3306)/mattermost?charset=utf8mb4,utf8", -"DataSourceReplicas": ["mmuser:mostest@tcp(localhost:3306)/mattermost?charset=utf8mb4,utf8"], - ``` -or - ``` -"DriverName": "postgres", -"DataSource": "postgres://mmuser:password@localhost:5432/mattermost?sslmode=disable&connect_timeout=10", -"DataSourceReplicas": ["postgres://mmuser:password@localhost:5432/mattermost?sslmode=disable&connect_timeout=10"], -``` -9. [Set up email notifications](https://github.com/mattermost/platform/blob/master/doc/config/smtp-email-setup.md) -10. On Ubuntu configure upstart to manage the mattermost process (or configure something similar using systemd) then copy following lines to /etc/init/mattermost.conf - +## Setup Nginx with SSL (Recommended) +1. You will need a SSL cert from a certificate athority. +1. For simplicity we will generate a test certificate. + * ```~$ mkdir ~/cert``` + * ```~$ cd ~/cert``` + * ```~$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mattermost.key -out mattermost.crt``` + * Input the following info ``` - start on runlevel [2345] - stop on runlevel [016] - respawn - chdir /home/ubuntu/mattermost - setuid ubuntu - exec bin/platform - ``` -11. Run `sudo start mattermost` -12. Then `curl localhost:8065` \ No newline at end of file + Country Name (2 letter code) [AU]:US + State or Province Name (full name) [Some-State]:California + Locality Name (eg, city) []:Palo Alto + Organization Name (eg, company) [Internet Widgits Pty Ltd]:Example LLC + Organizational Unit Name (eg, section) []: + Common Name (e.g. server FQDN or YOUR name) []:mattermost.example.com + Email Address []:admin@mattermost.example.com +``` +1. Modify the file at `/etc/nginx/sites-available/mattermost` and add the following lines + * ``` + server { + listen 80; + server_name mattermost.example.com; + return 301 https://$server_name$request_uri; + } + + server { + listen 443 ssl; + server_name mattermost.example.com; + + ssl on; + ssl_certificate /home/ubuntu/cert/mattermost.crt; + ssl_certificate_key /home/ubuntu/cert/mattermost.key; + ssl_session_timeout 5m; + ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES"; + ssl_prefer_server_ciphers on; + + # add to location / above + location / { + gzip off; + proxy_set_header X-Forwarded-Ssl on; + ``` + +## Finish Mattermost Server setup +1. Navigate to https://mattermost.example.com and create a team and user. +1. The first user in the system is automatically granted the `system_admin` role, which gives you access to the System Console. +1. From the `town-square` channel click the dropdown and choose the `System Console` option +1. Update Email Settings. We recommend using an email sending service. The example below assumes AmazonSES. + * Set *Send Email Notifications* to true + * Set *Require Email Verification* to true + * Set *Feedback Name* to `No-Reply` + * Set *Feedback Email* to `mattermost@example.com` + * Set *SMTP Username* to `AFIADTOVDKDLGERR` + * Set *SMTP Password* to `DFKJoiweklsjdflkjOIGHLSDFJewiskdjf` + * Set *SMTP Server* to `email-smtp.us-east-1.amazonaws.com` + * Set *SMTP Port* to `465` + * Set *Connection Security* to `TLS` + * Save the Settings +1. Update File Settings + * Change *Local Directory Location* from `./data/` to `/mattermost/data` +1. Update Log Settings + * Set *Log to The Console* to false +1. Update Rate Limit Settings + * Set *Vary By Remote Address* to false + * Set *Vary By HTTP Header* to X-Real-IP +1. Feel free to modify other settings. +1. Restart the Mattermost Service by typing: + * ```~$ sudo restart mattermost``` From cd9158ddb1544bac668099e65749ad99b7e25207 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Mon, 28 Sep 2015 21:58:48 -0700 Subject: [PATCH 11/32] Fixing formatting --- doc/install/prod-ubuntu.md | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/doc/install/prod-ubuntu.md b/doc/install/prod-ubuntu.md index 2abeda6cb5..9bb9bca376 100644 --- a/doc/install/prod-ubuntu.md +++ b/doc/install/prod-ubuntu.md @@ -55,13 +55,14 @@ * ```~$ sudo touch /etc/init/mattermost.conf``` * ```~$ sudo vi /etc/init/mattermost.conf``` * Copy the following lines into `/etc/init/mattermost.conf` - * ```start on runlevel [2345] - stop on runlevel [016] - respawn - chdir /home/ubuntu/mattermost - setuid ubuntu - exec bin/platform - ``` +``` +start on runlevel [2345] +stop on runlevel [016] +respawn +chdir /home/ubuntu/mattermost +setuid ubuntu +exec bin/platform +``` * You can manage the process by typing: * ```~$ sudo start mattermost``` * Verify the service is running by typing: @@ -90,8 +91,9 @@ * Create a configuration for Mattermost * ```~$ sudo touch /etc/nginx/sites-available/mattermost``` * Below is a sample configuration with the minimum settings required to configure Mattermost. - * ``` - server { + * + ``` + server { server_name mattermost.example.com; location / { client_max_body_size 50M; @@ -104,7 +106,8 @@ proxy_set_header X-Frame-Options SAMEORIGIN; proxy_pass http://localhost:8065; } - }``` + } +``` * Remove the existing file with * ```~$ sudo rm /etc/nginx/sites-enabled/default``` * Link the mattermost config by typing: @@ -122,7 +125,7 @@ * ```~$ cd ~/cert``` * ```~$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mattermost.key -out mattermost.crt``` * Input the following info - ``` +``` Country Name (2 letter code) [AU]:US State or Province Name (full name) [Some-State]:California Locality Name (eg, city) []:Palo Alto @@ -132,7 +135,8 @@ Email Address []:admin@mattermost.example.com ``` 1. Modify the file at `/etc/nginx/sites-available/mattermost` and add the following lines - * ``` + * +``` server { listen 80; server_name mattermost.example.com; @@ -155,8 +159,7 @@ location / { gzip off; proxy_set_header X-Forwarded-Ssl on; - ``` - +``` ## Finish Mattermost Server setup 1. Navigate to https://mattermost.example.com and create a team and user. 1. The first user in the system is automatically granted the `system_admin` role, which gives you access to the System Console. From a9f5918a9df9fca2fcab97e2c7e623187755ae78 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Tue, 29 Sep 2015 08:38:26 -0400 Subject: [PATCH 12/32] Update incoming webhooks to hide DMs and accept direct JSON payloads. --- config/config.json | 4 ++-- doc/integrations/webhook/incoming.md | 5 +++++ .../user_settings/manage_incoming_hooks.jsx | 16 +++++++++------- web/react/utils/constants.jsx | 1 + web/web.go | 7 ++++++- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/config/config.json b/config/config.json index 60e197154c..1dbd05a79a 100644 --- a/config/config.json +++ b/config/config.json @@ -5,7 +5,7 @@ "SegmentDeveloperKey": "", "GoogleDeveloperKey": "", "EnableOAuthServiceProvider": false, - "EnableIncomingWebhooks": false, + "EnableIncomingWebhooks": true, "EnableTesting": false }, "TeamSettings": { @@ -86,4 +86,4 @@ "TokenEndpoint": "", "UserApiEndpoint": "" } -} \ No newline at end of file +} diff --git a/doc/integrations/webhook/incoming.md b/doc/integrations/webhook/incoming.md index a48448cc51..e391cba920 100644 --- a/doc/integrations/webhook/incoming.md +++ b/doc/integrations/webhook/incoming.md @@ -20,6 +20,11 @@ You can send the message by including a JSON string as the `payload` parameter i payload={"text": "Hello, this is some text."} ``` +In addition, if `Content-Type` is specified as `application/json` in the headers of the HTTP request then the body of the request can be direct JSON. +``` +{"text": "Hello, this is some text."} +``` + It is also possible to post richly formatted messages using [Markdown](../../help/enduser/markdown.md). ``` payload={"text": "# A Header\nThe _text_ below **the** header."} diff --git a/web/react/components/user_settings/manage_incoming_hooks.jsx b/web/react/components/user_settings/manage_incoming_hooks.jsx index 1bbfbd162a..fa2e2e5e41 100644 --- a/web/react/components/user_settings/manage_incoming_hooks.jsx +++ b/web/react/components/user_settings/manage_incoming_hooks.jsx @@ -21,7 +21,7 @@ export default class ManageIncomingHooks extends React.Component { this.getHooks(); } addNewHook() { - let hook = {}; //eslint-disable-line prefer-const + const hook = {}; hook.channel_id = this.state.channelId; Client.addIncomingHook( @@ -40,13 +40,13 @@ export default class ManageIncomingHooks extends React.Component { ); } removeHook(id) { - let data = {}; //eslint-disable-line prefer-const + const data = {}; data.id = id; Client.deleteIncomingHook( data, () => { - let hooks = this.state.hooks; //eslint-disable-line prefer-const + const hooks = this.state.hooks; let index = -1; for (let i = 0; i < hooks.length; i++) { if (hooks[i].id === id) { @@ -69,7 +69,7 @@ export default class ManageIncomingHooks extends React.Component { getHooks() { Client.listIncomingHooks( (data) => { - let state = this.state; //eslint-disable-line prefer-const + const state = this.state; if (data) { state.hooks = data; @@ -93,9 +93,11 @@ export default class ManageIncomingHooks extends React.Component { } const channels = ChannelStore.getAll(); - let options = []; //eslint-disable-line prefer-const + const options = []; channels.forEach((channel) => { - options.push(); + if (channel.type !== Constants.DM_CHANNEL) { + options.push(); + } }); let disableButton = ''; @@ -103,7 +105,7 @@ export default class ManageIncomingHooks extends React.Component { disableButton = ' disable'; } - let hooks = []; //eslint-disable-line prefer-const + const hooks = []; this.state.hooks.forEach((hook) => { const c = ChannelStore.get(hook.channel_id); hooks.push( diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx index 75e80bc7ef..da59f8e5a7 100644 --- a/web/react/utils/constants.jsx +++ b/web/react/utils/constants.jsx @@ -111,6 +111,7 @@ module.exports = { ], MONTHS: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], MAX_DMS: 20, + DM_CHANNEL: 'D', MAX_POST_LEN: 4000, EMOJI_SIZE: 16, ONLINE_ICON_SVG: "", diff --git a/web/web.go b/web/web.go index da7eff13da..bf985a5a0a 100644 --- a/web/web.go +++ b/web/web.go @@ -850,7 +850,12 @@ func incomingWebhook(c *api.Context, w http.ResponseWriter, r *http.Request) { r.ParseForm() - props := model.MapFromJson(strings.NewReader(r.FormValue("payload"))) + var props map[string]string + if r.Header.Get("Content-Type") == "application/json" { + props = model.MapFromJson(r.Body) + } else { + props = model.MapFromJson(strings.NewReader(r.FormValue("payload"))) + } text := props["text"] if len(text) == 0 { From 3e77df8532a227e4994f9418dc04381d7285d47a Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Tue, 29 Sep 2015 19:23:21 +0500 Subject: [PATCH 13/32] plt-479 - Fixing command lists and also making them theme compatible --- web/react/components/command_list.jsx | 4 ++-- web/react/utils/utils.jsx | 12 ++++++++---- web/sass-files/sass/partials/_command-box.scss | 17 +++++++++++++---- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/web/react/components/command_list.jsx b/web/react/components/command_list.jsx index 553dcabe70..fea7085b79 100644 --- a/web/react/components/command_list.jsx +++ b/web/react/components/command_list.jsx @@ -70,8 +70,8 @@ export default class CommandList extends React.Component { className='command-name' onClick={this.handleClick.bind(this, i)} > -
{this.state.suggestions[i].suggestion}
-
{this.state.suggestions[i].description}
+
{this.state.suggestions[i].suggestion}
+
{this.state.suggestions[i].description}
); } diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index e133ee1282..9425f3ea69 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -449,7 +449,7 @@ export function applyTheme(theme) { } if (theme.centerChannelBg) { - changeCss('.app__content, .markdown__table, .markdown__table tbody tr', 'background:' + theme.centerChannelBg, 1); + changeCss('.app__content, .markdown__table, .markdown__table tbody tr, .command-box', 'background:' + theme.centerChannelBg, 1); changeCss('#post-list .post-list-holder-by-time', 'background:' + theme.centerChannelBg, 1); changeCss('#post-create', 'background:' + theme.centerChannelBg, 1); changeCss('.search-bar__container .search__form .search-bar', 'background:' + theme.centerChannelBg, 1); @@ -459,14 +459,18 @@ export function applyTheme(theme) { } if (theme.centerChannelColor) { - changeCss('.app__content, .post-create__container .post-create-body .btn-file, .post-create__container .post-create-footer .msg-typing, .loading-screen .loading__content .round', 'color:' + theme.centerChannelColor, 1); + changeCss('.app__content, .post-create__container .post-create-body .btn-file, .post-create__container .post-create-footer .msg-typing, .loading-screen .loading__content .round, .command-name', 'color:' + theme.centerChannelColor, 1); changeCss('#post-create', 'color:' + theme.centerChannelColor, 2); + changeCss('.mentions--top, .command-box', 'box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 3); + changeCss('.mentions--top, .command-box', '-webkit-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 2); + changeCss('.mentions--top, .command-box', '-moz-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 1); changeCss('.post-body hr', 'background:' + theme.centerChannelColor, 1); changeCss('.channel-header .heading', 'color:' + theme.centerChannelColor, 1); changeCss('.markdown__table tbody tr:nth-child(2n)', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1); changeCss('.channel-header__info>div.dropdown .header-dropdown__icon', 'color:' + changeOpacity(theme.centerChannelColor, 0.8), 1); changeCss('.channel-header #member_popover', 'color:' + changeOpacity(theme.centerChannelColor, 0.8), 1); - changeCss('.custom-textarea, .custom-textarea:focus, .preview-container .preview-div, .post-image__column .post-image__details, .sidebar--right .sidebar-right__body, .markdown__table th, .markdown__table td', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1); + changeCss('.custom-textarea, .custom-textarea:focus, .preview-container .preview-div, .post-image__column .post-image__details, .sidebar--right .sidebar-right__body, .markdown__table th, .markdown__table td, .command-box', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1); + changeCss('.command-name', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1); changeCss('.custom-textarea', 'color:' + theme.centerChannelColor, 1); changeCss('.post-image__column', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 2); changeCss('.post-image__column .post-image__details', 'color:' + theme.centerChannelColor, 2); @@ -484,7 +488,7 @@ export function applyTheme(theme) { changeCss('@media(max-width: 1800px){.inner__wrap.move--left .post.post--comment.same--root', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.07), 2); changeCss('.post:hover, .sidebar--right .sidebar--right__header', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1); changeCss('.date-separator.hovered--before:after, .new-separator.hovered--before:after', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1); - changeCss('.date-separator.hovered--after:before, .new-separator.hovered--after:before', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1); + changeCss('.date-separator.hovered--after:before, .new-separator.hovered--after:before, .command-name:hover', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1); changeCss('.post.current--user:hover .post-body ', 'background: none;', 1); changeCss('.sidebar--right', 'color:' + theme.centerChannelColor, 2); } diff --git a/web/sass-files/sass/partials/_command-box.scss b/web/sass-files/sass/partials/_command-box.scss index 44eb9b8df7..f1aa4dca2d 100644 --- a/web/sass-files/sass/partials/_command-box.scss +++ b/web/sass-files/sass/partials/_command-box.scss @@ -4,20 +4,29 @@ width: 100%; border: $border-gray; bottom: 38px; + overflow: auto; @extend %popover-box-shadow; + .sidebar--right & { + bottom: 100px; + } } .command-name { position: relative; width: 100%; - background-color: #fff; - height: 37px; - line-height: 37px; - padding: 2px 10px 2px 5px; + line-height: 24px; + padding: 5px 10px 8px; z-index: 101; + font-size: 0.95em; + border-bottom: 1px solid #ddd; &:hover { background-color: #e8eaed; } + .command__desc { + margin-left: 5px; + @include opacity(0.5); + line-height: normal; + } } .command-desc { From 558f8a322feba9fa22509a58a01411225c81b469 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Mon, 28 Sep 2015 16:31:18 -0700 Subject: [PATCH 14/32] Removed unused title update code --- web/react/components/more_direct_channels.jsx | 2 +- web/react/components/rename_channel_modal.jsx | 1 - web/react/components/search_results_item.jsx | 7 +------ web/react/utils/utils.jsx | 12 +----------- 4 files changed, 3 insertions(+), 19 deletions(-) diff --git a/web/react/components/more_direct_channels.jsx b/web/react/components/more_direct_channels.jsx index b7bce9b34b..54d77c3586 100644 --- a/web/react/components/more_direct_channels.jsx +++ b/web/react/components/more_direct_channels.jsx @@ -43,7 +43,7 @@ export default class MoreDirectChannels extends React.Component { handleClick = function clickHandler(e) { e.preventDefault(); - utils.switchChannel(channel, channel.teammate_username); + utils.switchChannel(channel); $(React.findDOMNode(self.refs.modal)).modal('hide'); }; } else { diff --git a/web/react/components/rename_channel_modal.jsx b/web/react/components/rename_channel_modal.jsx index 37958b649a..9d514c7411 100644 --- a/web/react/components/rename_channel_modal.jsx +++ b/web/react/components/rename_channel_modal.jsx @@ -78,7 +78,6 @@ export default class RenameChannelModal extends React.Component { $(React.findDOMNode(this.refs.modal)).modal('hide'); AsyncClient.getChannel(channel.id); - Utils.updateTabTitle(channel.display_name); Utils.updateAddressBar(channel.name); React.findDOMNode(this.refs.displayName).value = ''; diff --git a/web/react/components/search_results_item.jsx b/web/react/components/search_results_item.jsx index 32b521560e..bdefdbee88 100644 --- a/web/react/components/search_results_item.jsx +++ b/web/react/components/search_results_item.jsx @@ -47,13 +47,8 @@ export default class SearchResultsItem extends React.Component { ); var postChannel = ChannelStore.get(this.props.post.channel_id); - var teammate = ''; - if (postChannel.type === 'D') { - teammate = utils.getDirectTeammate(this.props.post.channel_id).username; - } - - utils.switchChannel(postChannel, teammate); + utils.switchChannel(postChannel); } render() { diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 61dcae6d8a..fec13abe97 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -790,16 +790,12 @@ export function isValidUsername(name) { return error; } -export function updateTabTitle(name) { - document.title = name + ' ' + document.title.substring(document.title.lastIndexOf('-')); -} - export function updateAddressBar(channelName) { var teamURL = window.location.href.split('/channels')[0]; history.replaceState('data', '', teamURL + '/channels/' + channelName); } -export function switchChannel(channel, teammateName) { +export function switchChannel(channel) { AppDispatcher.handleViewAction({ type: ActionTypes.CLICK_CHANNEL, name: channel.name, @@ -808,12 +804,6 @@ export function switchChannel(channel, teammateName) { updateAddressBar(channel.name); - if (channel.type === 'D' && teammateName) { - updateTabTitle(teammateName); - } else { - updateTabTitle(channel.display_name); - } - AsyncClient.getChannels(true, true, true); AsyncClient.getChannelExtraInfo(true); AsyncClient.getPosts(channel.id); From 86d8c41e4d328d1ad238ccb9658a60609b12add4 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Tue, 29 Sep 2015 09:12:09 -0700 Subject: [PATCH 15/32] Fixing typos --- doc/install/prod-ubuntu.md | 74 +++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/doc/install/prod-ubuntu.md b/doc/install/prod-ubuntu.md index 9bb9bca376..866b1bdbe9 100644 --- a/doc/install/prod-ubuntu.md +++ b/doc/install/prod-ubuntu.md @@ -3,17 +3,17 @@ ## Install Ubuntu Server 14.04 LTS 1. Set up 3 machines with Ubuntu 14.04 with 2GB of RAM or more. The servers will be used for the Load Balancer, Mattermost, and Database. 1. Make sure the system is up to date with the most recent security patches. - * ```~$ sudo apt-get update``` - * ```~$ sudo apt-get upgrade``` + * ``` sudo apt-get update``` + * ``` sudo apt-get upgrade``` ## Setup Database Server 1. For the purposes of this guide we will assume this server has an IP address of 10.10.10.1 1. Install PostgreSQL 9.3+ (or MySQL 5.2+) - * ```~$ sudo apt-get install postgresql postgresql-contrib``` + * ``` sudo apt-get install postgresql postgresql-contrib``` 1. PostgreSQL created a user account called `postgres`. You will need to log into that account with: - * ```~$ sudo -i -u postgres``` + * ``` sudo -i -u postgres``` 1. You can get a PostgreSQL prompt by typing: - * ```~$ psql``` + * ``` psql``` 1. Create the Mattermost database by typing: * ```postgres=# CREATE DATABASE mattermost;``` 1. Create the Mattermost user by typing: @@ -23,37 +23,37 @@ 1. You can exit out of PostgreSQL by typing: * ```postgre=# \q``` 1. You can exit the postgres account by typing: - * ```~$ exit``` + * ``` exit``` ## Setup Mattermost Server 1. For the purposes of this guide we will assume this server has an IP address of 10.10.10.2 -1. Download the lastest Mattermost Server by typing: - * ```~$ wget https://github.com/mattermost/platform/releases/download/v1.0.0/mattermost.tar.gz``` +1. Download the latest Mattermost Server by typing: + * ``` wget https://github.com/mattermost/platform/releases/download/v1.0.0/mattermost.tar.gz``` 1. Unzip the Mattermost Server by typing: - * ```~$ tar -xvzf mattermost.tar.gz``` + * ``` tar -xvzf mattermost.tar.gz``` 1. For the sake of making this guide simple we located the files at `/home/ubuntu/mattermost`, in the future we will give guidance for storing under `/opt`. 1. We have also elected to run the Mattermost Server as the `ubuntu` account for simplicity. We recommend settings up and running the service under a `mattermost` user account with limited permissions. -1. Create the stoarge directory for files. We assume you will have attached a large drive for storage of images and files. For this setup we will assume the directory is located at `/mattermost/data`. - * Create the direcotry by typing: - * ```~$ sudo mkdir -p /mattermost/data``` +1. Create the storage directory for files. We assume you will have attached a large drive for storage of images and files. For this setup we will assume the directory is located at `/mattermost/data`. + * Create the directory by typing: + * ``` sudo mkdir -p /mattermost/data``` * Set the ubuntu account as the directory owner by typing: - * ```~$ sudo chown -R ubuntu /mattermost``` + * ``` sudo chown -R ubuntu /mattermost``` 1. Configure Mattermost Server by editing the config.json file at /home/ubuntu/mattermost/config` - * ```~$ cd ~/mattermost/config``` + * ``` cd ~/mattermost/config``` * Edit the file by typing: - * ```~$ vi config.json``` + * ``` vi config.json``` * replace `DriverName": "mysql"` with `DriverName": "postgres"` * replace `"DataSource": "mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8"` with `"DataSource": "postgres://mmuser:mmuser_password@10.10.10.1:5432/mattermost?sslmode=disable&connect_timeout=10"` * Optionally you may continue to edit configuration settings in `config.json` or use the System Console described in a later section to finish the configuration. 1. Test the Mattermost Server - * ```~$ cd ~/mattermost/bin``` + * ``` cd ~/mattermost/bin``` * Run the Mattermost Server by typing: - * ```~$ ./platform``` + * ``` ./platform``` * You should see a console log like `Server is listening on :8065` letting you know the service is running. * Stop the server for now by typing `ctrl-c` 1. Setup Mattermost to use the Ubuntu Upstart daemon which handles supervision of the Mattermost process. - * ```~$ sudo touch /etc/init/mattermost.conf``` - * ```~$ sudo vi /etc/init/mattermost.conf``` + * ``` sudo touch /etc/init/mattermost.conf``` + * ``` sudo vi /etc/init/mattermost.conf``` * Copy the following lines into `/etc/init/mattermost.conf` ``` start on runlevel [2345] @@ -64,32 +64,32 @@ setuid ubuntu exec bin/platform ``` * You can manage the process by typing: - * ```~$ sudo start mattermost``` + * ``` sudo start mattermost``` * Verify the service is running by typing: - * ```~$ curl http://10.10.10.2:8065``` + * ``` curl http://10.10.10.2:8065``` * You should see a page titles *Mattermost - Signup* - * You can also stop the process by running the command `~$ sudo stop mattermost`, but we will skip this step for now. + * You can also stop the process by running the command ` sudo stop mattermost`, but we will skip this step for now. ## Setup Nginx Server 1. For the purposes of this guide we will assume this server has an IP address of 10.10.10.3 1. We use Nginx for proxying request to the Mattermost Server. The main benefits are: - * SSL terminiation + * SSL termination * http to https redirect * Port mapping :80 to :8065 * Standard request logs 1. Install Nginx on Ubuntu with - * ```~$ sudo apt-get install nginx``` + * ``` sudo apt-get install nginx``` 1. Verify Nginx is running - * ```~$ curl http://10.10.10.3``` + * ``` curl http://10.10.10.3``` * You should see a *Welcome to nginx!* page 1. You can manage Nginx with the following commands - * ```~$ sudo service nginx stop``` - * ```~$ sudo service nginx start``` - * ```~$ sudo service nginx restart``` + * ``` sudo service nginx stop``` + * ``` sudo service nginx start``` + * ``` sudo service nginx restart``` 1. Map a FQDN (fully qualified domain name) like **mattermost.example.com** to point to the Nginx server. 1. Configure Nginx to proxy connections from the internet to the Mattermost Server * Create a configuration for Mattermost - * ```~$ sudo touch /etc/nginx/sites-available/mattermost``` + * ``` sudo touch /etc/nginx/sites-available/mattermost``` * Below is a sample configuration with the minimum settings required to configure Mattermost. * ``` @@ -109,21 +109,21 @@ exec bin/platform } ``` * Remove the existing file with - * ```~$ sudo rm /etc/nginx/sites-enabled/default``` + * ``` sudo rm /etc/nginx/sites-enabled/default``` * Link the mattermost config by typing: * ```sudo ln -s /etc/nginx/sites-available/mattermost /etc/nginx/sites-enabled/mattermost``` * Restart Nginx by typing: - * ```~$ sudo service nginx restart``` + * ``` sudo service nginx restart``` * Verify you can see Mattermost thru the proxy by typing: - * ```~$ curl http://localhost``` + * ``` curl http://localhost``` * You should see a page titles *Mattermost - Signup* ## Setup Nginx with SSL (Recommended) -1. You will need a SSL cert from a certificate athority. +1. You will need a SSL cert from a certificate authority. 1. For simplicity we will generate a test certificate. - * ```~$ mkdir ~/cert``` - * ```~$ cd ~/cert``` - * ```~$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mattermost.key -out mattermost.crt``` + * ``` mkdir ~/cert``` + * ``` cd ~/cert``` + * ``` sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mattermost.key -out mattermost.crt``` * Input the following info ``` Country Name (2 letter code) [AU]:US @@ -184,4 +184,4 @@ exec bin/platform * Set *Vary By HTTP Header* to X-Real-IP 1. Feel free to modify other settings. 1. Restart the Mattermost Service by typing: - * ```~$ sudo restart mattermost``` + * ``` sudo restart mattermost``` From 9e99058d065f612c43d882608716a3402091a79f Mon Sep 17 00:00:00 2001 From: it33 Date: Tue, 29 Sep 2015 09:46:23 -0700 Subject: [PATCH 16/32] Adding link to production install --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 58f4887f61..88f6dcb35c 100644 --- a/README.md +++ b/README.md @@ -52,10 +52,12 @@ There are multiple ways to install Mattermost depending on your needs. [![Build Status](https://travis-ci.org/mattermost/platform.svg?branch=master)](https://travis-ci.org/mattermost/platform) -#### Production Deployment (for Beta2 and later) +#### Production Deployment Prior to production installation, please review [Mattermost system requirements](doc/install/requirements.md). +- [Production Install on Ubuntu 14.04](https://github.com/mattermost/platform/blob/release-1.0.0/doc/install/prod-ubuntu.md) - Install Mattermost for production environments. + - [GitLab Mattermost Production Installation](https://gitlab.com/gitlab-org/gitlab-mattermost) - Install Mattermost for production environments bundled with GitLab, a leading open source Git repository, using an omnibus package for Ubuntu 12.04, Ubuntu 14.04, Debian 7, Debian 8, and CentOS 6 (and RedHat/Oracle/Scientific Linux 6), CentOS 7 (and RedHat/Oracle/Scientific Linux 7). For technical questions and answers, please visit the [Mattermost forum](http://forum.mattermost.org). From 5064f9cba2a63c166776279b2763151f8aed5310 Mon Sep 17 00:00:00 2001 From: Justyn Shull Date: Tue, 29 Sep 2015 11:48:13 -0500 Subject: [PATCH 17/32] Update the /join command to use the correct redirect URL, and update the test to match --- api/command.go | 2 +- api/command_test.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/api/command.go b/api/command.go index 0d2f7597b5..4279223449 100644 --- a/api/command.go +++ b/api/command.go @@ -195,7 +195,7 @@ func joinCommand(c *Context, command *model.Command) bool { return false } - command.GotoLocation = "/channels/" + v.Name + command.GotoLocation = c.GetTeamURL() + "/channels/" + v.Name command.Response = model.RESP_EXECUTED return true } diff --git a/api/command_test.go b/api/command_test.go index fe52dd41bc..d707294482 100644 --- a/api/command_test.go +++ b/api/command_test.go @@ -4,6 +4,7 @@ package api import ( + "strings" "testing" "github.com/mattermost/platform/model" @@ -126,12 +127,12 @@ func TestJoinCommands(t *testing.T) { } rs5 := Client.Must(Client.Command("", "/join "+channel2.Name, false)).Data.(*model.Command) - if rs5.GotoLocation != "/channels/"+channel2.Name { + if !strings.HasSuffix(rs5.GotoLocation, "/"+team.Name+"/channels/"+channel2.Name) { t.Fatal("failed to join channel") } rs6 := Client.Must(Client.Command("", "/join "+channel3.Name, false)).Data.(*model.Command) - if rs6.GotoLocation == "/channels/"+channel3.Name { + if strings.HasSuffix(rs6.GotoLocation, "/"+team.Name+"/channels/"+channel3.Name) { t.Fatal("should not have joined direct message channel") } From ddf89518284649056c5884b209026ec1047e724f Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Tue, 29 Sep 2015 13:57:44 -0400 Subject: [PATCH 18/32] Turn on incoming webhooks by default in the docker configs. --- docker/dev/config_docker.json | 4 ++-- docker/local/config_docker.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/dev/config_docker.json b/docker/dev/config_docker.json index 06fee9bd5c..0001eeb0ac 100644 --- a/docker/dev/config_docker.json +++ b/docker/dev/config_docker.json @@ -5,7 +5,7 @@ "SegmentDeveloperKey": "", "GoogleDeveloperKey": "", "EnableOAuthServiceProvider": false, - "EnableIncomingWebhooks": false, + "EnableIncomingWebhooks": true, "EnableTesting": false }, "TeamSettings": { @@ -86,4 +86,4 @@ "TokenEndpoint": "", "UserApiEndpoint": "" } -} \ No newline at end of file +} diff --git a/docker/local/config_docker.json b/docker/local/config_docker.json index 06fee9bd5c..0001eeb0ac 100644 --- a/docker/local/config_docker.json +++ b/docker/local/config_docker.json @@ -5,7 +5,7 @@ "SegmentDeveloperKey": "", "GoogleDeveloperKey": "", "EnableOAuthServiceProvider": false, - "EnableIncomingWebhooks": false, + "EnableIncomingWebhooks": true, "EnableTesting": false }, "TeamSettings": { @@ -86,4 +86,4 @@ "TokenEndpoint": "", "UserApiEndpoint": "" } -} \ No newline at end of file +} From b1bb2a7a54e55af5e31435254a4154be85805e6b Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Tue, 29 Sep 2015 11:19:03 -0700 Subject: [PATCH 19/32] PLT-483 adding better help text --- web/react/components/admin_console/gitlab_settings.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/react/components/admin_console/gitlab_settings.jsx b/web/react/components/admin_console/gitlab_settings.jsx index 1e10c55921..a887967eae 100644 --- a/web/react/components/admin_console/gitlab_settings.jsx +++ b/web/react/components/admin_console/gitlab_settings.jsx @@ -202,7 +202,7 @@ export default class GitLabSettings extends React.Component { onChange={this.handleChange} disabled={!this.state.Allow} /> -

{'Enter /oauth/authorize (example http://localhost:3000/oauth/authorize).'}

+

{'Enter /oauth/authorize (example http://localhost:3000/oauth/authorize). Make sure you use HTTP or HTTPS in your URLs as appropriate.'}

@@ -224,7 +224,7 @@ export default class GitLabSettings extends React.Component { onChange={this.handleChange} disabled={!this.state.Allow} /> -

{'Enter /oauth/token.'}

+

{'Enter /oauth/token. Make sure you use HTTP or HTTPS in your URLs as appropriate.'}

@@ -246,7 +246,7 @@ export default class GitLabSettings extends React.Component { onChange={this.handleChange} disabled={!this.state.Allow} /> -

{'Enter /api/v3/user.'}

+

{'Enter /api/v3/user. Make sure you use HTTP or HTTPS in your URLs as appropriate.'}

From 0e028d04e2d6442ee15e46c08d26686a2c2f7201 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Tue, 29 Sep 2015 11:20:16 -0700 Subject: [PATCH 20/32] PLT-429 removing scope field. --- .../admin_console/gitlab_settings.jsx | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/web/react/components/admin_console/gitlab_settings.jsx b/web/react/components/admin_console/gitlab_settings.jsx index a887967eae..a0c024f089 100644 --- a/web/react/components/admin_console/gitlab_settings.jsx +++ b/web/react/components/admin_console/gitlab_settings.jsx @@ -40,7 +40,7 @@ export default class GitLabSettings extends React.Component { config.GitLabSettings.Allow = React.findDOMNode(this.refs.Allow).checked; config.GitLabSettings.Secret = React.findDOMNode(this.refs.Secret).value.trim(); config.GitLabSettings.Id = React.findDOMNode(this.refs.Id).value.trim(); - config.GitLabSettings.Scope = React.findDOMNode(this.refs.Scope).value.trim(); + //config.GitLabSettings.Scope = React.findDOMNode(this.refs.Scope).value.trim(); config.GitLabSettings.AuthEndpoint = React.findDOMNode(this.refs.AuthEndpoint).value.trim(); config.GitLabSettings.TokenEndpoint = React.findDOMNode(this.refs.TokenEndpoint).value.trim(); config.GitLabSettings.UserApiEndpoint = React.findDOMNode(this.refs.UserApiEndpoint).value.trim(); @@ -162,28 +162,6 @@ export default class GitLabSettings extends React.Component { -
- -
- -

{'This field is not yet used by GitLab OAuth. Other OAuth providers may use this field to specify the scope of account data from OAuth provider that is sent to Mattermost.'}

-
-
-
+ GitLabSettings.propTypes = { config: React.PropTypes.object }; From 80d1acab228b4fb8c16c0f81be8bd6655b30f8ca Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Tue, 29 Sep 2015 11:21:27 -0700 Subject: [PATCH 21/32] PLT-472 switching field ordering. --- .../admin_console/gitlab_settings.jsx | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/web/react/components/admin_console/gitlab_settings.jsx b/web/react/components/admin_console/gitlab_settings.jsx index a0c024f089..f57affb90b 100644 --- a/web/react/components/admin_console/gitlab_settings.jsx +++ b/web/react/components/admin_console/gitlab_settings.jsx @@ -40,7 +40,6 @@ export default class GitLabSettings extends React.Component { config.GitLabSettings.Allow = React.findDOMNode(this.refs.Allow).checked; config.GitLabSettings.Secret = React.findDOMNode(this.refs.Secret).value.trim(); config.GitLabSettings.Id = React.findDOMNode(this.refs.Id).value.trim(); - //config.GitLabSettings.Scope = React.findDOMNode(this.refs.Scope).value.trim(); config.GitLabSettings.AuthEndpoint = React.findDOMNode(this.refs.AuthEndpoint).value.trim(); config.GitLabSettings.TokenEndpoint = React.findDOMNode(this.refs.TokenEndpoint).value.trim(); config.GitLabSettings.UserApiEndpoint = React.findDOMNode(this.refs.UserApiEndpoint).value.trim(); @@ -118,28 +117,6 @@ export default class GitLabSettings extends React.Component { -
- -
- -

{'Obtain this value via the instructions above for logging into GitLab.'}

-
-
-
+
+ +
+ +

{'Obtain this value via the instructions above for logging into GitLab.'}

+
+
+