From e21b6ac740d4c2361b0a386f8059d094e1624e06 Mon Sep 17 00:00:00 2001 From: it33 Date: Mon, 15 Jun 2015 17:04:08 -0700 Subject: Update LICENSE.txt to Apache 2.0 --- LICENSE.txt | 202 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ License.txt | 5 -- 2 files changed, 202 insertions(+), 5 deletions(-) create mode 100644 LICENSE.txt delete mode 100644 License.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/License.txt b/License.txt deleted file mode 100644 index 6abd425dd..000000000 --- a/License.txt +++ /dev/null @@ -1,5 +0,0 @@ - - -XXXXXX - TODO - -someone needs to update \ No newline at end of file -- cgit v1.2.3-1-g7c22 From 2e55c819301cedb7f8167332521280c9ba121e85 Mon Sep 17 00:00:00 2001 From: it33 Date: Mon, 15 Jun 2015 17:15:57 -0700 Subject: Create NOTICES.txt XXXXXX TODO: Replace sample text with references to 3rd party libraries used --- NOTICES.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 NOTICES.txt diff --git a/NOTICES.txt b/NOTICES.txt new file mode 100644 index 000000000..07c6a8bf4 --- /dev/null +++ b/NOTICES.txt @@ -0,0 +1,4 @@ +Mattermost Platform Preview +Copyright 2015 SpinPunch, Inc. + +Regular expression support is provided by the PCRE library package, which is open source software, written by Philip Hazel, and copyright by the University of Cambridge, England. The original software is available from ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ -- cgit v1.2.3-1-g7c22 From 17566c48a30cf8b5461573cf73cfd07e4257c64d Mon Sep 17 00:00:00 2001 From: it33 Date: Mon, 15 Jun 2015 17:18:39 -0700 Subject: Rename NOTICES.txt to NOTICE.txt --- NOTICE.txt | 4 ++++ NOTICES.txt | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 NOTICE.txt delete mode 100644 NOTICES.txt diff --git a/NOTICE.txt b/NOTICE.txt new file mode 100644 index 000000000..07c6a8bf4 --- /dev/null +++ b/NOTICE.txt @@ -0,0 +1,4 @@ +Mattermost Platform Preview +Copyright 2015 SpinPunch, Inc. + +Regular expression support is provided by the PCRE library package, which is open source software, written by Philip Hazel, and copyright by the University of Cambridge, England. The original software is available from ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ diff --git a/NOTICES.txt b/NOTICES.txt deleted file mode 100644 index 07c6a8bf4..000000000 --- a/NOTICES.txt +++ /dev/null @@ -1,4 +0,0 @@ -Mattermost Platform Preview -Copyright 2015 SpinPunch, Inc. - -Regular expression support is provided by the PCRE library package, which is open source software, written by Philip Hazel, and copyright by the University of Cambridge, England. The original software is available from ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ -- cgit v1.2.3-1-g7c22 From b43f5f85191f4414773d5feab7d7f2a5b79d4fa7 Mon Sep 17 00:00:00 2001 From: it33 Date: Mon, 15 Jun 2015 18:46:05 -0700 Subject: Update README.md Adding preamble, taking out boiler plate instructions --- README.md | 60 +++++++++++++++++++++++++++++------------------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 920cabe79..8dbaf52ab 100644 --- a/README.md +++ b/README.md @@ -1,56 +1,53 @@ +XXXXXX TODO: Test install procedures -XXXXXX - TODO someone needs to update +Mattermost (Preview) +Team Communication Service +Version 0.40 -Will become a heading -============== +What matters most to your team? +=============================== -Will become a sub heading --------------- +Words have power. We built Mattermost for teams who use words to shape the future. +The words you choose are up to you. -*This will be Italic* +*- SpinPunch* -**This will be Bold** +Installing the Mattermost Preview +================================= -- This will be a list item -- This will be a list item - - Add a indent and this will end up as code - - -See ---- -[http://daringfireball.net/projects/markdown/](http://daringfireball.net/projects/markdown/) -[http://en.wikipedia.org/wiki/Markdown](http://en.wikipedia.org/wiki/Markdown) -[http://github.github.com/github-flavored-markdown/](http://github.github.com/github-flavored-markdown/) +You're installing "Mattermost Preview", a pre-released version intended for an early look at what we're building. While SpinPunch runs this codebase internally, because your use will differ from ours this version is not recommended for production deployments. +That said, any issues at all, please let us know on our forum at: http://bit.ly/1MY1kul Developer Machine Setup (Mac) -============================= +----------------------------- -Docker Setup ------------- -1. Follow the instructions at docs.docker.com/installation/mac/ Use the Boot2Docker command-line utility +DOCKER + +1. Follow the instructions at http://docs.docker.com/installation/mac/ Use the Boot2Docker command-line utility If you do command-line setup use: `boot2docker init eval “$(boot2docker shellinit)”` 2. Get your Docker ip address with `boot2docker ip` 3. Add a line to your /etc/hosts that goes ` dockerhost` 4. Run `boot2docker shellinit` and copy the export statements to your ~/.bash_profile -Go Setup --------- -1. Download Go from golang.org/dl/ +Any issues? Please let us know on our forums at: http://bit.ly/1MY1kul + +GO + +1. Download Go from http://golang.org/dl/ + +NODE.JS SETUP -Node.js Setup -------------- 1. Install homebrew from brew.sh 2. `brew install node` -Compass Setup -------------- +COMPASS SETUP + 1. Make sure you have the latest version of Ruby 2. `gem install compass` -Mattermost Setup ----------------- +MATTERMOST SETUP + 1. Make a project directory for Mattermost, which will for the rest of this document be referred to as $PROJECT 2. Make a go directory in your $PROJECT directory 3. Create/Open your ~/.bash_profile and add the following lines: `export GOPATH=$PROJECT/go export PATH=$PATH:$GOPATH/bin` @@ -63,3 +60,4 @@ Mattermost Setup 10. `make test` 11. Provided the test runs fine, you now have a complete build environment. Use `make run` to run your code +Any issues? Please let us know on our forums at: http://bit.ly/1MY1kul -- cgit v1.2.3-1-g7c22 From d736a21696e968c32f21a155658874d78a913bf0 Mon Sep 17 00:00:00 2001 From: it33 Date: Mon, 15 Jun 2015 18:48:43 -0700 Subject: Update README.md --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8dbaf52ab..ffb42247c 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,12 @@ XXXXXX TODO: Test install procedures -Mattermost (Preview) -Team Communication Service -Version 0.40 +Mattermost (Preview)
+Team Communication Service
+Version 0.40 -What matters most to your team? -=============================== +**What matters most to your team?** -Words have power. We built Mattermost for teams who use words to shape the future. +Words have power. We built Mattermost for teams who use words to shape the future.
The words you choose are up to you. *- SpinPunch* @@ -17,7 +16,7 @@ Installing the Mattermost Preview You're installing "Mattermost Preview", a pre-released version intended for an early look at what we're building. While SpinPunch runs this codebase internally, because your use will differ from ours this version is not recommended for production deployments. -That said, any issues at all, please let us know on our forum at: http://bit.ly/1MY1kul +That said, any issues at all, please let us know on the Mattermost forum at: http://bit.ly/1MY1kul Developer Machine Setup (Mac) ----------------------------- -- cgit v1.2.3-1-g7c22 From 572382e7f62ddbf0c64c8481533a815b45f7ed02 Mon Sep 17 00:00:00 2001 From: it33 Date: Mon, 15 Jun 2015 18:56:09 -0700 Subject: Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ffb42247c..b5c92aec3 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,11 @@ Mattermost (Preview)
Team Communication Service
Version 0.40 -**What matters most to your team?** +What matters most to your team? +=============================== -Words have power. We built Mattermost for teams who use words to shape the future.
+Words have power.
+We built Mattermost for teams who use words to shape the future.
The words you choose are up to you. *- SpinPunch* -- cgit v1.2.3-1-g7c22 From e5a9b1f48481551313d56d2683cc3b3fb4ebc618 Mon Sep 17 00:00:00 2001 From: it33 Date: Mon, 15 Jun 2015 18:59:45 -0700 Subject: Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b5c92aec3..29b82f549 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -XXXXXX TODO: Test install procedures - Mattermost (Preview)
Team Communication Service
Version 0.40 @@ -62,3 +60,5 @@ MATTERMOST SETUP 11. Provided the test runs fine, you now have a complete build environment. Use `make run` to run your code Any issues? Please let us know on our forums at: http://bit.ly/1MY1kul + +XXXXXX TODO: Test install procedures -- cgit v1.2.3-1-g7c22 From 30c5661e0316cb46db52f52998914c2463c75062 Mon Sep 17 00:00:00 2001 From: it33 Date: Mon, 15 Jun 2015 19:03:00 -0700 Subject: Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 29b82f549..81e1d21bf 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -Mattermost (Preview)
-Team Communication Service
-Version 0.40 +**Mattermost (Preview)
** +**Team Communication Service
** +**Version 0.40** What matters most to your team? =============================== Words have power.
-We built Mattermost for teams who use words to shape the future.
+Mattermost serves teams who use words to shape the future.
The words you choose are up to you. *- SpinPunch* @@ -61,4 +61,4 @@ MATTERMOST SETUP Any issues? Please let us know on our forums at: http://bit.ly/1MY1kul -XXXXXX TODO: Test install procedures +**XXXXXX TODO: Test install procedures** -- cgit v1.2.3-1-g7c22 From 8f97d9db71bd2cfd8d5e963ac7eec6e0049adc19 Mon Sep 17 00:00:00 2001 From: it33 Date: Mon, 15 Jun 2015 19:07:36 -0700 Subject: Fix typo, "ip" should be "IP" --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 81e1d21bf..a7913ed8d 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ DOCKER 1. Follow the instructions at http://docs.docker.com/installation/mac/ Use the Boot2Docker command-line utility If you do command-line setup use: `boot2docker init eval “$(boot2docker shellinit)”` -2. Get your Docker ip address with `boot2docker ip` +2. Get your Docker IP address with `boot2docker ip` 3. Add a line to your /etc/hosts that goes ` dockerhost` 4. Run `boot2docker shellinit` and copy the export statements to your ~/.bash_profile -- cgit v1.2.3-1-g7c22 From 8d1e63971efe59b16c61dba7ca4026e1d836c73f Mon Sep 17 00:00:00 2001 From: it33 Date: Mon, 15 Jun 2015 19:11:58 -0700 Subject: Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index a7913ed8d..b47e0c0f0 100644 --- a/README.md +++ b/README.md @@ -61,4 +61,8 @@ MATTERMOST SETUP Any issues? Please let us know on our forums at: http://bit.ly/1MY1kul +License +------- + +Mattermost uses the Apache 2.0 open source license: http://bit.ly/1Lc25Sv **XXXXXX TODO: Test install procedures** -- cgit v1.2.3-1-g7c22 From fc9061268e891abf275d6f7289603903ec059883 Mon Sep 17 00:00:00 2001 From: it33 Date: Mon, 15 Jun 2015 19:12:35 -0700 Subject: Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b47e0c0f0..d7b246d79 100644 --- a/README.md +++ b/README.md @@ -64,5 +64,6 @@ Any issues? Please let us know on our forums at: http://bit.ly/1MY1kul License ------- -Mattermost uses the Apache 2.0 open source license: http://bit.ly/1Lc25Sv +Mattermost uses the Apache 2.0 open source license. For more details see: http://bit.ly/1Lc25Sv
+ **XXXXXX TODO: Test install procedures** -- cgit v1.2.3-1-g7c22 From b59716edcdbd4332b1e7122722a78094e6341de3 Mon Sep 17 00:00:00 2001 From: it33 Date: Mon, 15 Jun 2015 19:15:10 -0700 Subject: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d7b246d79..e64ab0374 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,6 @@ Any issues? Please let us know on our forums at: http://bit.ly/1MY1kul License ------- -Mattermost uses the Apache 2.0 open source license. For more details see: http://bit.ly/1Lc25Sv
+Mattermost Preview uses the Apache 2.0 open source license. For more details see: http://bit.ly/1Lc25Sv
**XXXXXX TODO: Test install procedures** -- cgit v1.2.3-1-g7c22 From 0655c8798fe3402399a2e14ae490f44dccd4641f Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Tue, 16 Jun 2015 07:53:58 -0400 Subject: fixes mm-1251 updates sign up now link --- web/react/components/login.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx index 8d82a4b62..685e1b058 100644 --- a/web/react/components/login.jsx +++ b/web/react/components/login.jsx @@ -74,7 +74,7 @@ var FindTeamDomain = React.createClass({

- {"Want to create your own " + strings.Team + "?"} Sign up now + {"Want to create your own " + strings.Team + "?"} Sign up now
-- cgit v1.2.3-1-g7c22 From 0821b51f4ee5fcc2eadc2c92c60ebbb4fdc084d3 Mon Sep 17 00:00:00 2001 From: it33 Date: Tue, 16 Jun 2015 05:22:44 -0700 Subject: More caveats in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e64ab0374..0676b8903 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ The words you choose are up to you. Installing the Mattermost Preview ================================= -You're installing "Mattermost Preview", a pre-released version intended for an early look at what we're building. While SpinPunch runs this codebase internally, because your use will differ from ours this version is not recommended for production deployments. +You're installing "Mattermost Preview", a pre-released 0.40 version intended for an early look at what we're building. While SpinPunch runs this version internally, it's not recommended for production deployments since we can't guarantee API stability or backwards compatibility until our 1.0 version release. That said, any issues at all, please let us know on the Mattermost forum at: http://bit.ly/1MY1kul -- cgit v1.2.3-1-g7c22 From 9c660eb6b942f1302ff41855a66f228082734eb1 Mon Sep 17 00:00:00 2001 From: it33 Date: Tue, 16 Jun 2015 07:57:54 -0700 Subject: Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0676b8903..612b38dd7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -**Mattermost (Preview)
** +**Mattermost Preview
** **Team Communication Service
** **Version 0.40** @@ -64,6 +64,6 @@ Any issues? Please let us know on our forums at: http://bit.ly/1MY1kul License ------- -Mattermost Preview uses the Apache 2.0 open source license. For more details see: http://bit.ly/1Lc25Sv
+This software uses the Apache 2.0 open source license. For more details see: http://bit.ly/1Lc25Sv
**XXXXXX TODO: Test install procedures** -- cgit v1.2.3-1-g7c22 From 332c3a0fd10bc27ccaa174738a7cbdb0ad6c967b Mon Sep 17 00:00:00 2001 From: it33 Date: Tue, 16 Jun 2015 08:24:55 -0700 Subject: Reducing number of steps in Mattermost Setup --- README.md | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 612b38dd7..396accee6 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,9 @@ Developer Machine Setup (Mac) DOCKER -1. Follow the instructions at http://docs.docker.com/installation/mac/ Use the Boot2Docker command-line utility -If you do command-line setup use: `boot2docker init eval “$(boot2docker shellinit)”` +1. Follow the instructions at http://docs.docker.com/installation/mac/ +
a) Use the Boot2Docker command-line utility +
b) If you do command-line setup use: `boot2docker init eval “$(boot2docker shellinit)”` 2. Get your Docker IP address with `boot2docker ip` 3. Add a line to your /etc/hosts that goes ` dockerhost` 4. Run `boot2docker shellinit` and copy the export statements to your ~/.bash_profile @@ -47,17 +48,13 @@ COMPASS SETUP MATTERMOST SETUP -1. Make a project directory for Mattermost, which will for the rest of this document be referred to as $PROJECT -2. Make a go directory in your $PROJECT directory -3. Create/Open your ~/.bash_profile and add the following lines: `export GOPATH=$PROJECT/go export PATH=$PATH:$GOPATH/bin` -4. Refresh your bash profile with `source ~/.bash_profile` -5. `cd $GOPATH` -6. `mkdir -p src/github.com/mattermost` then cd into this directory -7. `git clone github.com/mattermost/platform.git` -8. If you do not have Mercurial, download it with: `brew install mercurial` -9. `cd platform` -10. `make test` -11. Provided the test runs fine, you now have a complete build environment. Use `make run` to run your code +1. Make a project directory for Mattermost, which we'll call **$PROJECT** for the rest of these instructions +2. Make a `go` directory in your $PROJECT directory +3. Open or create your *~/.bash_profile* and add the following lines:
`export GOPATH=$PROJECT/go`
`export PATH=$PATH:$GOPATH/bin`
then refresh your bash profile with `source ~/.bash_profile` +4. Then use `cd $GOPATH` and `mkdir -p src/github.com/mattermost` then cd into this directory and run `git clone github.com/mattermost/platform.git` +5. If you do not have Mercurial, download it with: `brew install mercurial` +6. Then do `cd platform` and `make test`. Provided the test runs fine, you now have a complete build environment. +7. Use `make run` to run your code Any issues? Please let us know on our forums at: http://bit.ly/1MY1kul -- cgit v1.2.3-1-g7c22 From 8136b62f86d0a13e13f62519033cc1e0c290eab4 Mon Sep 17 00:00:00 2001 From: it33 Date: Tue, 16 Jun 2015 08:28:56 -0700 Subject: Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 396accee6..706d4daad 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ That said, any issues at all, please let us know on the Mattermost forum at: htt Developer Machine Setup (Mac) ----------------------------- -DOCKER +DOCKER SETUP 1. Follow the instructions at http://docs.docker.com/installation/mac/
a) Use the Boot2Docker command-line utility @@ -32,7 +32,7 @@ DOCKER Any issues? Please let us know on our forums at: http://bit.ly/1MY1kul -GO +GO SETUP 1. Download Go from http://golang.org/dl/ @@ -50,7 +50,7 @@ MATTERMOST SETUP 1. Make a project directory for Mattermost, which we'll call **$PROJECT** for the rest of these instructions 2. Make a `go` directory in your $PROJECT directory -3. Open or create your *~/.bash_profile* and add the following lines:
`export GOPATH=$PROJECT/go`
`export PATH=$PATH:$GOPATH/bin`
then refresh your bash profile with `source ~/.bash_profile` +3. Open or create your ~/.bash_profile and add the following lines:
`export GOPATH=$PROJECT/go`
`export PATH=$PATH:$GOPATH/bin`
then refresh your bash profile with `source ~/.bash_profile` 4. Then use `cd $GOPATH` and `mkdir -p src/github.com/mattermost` then cd into this directory and run `git clone github.com/mattermost/platform.git` 5. If you do not have Mercurial, download it with: `brew install mercurial` 6. Then do `cd platform` and `make test`. Provided the test runs fine, you now have a complete build environment. -- cgit v1.2.3-1-g7c22 From 347333c6a4613ced4f685f772a6b5515e476b94a Mon Sep 17 00:00:00 2001 From: it33 Date: Tue, 16 Jun 2015 08:40:45 -0700 Subject: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 706d4daad..c3e844f61 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ GO SETUP NODE.JS SETUP -1. Install homebrew from brew.sh +1. Install homebrew from http://brew.sh 2. `brew install node` COMPASS SETUP -- cgit v1.2.3-1-g7c22 From 4330537303ee5c8b3b5c82e620b5ec7e002298b4 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Tue, 16 Jun 2015 12:24:51 -0400 Subject: fixes mm-1218 adds sentence describing username to sign up pages --- web/react/components/signup_team_complete.jsx | 3 ++- web/react/components/signup_user_complete.jsx | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/web/react/components/signup_team_complete.jsx b/web/react/components/signup_team_complete.jsx index 066161a10..b038679e6 100644 --- a/web/react/components/signup_team_complete.jsx +++ b/web/react/components/signup_team_complete.jsx @@ -467,7 +467,8 @@ UsernamePage = React.createClass({ { name_error } -

{"Pick something " + strings.Team + "mates will recognize. Your username is how you will appear to others"}

+

{"Pick something " + strings.Team + "mates will recognize. Your username is how you will appear to others."}

+

It can be made of lowercase letters and numbers.

  diff --git a/web/react/components/signup_user_complete.jsx b/web/react/components/signup_user_complete.jsx index 0fcdc92b0..146419cf5 100644 --- a/web/react/components/signup_user_complete.jsx +++ b/web/react/components/signup_user_complete.jsx @@ -120,6 +120,7 @@ module.exports = React.createClass({

Welcome to { config.SiteName }

{"Choose your username and password for the " + this.props.team_name + " " + strings.Team +"."}

+

Your username can be made of lowercase letters and numbers.

-- cgit v1.2.3-1-g7c22 From aa9992671e16780dc72fe22810d858d204fd7c7c Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Tue, 16 Jun 2015 10:15:00 -0800 Subject: changing unit test --- store/sql_team_store_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/store/sql_team_store_test.go b/store/sql_team_store_test.go index 981817d90..1caec467b 100644 --- a/store/sql_team_store_test.go +++ b/store/sql_team_store_test.go @@ -109,7 +109,10 @@ func TestTeamStoreGetByDomain(t *testing.T) { o1.Domain = "a" + model.NewId() + "b" o1.Email = model.NewId() + "@nowhere.com" o1.Type = model.TEAM_OPEN - <-store.Team().Save(&o1) + + if err := (<-store.Team().Save(&o1)).Err; err != nil { + t.Fatal(rrr) + } if r1 := <-store.Team().GetByDomain(o1.Domain); r1.Err != nil { t.Fatal(r1.Err) -- cgit v1.2.3-1-g7c22 From dae0340d7de308d2e6bc7145fb158635b5cdf0ca Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Tue, 16 Jun 2015 10:16:26 -0800 Subject: fixing unit test --- store/sql_team_store_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/sql_team_store_test.go b/store/sql_team_store_test.go index 1caec467b..1b03b75fd 100644 --- a/store/sql_team_store_test.go +++ b/store/sql_team_store_test.go @@ -111,7 +111,7 @@ func TestTeamStoreGetByDomain(t *testing.T) { o1.Type = model.TEAM_OPEN if err := (<-store.Team().Save(&o1)).Err; err != nil { - t.Fatal(rrr) + t.Fatal(err) } if r1 := <-store.Team().GetByDomain(o1.Domain); r1.Err != nil { -- cgit v1.2.3-1-g7c22 From eedced16c37248ea02992262ef0a63638db674d0 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 16 Jun 2015 15:35:34 -0400 Subject: Switching from config file to parsing homelink from url --- web/react/components/login.jsx | 4 ++-- web/react/utils/utils.jsx | 12 ++++++++++++ web/static/config/config.js | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx index 685e1b058..103a93bc6 100644 --- a/web/react/components/login.jsx +++ b/web/react/components/login.jsx @@ -74,7 +74,7 @@ var FindTeamDomain = React.createClass({

- {"Want to create your own " + strings.Team + "?"} Sign up now + {"Want to create your own " + strings.Team + "?"} Sign up now
@@ -188,7 +188,7 @@ module.exports = React.createClass({ I forgot my password
- {"Want to create your own " + strings.Team + "?"} Sign up now + {"Want to create your own " + strings.Team + "?"} Sign up now
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 72ed48faf..b20e54e84 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -730,3 +730,15 @@ Image.prototype.load = function(url, progressCallback) { }; Image.prototype.completedPercentage = 0; + +module.exports.getHomeLink = function() { + if (config.HomeLink != "") { + return config.HomeLink; + } + var parts = window.location.host.split("."); + if (parts.length <= 1) { + return window.location.host; + } + parts[0] = "www"; + return parts.join("."); +} diff --git a/web/static/config/config.js b/web/static/config/config.js index 080f16a30..5a12942c8 100644 --- a/web/static/config/config.js +++ b/web/static/config/config.js @@ -24,7 +24,7 @@ var config = { AboutLink: "/static/help/configure_links.html", HelpLink: "/static/help/configure_links.html", ReportProblemLink: "/static/help/configure_links.html", - HomeLink: "http://localhost:8065", + HomeLink: "", ThemeColors: ["#2389d7", "#008a17", "#dc4fad", "#ac193d", "#0072c6", "#d24726", "#ff8f32", "#82ba00", "#03b3b2", "#008299", "#4617b4", "#8c0095", "#004b8b", "#004b8b", "#570000", "#380000", "#585858", "#000000"] }; -- cgit v1.2.3-1-g7c22 From d927e2ba69dd355c01878afc0ec57cca6889b8e1 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 16 Jun 2015 16:42:14 -0400 Subject: Fixing link --- web/react/utils/utils.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index b20e54e84..628d92342 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -737,8 +737,8 @@ module.exports.getHomeLink = function() { } var parts = window.location.host.split("."); if (parts.length <= 1) { - return window.location.host; + return window.location.protocol + "//" + window.location.host; } parts[0] = "www"; - return parts.join("."); + return window.location.protocol + "//" + parts.join("."); } -- cgit v1.2.3-1-g7c22 From 2f2aded178c161f7688f295231605711806c7f64 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 16 Jun 2015 17:05:23 -0400 Subject: Allow for setting of domain with enviroment variable --- utils/config.go | 5 +++++ utils/config_test.go | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/utils/config.go b/utils/config.go index 76e6060be..745887c70 100644 --- a/utils/config.go +++ b/utils/config.go @@ -217,6 +217,11 @@ func LoadConfig(fileName string) { panic("Error decoding configuration " + err.Error()) } + // Grabs the domain from enviroment variable if not in configuration + if config.ServiceSettings.Domain == "" { + config.ServiceSettings.Domain = os.Getenv("MATTERMOST_DOMAIN") + } + configureLog(config.LogSettings) Cfg = &config diff --git a/utils/config_test.go b/utils/config_test.go index 4d37b4e88..9067dc647 100644 --- a/utils/config_test.go +++ b/utils/config_test.go @@ -4,9 +4,24 @@ package utils import ( + "os" "testing" ) func TestConfig(t *testing.T) { LoadConfig("config.json") } + +func TestEnvOverride(t *testing.T) { + os.Setenv("MATTERMOST_DOMAIN", "testdomain.com") + + LoadConfig("config_docker.json") + if Cfg.ServiceSettings.Domain != "testdomain.com" { + t.Fail() + } + + LoadConfig("config.json") + if Cfg.ServiceSettings.Domain == "testdomain.com" { + t.Fail() + } +} -- cgit v1.2.3-1-g7c22 From 5c5b7d9738ede69c3224c3f3706c1b39b84f8796 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 15 Jun 2015 10:38:01 -0400 Subject: Adding Dockerfile and releated configs --- Dockerfile | 92 +++++++++++++++++++++++++++++++++++++ config/config_docker.json | 83 +++++++++++++++++++++++++++++++++ docker-entry.sh | 114 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 289 insertions(+) create mode 100644 Dockerfile create mode 100644 config/config_docker.json create mode 100755 docker-entry.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..2e2ad002d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,92 @@ +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 + +# +# 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 . /go/src/github.com/mattermost/platform + + +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-entry.sh +ENTRYPOINT /go/src/github.com/mattermost/platform/docker-entry.sh + +# Ports +EXPOSE 8065 diff --git a/config/config_docker.json b/config/config_docker.json new file mode 100644 index 000000000..470c41bb5 --- /dev/null +++ b/config/config_docker.json @@ -0,0 +1,83 @@ +{ + "LogSettings": { + "ConsoleEnable": true, + "ConsoleLevel": "DEBUG", + "FileEnable": true, + "FileLevel": "INFO", + "FileFormat": "", + "FileLocation": "" + }, + "ServiceSettings": { + "SiteName": "", + "Domain": "", + "Mode" : "dev", + "AllowTesting" : false, + "UseSSL": false, + "Port": "80", + "Version": "developer", + "Shards": { + }, + "InviteSalt": "4nAN4CuEJQ4G73RPA9DJrcVkbrGIE9SX", + "PublicLinkSalt": "zBXCZvnXQ5aRfzqPHgrK5G6wunsPzimE", + "ResetSalt": "GcloaPC5tjGCzwXApNJ23oSLUoP8LXQ4", + "AnalyticsUrl": "" + }, + "SqlSettings": { + "DriverName": "mysql", + "DataSource": "mmuser:mostest@tcp(localhost:3306)/mattermost_test", + "DataSourceReplicas": ["mmuser:mostest@tcp(localhost:3306)/mattermost_test"], + "MaxIdleConns": 10, + "MaxOpenConns": 10, + "Trace": false, + "AtRestEncryptKey": "4Uuoy2t1S204JUKXHGfALJL2J5q3jlEH" + }, + "RedisSettings": { + "DataSource": "localhost:6379", + "MaxOpenConns": 100 + }, + "AWSSettings": { + "S3AccessKeyId": "", + "S3SecretAccessKey": "", + "S3Bucket": "", + "S3Region": "", + "Route53AccessKeyId": "", + "Route53SecretAccessKey": "", + "Route53ZoneId": "", + "Route53Region": "" + }, + "ImageSettings": { + "ThumbnailWidth": 200, + "ThumbnailHeight": 0, + "PreviewWidth": 1024, + "PreviewHeight": 0, + "ProfileWidth": 128, + "ProfileHeight": 128 + }, + "EmailSettings": { + "SMTPUsername": "", + "SMTPPassword": "", + "SMTPServer": "", + "FeedbackEmail": "feedback@mattermost.com", + "FeedbackName": "", + "ApplePushServer": "", + "ApplePushCertPublic": "", + "ApplePushCertPrivate":"" + }, + "PrivacySettings": { + "ShowEmailAddress": false, + "ShowPhoneNumber": false, + "ShowSkypeId": false, + "ShowFullName": false + }, + "TeamSettings": { + "MaxUsersPerTeam": 150, + "AllowPublicLink": true, + "TermsLink": "/static/help/configure_links.html", + "PrivacyLink": "/static/help/configure_links.html", + "AboutLink": "/static/help/configure_links.html", + "HelpLink": "/static/help/configure_links.html", + "ReportProblemLink": "/static/help/configure_links.html", + "TourLink": "/static/help/configure_links.html", + "DefaultThemeColor": "#2389D7" + } +} diff --git a/docker-entry.sh b/docker-entry.sh new file mode 100755 index 000000000..10809fc1d --- /dev/null +++ b/docker-entry.sh @@ -0,0 +1,114 @@ +#!/bin/bash + +mkdir -p web/static/js + +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 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 -- cgit v1.2.3-1-g7c22 From 43a35119d453401d811c8e2ee289d60067dec442 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 16 Jun 2015 14:15:55 -0400 Subject: Modifications for sending local mail --- Dockerfile | 7 ++++++- config/config_docker.json | 7 ++++--- config/main.cf | 41 +++++++++++++++++++++++++++++++++++++++++ docker-entry.sh | 3 +++ 4 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 config/main.cf diff --git a/Dockerfile b/Dockerfile index 2e2ad002d..da57550c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,9 @@ 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 # @@ -79,6 +82,8 @@ RUN wget http://download.redis.io/redis-stable.tar.gz; \ # Copy over files ADD . /go/src/github.com/mattermost/platform +# Insert postfix config +ADD ./config/main.cf /etc/postfix/ RUN go get github.com/tools/godep RUN cd /go/src/github.com/mattermost/platform; godep restore @@ -89,4 +94,4 @@ RUN chmod +x /go/src/github.com/mattermost/platform/docker-entry.sh ENTRYPOINT /go/src/github.com/mattermost/platform/docker-entry.sh # Ports -EXPOSE 8065 +EXPOSE 80 diff --git a/config/config_docker.json b/config/config_docker.json index 470c41bb5..761f5a8e5 100644 --- a/config/config_docker.json +++ b/config/config_docker.json @@ -8,9 +8,9 @@ "FileLocation": "" }, "ServiceSettings": { - "SiteName": "", + "SiteName": "Mattermost Preview", "Domain": "", - "Mode" : "dev", + "Mode" : "prod", "AllowTesting" : false, "UseSSL": false, "Port": "80", @@ -56,7 +56,8 @@ "EmailSettings": { "SMTPUsername": "", "SMTPPassword": "", - "SMTPServer": "", + "SMTPServer": "localhost:25", + "UseTLS": false, "FeedbackEmail": "feedback@mattermost.com", "FeedbackName": "", "ApplePushServer": "", diff --git a/config/main.cf b/config/main.cf new file mode 100644 index 000000000..72eba333f --- /dev/null +++ b/config/main.cf @@ -0,0 +1,41 @@ +# See /usr/share/postfix/main.cf.dist for a commented, more complete version + + +# Debian specific: Specifying a file name will cause the first +# line of that file to be used as the name. The Debian default +# is /etc/mailname. +myorigin = mattermost.com +myhostname = mattermost.com + +smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) +biff = no + +# appending .domain is the MUA's job. +append_dot_mydomain = no + +# Uncomment the next line to generate "delayed mail" warnings +#delay_warning_time = 4h + +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 + +# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for +# information on enabling SSL in the smtp client. + +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-entry.sh b/docker-entry.sh index 10809fc1d..3a273e365 100755 --- a/docker-entry.sh +++ b/docker-entry.sh @@ -101,6 +101,9 @@ sleep 5 # ------------------------ +echo starting postfix +/etc/init.d/postfix restart + echo starting redis redis-server & -- cgit v1.2.3-1-g7c22 From e022e87b663c330cfb2595aa875cf6dad76f4dd2 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 16 Jun 2015 19:46:56 -0400 Subject: Using config.json instead of config_docker.json for docker. Note, this will break local dev builds. --- config/config.json | 12 +++---- config/config_docker.json | 84 ----------------------------------------------- docker-entry.sh | 5 ++- 3 files changed, 10 insertions(+), 91 deletions(-) delete mode 100644 config/config_docker.json diff --git a/config/config.json b/config/config.json index c75f2f15a..5bd66e8be 100644 --- a/config/config.json +++ b/config/config.json @@ -8,12 +8,12 @@ "FileLocation": "" }, "ServiceSettings": { - "SiteName": "XXXXXXMustBeFilledIn", - "Domain": "xxxxxxmustbefilledin.com", - "Mode" : "dev", + "SiteName": "Mattermost Preview", + "Domain": "", + "Mode" : "prod", "AllowTesting" : false, "UseSSL": false, - "Port": "8065", + "Port": "80", "Version": "developer", "Shards": { }, @@ -56,8 +56,8 @@ "EmailSettings": { "SMTPUsername": "", "SMTPPassword": "", - "SMTPServer": "", - "UseTLS": true, + "SMTPServer": "localhost:25", + "UseTLS": false, "FeedbackEmail": "feedback@xxxxxxmustbefilledin.com", "FeedbackName": "", "ApplePushServer": "", diff --git a/config/config_docker.json b/config/config_docker.json deleted file mode 100644 index 761f5a8e5..000000000 --- a/config/config_docker.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "LogSettings": { - "ConsoleEnable": true, - "ConsoleLevel": "DEBUG", - "FileEnable": true, - "FileLevel": "INFO", - "FileFormat": "", - "FileLocation": "" - }, - "ServiceSettings": { - "SiteName": "Mattermost Preview", - "Domain": "", - "Mode" : "prod", - "AllowTesting" : false, - "UseSSL": false, - "Port": "80", - "Version": "developer", - "Shards": { - }, - "InviteSalt": "4nAN4CuEJQ4G73RPA9DJrcVkbrGIE9SX", - "PublicLinkSalt": "zBXCZvnXQ5aRfzqPHgrK5G6wunsPzimE", - "ResetSalt": "GcloaPC5tjGCzwXApNJ23oSLUoP8LXQ4", - "AnalyticsUrl": "" - }, - "SqlSettings": { - "DriverName": "mysql", - "DataSource": "mmuser:mostest@tcp(localhost:3306)/mattermost_test", - "DataSourceReplicas": ["mmuser:mostest@tcp(localhost:3306)/mattermost_test"], - "MaxIdleConns": 10, - "MaxOpenConns": 10, - "Trace": false, - "AtRestEncryptKey": "4Uuoy2t1S204JUKXHGfALJL2J5q3jlEH" - }, - "RedisSettings": { - "DataSource": "localhost:6379", - "MaxOpenConns": 100 - }, - "AWSSettings": { - "S3AccessKeyId": "", - "S3SecretAccessKey": "", - "S3Bucket": "", - "S3Region": "", - "Route53AccessKeyId": "", - "Route53SecretAccessKey": "", - "Route53ZoneId": "", - "Route53Region": "" - }, - "ImageSettings": { - "ThumbnailWidth": 200, - "ThumbnailHeight": 0, - "PreviewWidth": 1024, - "PreviewHeight": 0, - "ProfileWidth": 128, - "ProfileHeight": 128 - }, - "EmailSettings": { - "SMTPUsername": "", - "SMTPPassword": "", - "SMTPServer": "localhost:25", - "UseTLS": false, - "FeedbackEmail": "feedback@mattermost.com", - "FeedbackName": "", - "ApplePushServer": "", - "ApplePushCertPublic": "", - "ApplePushCertPrivate":"" - }, - "PrivacySettings": { - "ShowEmailAddress": false, - "ShowPhoneNumber": false, - "ShowSkypeId": false, - "ShowFullName": false - }, - "TeamSettings": { - "MaxUsersPerTeam": 150, - "AllowPublicLink": true, - "TermsLink": "/static/help/configure_links.html", - "PrivacyLink": "/static/help/configure_links.html", - "AboutLink": "/static/help/configure_links.html", - "HelpLink": "/static/help/configure_links.html", - "ReportProblemLink": "/static/help/configure_links.html", - "TourLink": "/static/help/configure_links.html", - "DefaultThemeColor": "#2389D7" - } -} diff --git a/docker-entry.sh b/docker-entry.sh index 3a273e365..db6ccaa18 100755 --- a/docker-entry.sh +++ b/docker-entry.sh @@ -2,6 +2,9 @@ mkdir -p web/static/js +echo "127.0.0.1 dockerhost" >> /etc/hosts +/etc/init.d/networking restart + echo configuring mysql # SQL!!! @@ -111,7 +114,7 @@ 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 & +cd /go/src/github.com/mattermost/platform/; go run mattermost.go -config=config.json & echo starting compass watch cd /go/src/github.com/mattermost/platform/web/sass-files && compass watch -- cgit v1.2.3-1-g7c22 From 988d5371d500924b548a35a06fc84e79ebf6117a Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Tue, 16 Jun 2015 17:08:06 -0700 Subject: Added in basic changes necessary to fix some typos. Needs further tests and changes to other config files --- web/react/components/login.jsx | 6 +++--- web/static/config/config.js | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx index 8d82a4b62..39571bae1 100644 --- a/web/react/components/login.jsx +++ b/web/react/components/login.jsx @@ -52,20 +52,20 @@ var FindTeamDomain = React.createClass({
{ config.SiteName }
- Enter your {strings.TeamPlural} domain. + Enter your {strings.TeamPossessive} domain.

{ server_error } - +
- Don't remember your {strings.TeamPlural} domain? Find it here + Don't remember your {strings.TeamPossessive} domain? Find it here


diff --git a/web/static/config/config.js b/web/static/config/config.js index 080f16a30..04b188b75 100644 --- a/web/static/config/config.js +++ b/web/static/config/config.js @@ -33,6 +33,8 @@ var config = { var strings = { Team: "team", TeamPlural: "teams", + TeamPossessive: "team's", Company: "company", - CompanyPlural: "companies" -} + CompanyPlural: "companies", + CompanyPossessive: "company's" +}; -- cgit v1.2.3-1-g7c22 From 7d14343634aa0cc8b3990f806d1d3c9ed214e140 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Tue, 16 Jun 2015 22:54:56 -0800 Subject: changing port back --- config/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.json b/config/config.json index 5bd66e8be..80431c9de 100644 --- a/config/config.json +++ b/config/config.json @@ -13,7 +13,7 @@ "Mode" : "prod", "AllowTesting" : false, "UseSSL": false, - "Port": "80", + "Port": "8065", "Version": "developer", "Shards": { }, -- cgit v1.2.3-1-g7c22 From b41925da310aa717fb6100fcc498adc8f3176c30 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Tue, 16 Jun 2015 23:05:37 -0800 Subject: Fixing build --- config/config.json | 2 +- utils/mail.go | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/config/config.json b/config/config.json index 80431c9de..3d2c26716 100644 --- a/config/config.json +++ b/config/config.json @@ -10,7 +10,7 @@ "ServiceSettings": { "SiteName": "Mattermost Preview", "Domain": "", - "Mode" : "prod", + "Mode" : "dev", "AllowTesting" : false, "UseSSL": false, "Port": "8065", diff --git a/utils/mail.go b/utils/mail.go index 645dcae24..bf1cc9d46 100644 --- a/utils/mail.go +++ b/utils/mail.go @@ -40,23 +40,27 @@ func SendMail(to, subject, body string) *model.AppError { auth := smtp.PlainAuth("", Cfg.EmailSettings.SMTPUsername, Cfg.EmailSettings.SMTPPassword, host) + var conn net.Conn + var err error + if Cfg.EmailSettings.UseTLS { tlsconfig := &tls.Config{ InsecureSkipVerify: true, ServerName: host, } - conn, err := tls.Dial("tcp", Cfg.EmailSettings.SMTPServer, tlsconfig) + conn, err = tls.Dial("tcp", Cfg.EmailSettings.SMTPServer, tlsconfig) if err != nil { return model.NewAppError("SendMail", "Failed to open TLS connection", err.Error()) } - defer conn.Close() + } else { + conn, err = net.Dial("tcp", Cfg.EmailSettings.SMTPServer) + if err != nil { + return model.NewAppError("SendMail", "Failed to open connection", err.Error()) + } } - conn, err := net.Dial("tcp", Cfg.EmailSettings.SMTPServer) - if err != nil { - return model.NewAppError("SendMail", "Failed to open connection", err.Error()) - } + defer conn.Close() c, err := smtp.NewClient(conn, host) if err != nil { -- cgit v1.2.3-1-g7c22 From a3de48555ac8b2d6fd8c665bb2cfa5efa921018b Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Tue, 16 Jun 2015 23:10:20 -0800 Subject: Fixing build --- utils/config_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/config_test.go b/utils/config_test.go index 9067dc647..cc4917e9d 100644 --- a/utils/config_test.go +++ b/utils/config_test.go @@ -12,6 +12,7 @@ func TestConfig(t *testing.T) { LoadConfig("config.json") } +/* func TestEnvOverride(t *testing.T) { os.Setenv("MATTERMOST_DOMAIN", "testdomain.com") @@ -25,3 +26,4 @@ func TestEnvOverride(t *testing.T) { t.Fail() } } +*/ -- cgit v1.2.3-1-g7c22 From 5a8f8397167cec8cba29b70bb7dbdda9ba0265f7 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Tue, 16 Jun 2015 23:16:12 -0800 Subject: fixing ubild --- utils/config_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/config_test.go b/utils/config_test.go index cc4917e9d..f6746f3ac 100644 --- a/utils/config_test.go +++ b/utils/config_test.go @@ -4,7 +4,7 @@ package utils import ( - "os" + //"os" "testing" ) -- cgit v1.2.3-1-g7c22 From 8789b111033924e7b17d01801d02fc3b387d203d Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 17 Jun 2015 08:39:33 -0400 Subject: Resurrecting config_docker.json. Moving docker related files to docker directory. Added copyright info. --- Dockerfile | 8 +-- config/config.json | 4 +- config/config_docker.json | 85 ++++++++++++++++++++++++++++++++ config/main.cf | 41 ---------------- docker-entry.sh | 120 --------------------------------------------- docker/docker-entry.sh | 122 ++++++++++++++++++++++++++++++++++++++++++++++ docker/main.cf | 28 +++++++++++ utils/config_test.go | 4 +- 8 files changed, 243 insertions(+), 169 deletions(-) create mode 100644 config/config_docker.json delete mode 100644 config/main.cf delete mode 100755 docker-entry.sh create mode 100755 docker/docker-entry.sh create mode 100644 docker/main.cf diff --git a/Dockerfile b/Dockerfile index da57550c0..5c389c056 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +# Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. +# See License.txt for license information. FROM ubuntu:14.04 # Install Dependancies @@ -83,15 +85,15 @@ RUN wget http://download.redis.io/redis-stable.tar.gz; \ ADD . /go/src/github.com/mattermost/platform # Insert postfix config -ADD ./config/main.cf /etc/postfix/ +ADD ./docker/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-entry.sh -ENTRYPOINT /go/src/github.com/mattermost/platform/docker-entry.sh +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/config/config.json b/config/config.json index 3d2c26716..1b844c259 100644 --- a/config/config.json +++ b/config/config.json @@ -9,7 +9,7 @@ }, "ServiceSettings": { "SiteName": "Mattermost Preview", - "Domain": "", + "Domain": "xxxxxxmustbefilledin.com", "Mode" : "dev", "AllowTesting" : false, "UseSSL": false, @@ -56,7 +56,7 @@ "EmailSettings": { "SMTPUsername": "", "SMTPPassword": "", - "SMTPServer": "localhost:25", + "SMTPServer": "", "UseTLS": false, "FeedbackEmail": "feedback@xxxxxxmustbefilledin.com", "FeedbackName": "", diff --git a/config/config_docker.json b/config/config_docker.json new file mode 100644 index 000000000..f2e56bef8 --- /dev/null +++ b/config/config_docker.json @@ -0,0 +1,85 @@ +{ + "LogSettings": { + "ConsoleEnable": false, + "ConsoleLevel": "DEBUG", + "FileEnable": true, + "FileLevel": "INFO", + "FileFormat": "", + "FileLocation": "" + }, + "ServiceSettings": { + "SiteName": "Mattermost Preview", + "Domain": "", + "Mode" : "prod", + "AllowTesting" : false, + "UseSSL": false, + "Port": "80", + "Version": "developer", + "Shards": { + }, + "InviteSalt": "gxHVDcKUyP2y1eiyW8S8na1UYQAfq6J6", + "PublicLinkSalt": "TO3pTyXIZzwHiwyZgGql7lM7DG3zeId4", + "ResetSalt": "IPxFzSfnDFsNsRafZxz8NaYqFKhf9y2t", + "AnalyticsUrl": "" + }, + "SqlSettings": { + "DriverName": "mysql", + "DataSource": "mmuser:mostest@tcp(localhost:3306)/mattermost_test", + "DataSourceReplicas": ["mmuser:mostest@tcp(localhost:3306)/mattermost_test"], + "MaxIdleConns": 10, + "MaxOpenConns": 10, + "Trace": false, + "AtRestEncryptKey": "Ya0xMrybACJ3sZZVWQC7e31h5nSDWZFS" + }, + "RedisSettings": { + "DataSource": "localhost:6379", + "MaxOpenConns": 1000 + }, + "AWSSettings": { + "S3AccessKeyId": "", + "S3SecretAccessKey": "", + "S3Bucket": "", + "S3Region": "", + "Route53AccessKeyId": "", + "Route53SecretAccessKey": "", + "Route53ZoneId": "", + "Route53Region": "" + }, + "ImageSettings": { + "ThumbnailWidth": 200, + "ThumbnailHeight": 0, + "PreviewWidth": 1024, + "PreviewHeight": 0, + "ProfileWidth": 128, + "ProfileHeight": 128 + }, + "EmailSettings": { + "SMTPUsername": "", + "SMTPPassword": "", + "SMTPServer": "localhost:25", + "UseTLS": false, + "FeedbackEmail": "feedback@xxxxxxmustbefilledin.com", + "FeedbackName": "", + "ApplePushServer": "", + "ApplePushCertPublic": "", + "ApplePushCertPrivate": "" + }, + "PrivacySettings": { + "ShowEmailAddress": true, + "ShowPhoneNumber": true, + "ShowSkypeId": true, + "ShowFullName": true + }, + "TeamSettings": { + "MaxUsersPerTeam": 150, + "AllowPublicLink": true, + "AllowValet": false, + "TermsLink": "/static/help/configure_links.html", + "PrivacyLink": "/static/help/configure_links.html", + "AboutLink": "/static/help/configure_links.html", + "HelpLink": "/static/help/configure_links.html", + "ReportProblemLink": "/static/help/configure_links.html", + "TourLink": "/static/help/configure_links.html", + "DefaultThemeColor": "#2389D7" + } +} diff --git a/config/main.cf b/config/main.cf deleted file mode 100644 index 72eba333f..000000000 --- a/config/main.cf +++ /dev/null @@ -1,41 +0,0 @@ -# See /usr/share/postfix/main.cf.dist for a commented, more complete version - - -# Debian specific: Specifying a file name will cause the first -# line of that file to be used as the name. The Debian default -# is /etc/mailname. -myorigin = mattermost.com -myhostname = mattermost.com - -smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) -biff = no - -# appending .domain is the MUA's job. -append_dot_mydomain = no - -# Uncomment the next line to generate "delayed mail" warnings -#delay_warning_time = 4h - -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 - -# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for -# information on enabling SSL in the smtp client. - -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-entry.sh b/docker-entry.sh deleted file mode 100755 index db6ccaa18..000000000 --- a/docker-entry.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/bash - -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.json & - -echo starting compass watch -cd /go/src/github.com/mattermost/platform/web/sass-files && compass watch diff --git a/docker/docker-entry.sh b/docker/docker-entry.sh new file mode 100755 index 000000000..cfa589041 --- /dev/null +++ b/docker/docker-entry.sh @@ -0,0 +1,122 @@ +#!/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/main.cf b/docker/main.cf new file mode 100644 index 000000000..ed97d37ef --- /dev/null +++ b/docker/main.cf @@ -0,0 +1,28 @@ +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/utils/config_test.go b/utils/config_test.go index f6746f3ac..9067dc647 100644 --- a/utils/config_test.go +++ b/utils/config_test.go @@ -4,7 +4,7 @@ package utils import ( - //"os" + "os" "testing" ) @@ -12,7 +12,6 @@ func TestConfig(t *testing.T) { LoadConfig("config.json") } -/* func TestEnvOverride(t *testing.T) { os.Setenv("MATTERMOST_DOMAIN", "testdomain.com") @@ -26,4 +25,3 @@ func TestEnvOverride(t *testing.T) { t.Fail() } } -*/ -- cgit v1.2.3-1-g7c22 From 6eb3775956974c510122261346edc5fe230f3cf3 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 17 Jun 2015 11:50:51 -0400 Subject: Adding check of email configuation settings when config file is loaded --- utils/config.go | 5 +++ utils/mail.go | 98 ++++++++++++++++++++++++++++++++++++++------------------- 2 files changed, 71 insertions(+), 32 deletions(-) diff --git a/utils/config.go b/utils/config.go index 745887c70..418041706 100644 --- a/utils/config.go +++ b/utils/config.go @@ -222,6 +222,11 @@ func LoadConfig(fileName string) { config.ServiceSettings.Domain = os.Getenv("MATTERMOST_DOMAIN") } + // Validates our mail settings + if err := CheckMailSettings(); err != nil { + l4g.Error("Email settings are not valid err=%v", err) + } + configureLog(config.LogSettings) Cfg = &config diff --git a/utils/mail.go b/utils/mail.go index bf1cc9d46..2fb7f801d 100644 --- a/utils/mail.go +++ b/utils/mail.go @@ -13,32 +13,27 @@ import ( "net/smtp" ) -func SendMail(to, subject, body string) *model.AppError { - - fromMail := mail.Address{"", Cfg.EmailSettings.FeedbackEmail} - toMail := mail.Address{"", to} - - headers := make(map[string]string) - headers["From"] = fromMail.String() - headers["To"] = toMail.String() - headers["Subject"] = subject - headers["MIME-version"] = "1.0" - headers["Content-Type"] = "text/html" - - message := "" - for k, v := range headers { - message += fmt.Sprintf("%s: %s\r\n", k, v) - } - message += "\r\n" + body + "" - +func CheckMailSettings() *model.AppError { if len(Cfg.EmailSettings.SMTPServer) == 0 { - l4g.Warn("Skipping sending of email because EmailSettings are not configured") - return nil + return model.NewAppError("CheckMailSettings", "No email settings present, mail will not be sent", "") } + conn, err := connectToSMTPServer() + if err != nil { + return err + } + defer conn.Close() + c, err2 := newSMTPClient(conn) + if err2 != nil { + return err + } + defer c.Quit() + defer c.Close() - host, _, _ := net.SplitHostPort(Cfg.EmailSettings.SMTPServer) + return nil +} - auth := smtp.PlainAuth("", Cfg.EmailSettings.SMTPUsername, Cfg.EmailSettings.SMTPPassword, host) +func connectToSMTPServer() (net.Conn, *model.AppError) { + host, _, _ := net.SplitHostPort(Cfg.EmailSettings.SMTPServer) var conn net.Conn var err error @@ -51,38 +46,77 @@ func SendMail(to, subject, body string) *model.AppError { conn, err = tls.Dial("tcp", Cfg.EmailSettings.SMTPServer, tlsconfig) if err != nil { - return model.NewAppError("SendMail", "Failed to open TLS connection", err.Error()) + return nil, model.NewAppError("SendMail", "Failed to open TLS connection", err.Error()) } } else { conn, err = net.Dial("tcp", Cfg.EmailSettings.SMTPServer) if err != nil { - return model.NewAppError("SendMail", "Failed to open connection", err.Error()) + return nil, model.NewAppError("SendMail", "Failed to open connection", err.Error()) } } - defer conn.Close() + return conn, nil +} +func newSMTPClient(conn net.Conn) (*smtp.Client, *model.AppError) { + host, _, _ := net.SplitHostPort(Cfg.EmailSettings.SMTPServer) c, err := smtp.NewClient(conn, host) if err != nil { l4g.Error("Failed to open a connection to SMTP server %v", err) - return model.NewAppError("SendMail", "Failed to open TLS connection", err.Error()) + return nil, model.NewAppError("SendMail", "Failed to open TLS connection", err.Error()) } - defer c.Quit() - defer c.Close() - // GO does not support plain auth over a non encrypted connection. // so if not tls then no auth + auth := smtp.PlainAuth("", Cfg.EmailSettings.SMTPUsername, Cfg.EmailSettings.SMTPPassword, host) if Cfg.EmailSettings.UseTLS { if err = c.Auth(auth); err != nil { - return model.NewAppError("SendMail", "Failed to authenticate on SMTP server", err.Error()) + return nil, model.NewAppError("SendMail", "Failed to authenticate on SMTP server", err.Error()) } } + return c, nil +} + +func SendMail(to, subject, body string) *model.AppError { + + fromMail := mail.Address{"", Cfg.EmailSettings.FeedbackEmail} + toMail := mail.Address{"", to} + + headers := make(map[string]string) + headers["From"] = fromMail.String() + headers["To"] = toMail.String() + headers["Subject"] = subject + headers["MIME-version"] = "1.0" + headers["Content-Type"] = "text/html" + + message := "" + for k, v := range headers { + message += fmt.Sprintf("%s: %s\r\n", k, v) + } + message += "\r\n" + body + "" + + if len(Cfg.EmailSettings.SMTPServer) == 0 { + l4g.Warn("Skipping sending of email because EmailSettings are not configured") + return nil + } + + conn, err1 := connectToSMTPServer() + if err1 != nil { + return err1 + } + defer conn.Close() + + c, err2 := newSMTPClient(conn) + if err2 != nil { + return err2 + } + defer c.Quit() + defer c.Close() - if err = c.Mail(fromMail.Address); err != nil { + if err := c.Mail(fromMail.Address); err != nil { return model.NewAppError("SendMail", "Failed to add from email address", err.Error()) } - if err = c.Rcpt(toMail.Address); err != nil { + if err := c.Rcpt(toMail.Address); err != nil { return model.NewAppError("SendMail", "Failed to add to email address", err.Error()) } -- cgit v1.2.3-1-g7c22 From 20ead3585d77d32862065749bdb25eed9fee0f25 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Wed, 17 Jun 2015 12:25:41 -0400 Subject: fix an auto-complete bug for mentions --- web/react/components/textbox.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/react/components/textbox.jsx b/web/react/components/textbox.jsx index 45798809f..7a4762e07 100644 --- a/web/react/components/textbox.jsx +++ b/web/react/components/textbox.jsx @@ -204,7 +204,7 @@ module.exports = React.createClass({ // If there is a space after the last @, nothing to do. if (lastSpace > atIndex || lastCharSpace > atIndex) { - this.setState({ mentionText: '-1' }); + this.updateMentionTab('-1', null); return; } -- cgit v1.2.3-1-g7c22 From bf1e35bc19d6cb1308e328443a4a411eae6549ae Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Wed, 17 Jun 2015 09:53:15 -0700 Subject: Simplified code changes --- config/config.json | 1 - web/react/components/login.jsx | 4 ++-- web/static/config/config.js | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/config/config.json b/config/config.json index 3d2c26716..0ca072194 100644 --- a/config/config.json +++ b/config/config.json @@ -56,7 +56,6 @@ "EmailSettings": { "SMTPUsername": "", "SMTPPassword": "", - "SMTPServer": "localhost:25", "UseTLS": false, "FeedbackEmail": "feedback@xxxxxxmustbefilledin.com", "FeedbackName": "", diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx index 85be3d45b..65f1da1f8 100644 --- a/web/react/components/login.jsx +++ b/web/react/components/login.jsx @@ -52,7 +52,7 @@ var FindTeamDomain = React.createClass({
{ config.SiteName }
- Enter your {strings.TeamPossessive} domain. + Enter your {strings.Team}'s domain.

@@ -65,7 +65,7 @@ var FindTeamDomain = React.createClass({
- Don't remember your {strings.TeamPossessive} domain? Find it here + Don't remember your {strings.Team}'s domain? Find it here


diff --git a/web/static/config/config.js b/web/static/config/config.js index 12cbb4019..a9a3e732e 100644 --- a/web/static/config/config.js +++ b/web/static/config/config.js @@ -33,8 +33,6 @@ var config = { var strings = { Team: "team", TeamPlural: "teams", - TeamPossessive: "team's", Company: "company", CompanyPlural: "companies", - CompanyPossessive: "company's" }; -- cgit v1.2.3-1-g7c22 From 3d1975dea40c96ca65f7203cf32a11f9fd65bfc3 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Wed, 17 Jun 2015 09:54:06 -0700 Subject: Removed unnecessary comma --- web/static/config/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/static/config/config.js b/web/static/config/config.js index a9a3e732e..82d4bbf70 100644 --- a/web/static/config/config.js +++ b/web/static/config/config.js @@ -34,5 +34,5 @@ var strings = { Team: "team", TeamPlural: "teams", Company: "company", - CompanyPlural: "companies", + CompanyPlural: "companies" }; -- cgit v1.2.3-1-g7c22 From f74ced758f083f6d7b75ad08fe2d18303d0e6465 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Tue, 16 Jun 2015 17:08:06 -0700 Subject: Added in basic changes necessary to fix some typos. Needs further tests and changes to other config files --- web/react/components/login.jsx | 6 +++--- web/static/config/config.js | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx index 103a93bc6..85be3d45b 100644 --- a/web/react/components/login.jsx +++ b/web/react/components/login.jsx @@ -52,20 +52,20 @@ var FindTeamDomain = React.createClass({
{ config.SiteName }
- Enter your {strings.TeamPlural} domain. + Enter your {strings.TeamPossessive} domain.

{ server_error } - +
- Don't remember your {strings.TeamPlural} domain? Find it here + Don't remember your {strings.TeamPossessive} domain? Find it here


diff --git a/web/static/config/config.js b/web/static/config/config.js index 5a12942c8..12cbb4019 100644 --- a/web/static/config/config.js +++ b/web/static/config/config.js @@ -33,6 +33,8 @@ var config = { var strings = { Team: "team", TeamPlural: "teams", + TeamPossessive: "team's", Company: "company", - CompanyPlural: "companies" -} + CompanyPlural: "companies", + CompanyPossessive: "company's" +}; -- cgit v1.2.3-1-g7c22 From 519bebcaeeef46bbe8bbc8ac17e348316fd4903f Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Wed, 17 Jun 2015 09:53:15 -0700 Subject: Simplified code changes --- config/config.json | 1 - web/react/components/login.jsx | 4 ++-- web/static/config/config.js | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/config/config.json b/config/config.json index 3d2c26716..0ca072194 100644 --- a/config/config.json +++ b/config/config.json @@ -56,7 +56,6 @@ "EmailSettings": { "SMTPUsername": "", "SMTPPassword": "", - "SMTPServer": "localhost:25", "UseTLS": false, "FeedbackEmail": "feedback@xxxxxxmustbefilledin.com", "FeedbackName": "", diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx index 85be3d45b..65f1da1f8 100644 --- a/web/react/components/login.jsx +++ b/web/react/components/login.jsx @@ -52,7 +52,7 @@ var FindTeamDomain = React.createClass({
{ config.SiteName }
- Enter your {strings.TeamPossessive} domain. + Enter your {strings.Team}'s domain.

@@ -65,7 +65,7 @@ var FindTeamDomain = React.createClass({
- Don't remember your {strings.TeamPossessive} domain? Find it here + Don't remember your {strings.Team}'s domain? Find it here


diff --git a/web/static/config/config.js b/web/static/config/config.js index 12cbb4019..a9a3e732e 100644 --- a/web/static/config/config.js +++ b/web/static/config/config.js @@ -33,8 +33,6 @@ var config = { var strings = { Team: "team", TeamPlural: "teams", - TeamPossessive: "team's", Company: "company", CompanyPlural: "companies", - CompanyPossessive: "company's" }; -- cgit v1.2.3-1-g7c22 From 806eb40f5f3d6c89b7d06fb19ec75420ff4e9c28 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Wed, 17 Jun 2015 09:54:06 -0700 Subject: Removed unnecessary comma --- web/static/config/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/static/config/config.js b/web/static/config/config.js index a9a3e732e..82d4bbf70 100644 --- a/web/static/config/config.js +++ b/web/static/config/config.js @@ -34,5 +34,5 @@ var strings = { Team: "team", TeamPlural: "teams", Company: "company", - CompanyPlural: "companies", + CompanyPlural: "companies" }; -- cgit v1.2.3-1-g7c22 From 2a427254f4263b1d0b5f7c44268a0d34948971a7 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Wed, 17 Jun 2015 11:16:03 -0700 Subject: Fixing compatibility --- config/config.json | 1 + 1 file changed, 1 insertion(+) diff --git a/config/config.json b/config/config.json index 0ca072194..6e5fb8d0e 100644 --- a/config/config.json +++ b/config/config.json @@ -56,6 +56,7 @@ "EmailSettings": { "SMTPUsername": "", "SMTPPassword": "", + "SMTPServer": "", "UseTLS": false, "FeedbackEmail": "feedback@xxxxxxmustbefilledin.com", "FeedbackName": "", -- cgit v1.2.3-1-g7c22 From cbc3f4c5c1824695877c2e1419493d92acd97543 Mon Sep 17 00:00:00 2001 From: it33 Date: Thu, 18 Jun 2015 06:42:40 -0700 Subject: Update NOTICE.txt --- NOTICE.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/NOTICE.txt b/NOTICE.txt index 07c6a8bf4..a58e425bb 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1,4 +1,9 @@ Mattermost Platform Preview Copyright 2015 SpinPunch, Inc. -Regular expression support is provided by the PCRE library package, which is open source software, written by Philip Hazel, and copyright by the University of Cambridge, England. The original software is available from ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ +This product contains a modified portion of 'draw2d', a Go library to draw 2d geometrical forms on images by Laurent Le Goff + +* LICENSE: + * http://opensource.org/licenses/BSD-3-Clause (BSD 3-Clause) +* HOMEPAGE: + * https://code.google.com/p/draw2d/ -- cgit v1.2.3-1-g7c22 From e05f9bf15e51a918ed3495ec131c2c462917d8f1 Mon Sep 17 00:00:00 2001 From: it33 Date: Thu, 18 Jun 2015 07:04:52 -0700 Subject: Update NOTICE.txt --- NOTICE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NOTICE.txt b/NOTICE.txt index a58e425bb..1d867eb5b 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1,5 +1,5 @@ Mattermost Platform Preview -Copyright 2015 SpinPunch, Inc. +© 2015 Spinpunch, Inc. All Rights Reserved. See LICENSE.txt for license information. This product contains a modified portion of 'draw2d', a Go library to draw 2d geometrical forms on images by Laurent Le Goff -- cgit v1.2.3-1-g7c22 From 1f66c44632369f635b397dfb2b01a026f39b51a5 Mon Sep 17 00:00:00 2001 From: it33 Date: Thu, 18 Jun 2015 07:05:42 -0700 Subject: Update NOTICE.txt --- NOTICE.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NOTICE.txt b/NOTICE.txt index 1d867eb5b..fd5fc74b5 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1,6 +1,8 @@ Mattermost Platform Preview © 2015 Spinpunch, Inc. All Rights Reserved. See LICENSE.txt for license information. +NOTICES: + This product contains a modified portion of 'draw2d', a Go library to draw 2d geometrical forms on images by Laurent Le Goff * LICENSE: -- cgit v1.2.3-1-g7c22 From ce03ed6415642868df615773e76b35979033b21e Mon Sep 17 00:00:00 2001 From: it33 Date: Thu, 18 Jun 2015 08:35:25 -0700 Subject: Update "Theme" to "Theme Color Options" Needed to make marketing screen look nice. --- web/react/components/user_settings.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/react/components/user_settings.jsx b/web/react/components/user_settings.jsx index a9c2433f2..4dfe6b74a 100644 --- a/web/react/components/user_settings.jsx +++ b/web/react/components/user_settings.jsx @@ -1056,7 +1056,7 @@ var AppearanceTab = React.createClass({ themeSection = ( -- cgit v1.2.3-1-g7c22 From c4788e0473d662413d9854e2e6e518ceb860cbbe Mon Sep 17 00:00:00 2001 From: it33 Date: Thu, 18 Jun 2015 08:38:07 -0700 Subject: Changed "Theme Color Option" to "Theme Color" --- web/react/components/user_settings.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/react/components/user_settings.jsx b/web/react/components/user_settings.jsx index 4dfe6b74a..110634b50 100644 --- a/web/react/components/user_settings.jsx +++ b/web/react/components/user_settings.jsx @@ -1056,7 +1056,7 @@ var AppearanceTab = React.createClass({ themeSection = ( -- cgit v1.2.3-1-g7c22 From bf2c8b3332be0c3fdee332a79b2c96078e8562f9 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Thu, 18 Jun 2015 14:40:11 -0400 Subject: fixes mm-1297 can now scroll through more than 5 images --- web/react/components/post_body.jsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx index 55fc32c33..3079917ec 100644 --- a/web/react/components/post_body.jsx +++ b/web/react/components/post_body.jsx @@ -85,20 +85,22 @@ module.exports = React.createClass({ var postFiles = []; var images = []; if (filenames) { - for (var i = 0; i < filenames.length && i < Constants.MAX_DISPLAY_FILES; i++) { + for (var i = 0; i < filenames.length; i++) { var fileInfo = utils.splitFileLocation(filenames[i]); if (Object.keys(fileInfo).length === 0) continue; var type = utils.getFileType(fileInfo.ext); if (type === "image") { - postFiles.push( -
-
-
- ); + if (i < Constants.MAX_DISPLAY_FILES) { + postFiles.push( +
+
+
+ ); + } images.push(filenames[i]); - } else { + } else if (i < Constants.MAX_DISPLAY_FILES) { postFiles.push(
-- cgit v1.2.3-1-g7c22 From 4cabe1baea940f486463296a2e7cf8a40975d9d8 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Thu, 18 Jun 2015 10:55:51 -0800 Subject: fix for dockerhost HELIUM --- api/context.go | 4 ++++ config/config.json | 4 ++-- model/utils.go | 1 + web/react/utils/constants.jsx | 1 + web/react/utils/utils.jsx | 13 +++++++++++-- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/api/context.go b/api/context.go index 16105c8af..501e4e77f 100644 --- a/api/context.go +++ b/api/context.go @@ -303,6 +303,10 @@ func IsTestDomain(r *http.Request) bool { return true } + if strings.Index(r.Host, "dockerhost") == 0 { + return true + } + if strings.Index(r.Host, "test") == 0 { return true } diff --git a/config/config.json b/config/config.json index 1b844c259..82e40a1c5 100644 --- a/config/config.json +++ b/config/config.json @@ -1,7 +1,7 @@ { "LogSettings": { - "ConsoleEnable": false, - "ConsoleLevel": "DEBUG", + "ConsoleEnable": true, + "ConsoleLevel": "INFO", "FileEnable": true, "FileLevel": "INFO", "FileFormat": "", diff --git a/model/utils.go b/model/utils.go index 8b597000a..2541247de 100644 --- a/model/utils.go +++ b/model/utils.go @@ -160,6 +160,7 @@ var reservedDomains = []string{ "channel", "internal", "localhost", + "dockerhost", "stag", "post", "cluster", diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx index 0a3b1db3d..deb07409b 100644 --- a/web/react/utils/constants.jsx +++ b/web/react/utils/constants.jsx @@ -61,6 +61,7 @@ module.exports = { "channel", "internal", "localhost", + "dockerhost", "stag", "post", "cluster", diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 628d92342..e57088614 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -28,6 +28,9 @@ module.exports.isTestDomain = function() { if ((/^localhost/).test(window.location.hostname)) return true; + if ((/^dockerhost/).test(window.location.hostname)) + return true; + if ((/^test/).test(window.location.hostname)) return true; @@ -75,8 +78,14 @@ module.exports.getDomainWithOutSub = function() { var parts = window.location.host.split("."); - if (parts.length == 1) - return "localhost:8065"; + if (parts.length == 1) { + if (parts[0].indexOf("dockerhost") > -1) { + return "dockerhost:8065"; + } + else { + return "localhost:8065"; + } + } return parts[1] + "." + parts[2]; } -- cgit v1.2.3-1-g7c22 From dcc09b69918ec17ebe4727aeca1b887e6a8beefc Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Thu, 18 Jun 2015 15:31:15 -0400 Subject: If feedback email is not specified then autodetect domain and use feedback@domain --- config/config_docker.json | 2 +- utils/config.go | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/config/config_docker.json b/config/config_docker.json index f2e56bef8..a90722a1d 100644 --- a/config/config_docker.json +++ b/config/config_docker.json @@ -58,7 +58,7 @@ "SMTPPassword": "", "SMTPServer": "localhost:25", "UseTLS": false, - "FeedbackEmail": "feedback@xxxxxxmustbefilledin.com", + "FeedbackEmail": "", "FeedbackName": "", "ApplePushServer": "", "ApplePushCertPublic": "", diff --git a/utils/config.go b/utils/config.go index 418041706..23bd3e85a 100644 --- a/utils/config.go +++ b/utils/config.go @@ -6,6 +6,7 @@ package utils import ( l4g "code.google.com/p/log4go" "encoding/json" + "net/mail" "os" "path/filepath" ) @@ -222,15 +223,20 @@ func LoadConfig(fileName string) { config.ServiceSettings.Domain = os.Getenv("MATTERMOST_DOMAIN") } - // Validates our mail settings - if err := CheckMailSettings(); err != nil { - l4g.Error("Email settings are not valid err=%v", err) + // Check for a valid email for feedback, if not then do feedback@domain + if _, err := mail.ParseAddress(config.EmailSettings.FeedbackEmail); err != nil { + config.EmailSettings.FeedbackEmail = "feedback@" + config.ServiceSettings.Domain } configureLog(config.LogSettings) Cfg = &config SanitizeOptions = getSanitizeOptions() + + // Validates our mail settings + if err := CheckMailSettings(); err != nil { + l4g.Error("Email settings are not valid err=%v", err) + } } func getSanitizeOptions() map[string]bool { -- cgit v1.2.3-1-g7c22 From 78bc7a326feb9be7eaff312d5d7fcb7634c6aa5b Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Thu, 18 Jun 2015 17:39:12 -0400 Subject: fixes br tags causing new lines --- web/react/components/create_post.jsx | 4 +--- web/react/utils/utils.jsx | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx index 191be9bf8..a534e495d 100644 --- a/web/react/components/create_post.jsx +++ b/web/react/components/create_post.jsx @@ -31,9 +31,7 @@ module.exports = React.createClass({ post.message = this.state.messageText; - var repRegex = new RegExp("
", "g"); - if (post.message.replace(repRegex, " ").trim().length === 0 - && this.state.previews.length === 0) { + if (post.message.trim().length === 0 && this.state.previews.length === 0) { return; } diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index e57088614..fb4f3a34e 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -366,9 +366,6 @@ module.exports.textToJsx = function(text, options) { if (options && options['singleline']) { var repRegex = new RegExp("\n", "g"); text = text.replace(repRegex, " "); - } else { - var repRegex = new RegExp("\n", "g"); - text = text.replace(repRegex, "
"); } var searchTerm = "" @@ -392,7 +389,7 @@ module.exports.textToJsx = function(text, options) { implicitKeywords[keywordArray[i]] = true; } - var lines = text.split("
"); + var lines = text.split("\n"); var urlMatcher = new LinkifyIt(); for (var i = 0; i < lines.length; i++) { var line = lines[i]; -- cgit v1.2.3-1-g7c22 From 0377d68335b38b09c0693e5b2833ddecfb3e4dc6 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Thu, 18 Jun 2015 23:14:43 -0800 Subject: Updating readme --- README.md | 97 +++++++++++++++++++++++++++++---------------------- scripts/README_DEV.md | 42 ++++++++++++++++++++++ 2 files changed, 97 insertions(+), 42 deletions(-) create mode 100644 scripts/README_DEV.md diff --git a/README.md b/README.md index c3e844f61..f8d269f9a 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -**Mattermost Preview
** -**Team Communication Service
** +**Mattermost Preview** +**Team Communication Service** **Version 0.40** What matters most to your team? =============================== -Words have power.
-Mattermost serves teams who use words to shape the future.
+Words have power. +Mattermost serves teams who use words to shape the future. The words you choose are up to you. *- SpinPunch* @@ -18,49 +18,62 @@ You're installing "Mattermost Preview", a pre-released 0.40 version intended for That said, any issues at all, please let us know on the Mattermost forum at: http://bit.ly/1MY1kul -Developer Machine Setup (Mac) ------------------------------ +Developer Machine Setup (Docker/Mac) +------------------------------------ -DOCKER SETUP - -1. Follow the instructions at http://docs.docker.com/installation/mac/ -
a) Use the Boot2Docker command-line utility -
b) If you do command-line setup use: `boot2docker init eval “$(boot2docker shellinit)”` +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` -3. Add a line to your /etc/hosts that goes ` dockerhost` -4. Run `boot2docker shellinit` and copy the export statements to your ~/.bash_profile - -Any issues? Please let us know on our forums at: http://bit.ly/1MY1kul - -GO SETUP - -1. Download Go from http://golang.org/dl/ - -NODE.JS SETUP - -1. Install homebrew from http://brew.sh -2. `brew install node` - -COMPASS SETUP - -1. Make sure you have the latest version of Ruby -2. `gem install compass` - -MATTERMOST SETUP - -1. Make a project directory for Mattermost, which we'll call **$PROJECT** for the rest of these instructions -2. Make a `go` directory in your $PROJECT directory -3. Open or create your ~/.bash_profile and add the following lines:
`export GOPATH=$PROJECT/go`
`export PATH=$PATH:$GOPATH/bin`
then refresh your bash profile with `source ~/.bash_profile` -4. Then use `cd $GOPATH` and `mkdir -p src/github.com/mattermost` then cd into this directory and run `git clone github.com/mattermost/platform.git` -5. If you do not have Mercurial, download it with: `brew install mercurial` -6. Then do `cd platform` and `make test`. Provided the test runs fine, you now have a complete build environment. -7. Use `make run` to run your code - -Any issues? Please let us know on our forums at: http://bit.ly/1MY1kul +3. Add a line to your /etc/hosts that goes ` dockerhost` +4. Run `boot2docker shellinit` and copy the export statements to your ~/.bash_profile +5. Run `docker run --name mattermost-dev -d --publish 8065:80 mattermost/platform:helium` +6. When docker is done fetching the image, open http://dockerhost:8065/ in your browser + +If you want to work with the latest bits in the repo you can run the cmd `docker run --name mattermost-dev -d --publish 8065:80 mattermost/platform:latest` +You can update to the latest bits by running `docker pull mattermost/platform:latest` + +If you wish to remove mattermost-dev use the following commands +1. docker stop mattermost-dev +2. docker rm -v mattermost-dev + +AWS Elastic Beanstalk Setup (Docker) +------------------------------------ + +1. From the AWS console select Elastic Beanstalk +2. Select "Create New Application" from the top right. +3. Name the application and press next +4. Select "Create a web server" environment. +5. If asked, select create and AIM role and instance profile and press next. +6. For predefined configuration select docker. Environment type may be left at default. +7. For application source, select upload your own and upload Dockerrun.aws.json from docker/Dockerrun.aws.json. Everything else may be left at default. +8. Select an environment name, this is how you will refer to your environment. Make sure the URL is available then press next. +9. The options on the additional resources page may be left at default unless you wish to change them. Press Next. +10. On the configuration details place. Select an instance type of t2.small or larger. +11. You can set the configuration details as you please but they may be left at their defaults. When you are done press next. +12. Environment tags my be left blank. Press next. +13. You will be asked to review your information. Press Launch. +14. Up near the top of the dashboard you will see a domain of the form \*.elasticbeanstalk.com copy this as you will need it later. + +15. From the AWS console select route 53 +16. From the sidebar select Hosted Zones +17. Select the domain you want to use or create a new one. +18. Modify an existing CNAME record set or create a new one with the name * and the value of the domain you copied in step 13. +19. Save the record set + +20. Return the Elastic Beanstalk from the AWS console. +21. Select the environment you created. +22. Select configuration from the sidebar. +23. Click the gear beside software configuration. +24. Add an environment property with the name “MATTERMOST\_DOMAIN” and a value of the domain you mapped in route 53. For example if your domain is \*.example.com you would enter example.com not www.example.com. +25. Select apply. +26. Return to the dashboard on the sidebar and wait for beanstalk update the environment. +27. Try it out by entering the domain you mapped into your browser. License ------- -This software uses the Apache 2.0 open source license. For more details see: http://bit.ly/1Lc25Sv
+This software uses the Apache 2.0 open source license. For more details see: http://bit.ly/1Lc25Sv + **XXXXXX TODO: Test install procedures** diff --git a/scripts/README_DEV.md b/scripts/README_DEV.md new file mode 100644 index 000000000..6a2dfc54d --- /dev/null +++ b/scripts/README_DEV.md @@ -0,0 +1,42 @@ +Developer Machine Setup (Mac) +----------------------------- + +DOCKER SETUP + +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` +3. Add a line to your /etc/hosts that goes ` dockerhost` +4. Run `boot2docker shellinit` and copy the export statements to your ~/.bash_profile + +Any issues? Please let us know on our forums at: http://bit.ly/1MY1kul + +GO SETUP + +1. Download Go from http://golang.org/dl/ + +NODE.JS SETUP + +1. Install homebrew from http://brew.sh +2. `brew install node` + +COMPASS SETUP + +1. Make sure you have the latest version of Ruby +2. `gem install compass` + +MATTERMOST SETUP + +1. Make a project directory for Mattermost, which we'll call **$PROJECT** for the rest of these instructions +2. Make a `go` directory in your $PROJECT directory +3. Open or create your ~/.bash_profile and add the following lines: + `export GOPATH=$PROJECT/go` + `export PATH=$PATH:$GOPATH/bin` + then refresh your bash profile with `source ~/.bash_profile` +4. Then use `cd $GOPATH` and `mkdir -p src/github.com/mattermost` then cd into this directory and run `git clone github.com/mattermost/platform.git` +5. If you do not have Mercurial, download it with: `brew install mercurial` +6. Then do `cd platform` and `make test`. Provided the test runs fine, you now have a complete build environment. +7. Use `make run` to run your code + +Any issues? Please let us know on our forums at: http://bit.ly/1MY1kul \ No newline at end of file -- cgit v1.2.3-1-g7c22 From a6078ad7f8a0eff11b2907bb3f5b1f7e08b0c4ce Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Thu, 18 Jun 2015 23:18:54 -0800 Subject: tweaking readme --- README.md | 65 ++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index f8d269f9a..0a2ff2b38 100644 --- a/README.md +++ b/README.md @@ -30,44 +30,45 @@ Developer Machine Setup (Docker/Mac) 5. Run `docker run --name mattermost-dev -d --publish 8065:80 mattermost/platform:helium` 6. When docker is done fetching the image, open http://dockerhost:8065/ in your browser -If you want to work with the latest bits in the repo you can run the cmd `docker run --name mattermost-dev -d --publish 8065:80 mattermost/platform:latest` -You can update to the latest bits by running `docker pull mattermost/platform:latest` +If you want to work with the latest bits in the repo you can run the cmd +`docker run --name mattermost-dev -d --publish 8065:80 mattermost/platform:latest` -If you wish to remove mattermost-dev use the following commands -1. docker stop mattermost-dev -2. docker rm -v mattermost-dev +You can update to the latest bits by running +`docker pull mattermost/platform:latest` + +If you wish to remove mattermost-dev use the following commands +1. `docker stop mattermost-dev` +2. `docker rm -v mattermost-dev` AWS Elastic Beanstalk Setup (Docker) ------------------------------------ -1. From the AWS console select Elastic Beanstalk -2. Select "Create New Application" from the top right. -3. Name the application and press next -4. Select "Create a web server" environment. -5. If asked, select create and AIM role and instance profile and press next. -6. For predefined configuration select docker. Environment type may be left at default. -7. For application source, select upload your own and upload Dockerrun.aws.json from docker/Dockerrun.aws.json. Everything else may be left at default. -8. Select an environment name, this is how you will refer to your environment. Make sure the URL is available then press next. -9. The options on the additional resources page may be left at default unless you wish to change them. Press Next. -10. On the configuration details place. Select an instance type of t2.small or larger. -11. You can set the configuration details as you please but they may be left at their defaults. When you are done press next. -12. Environment tags my be left blank. Press next. -13. You will be asked to review your information. Press Launch. -14. Up near the top of the dashboard you will see a domain of the form \*.elasticbeanstalk.com copy this as you will need it later. - -15. From the AWS console select route 53 +1. From the AWS console select Elastic Beanstalk +2. Select "Create New Application" from the top right. +3. Name the application and press next +4. Select "Create a web server" environment. +5. If asked, select create and AIM role and instance profile and press next. +6. For predefined configuration select docker. Environment type may be left at default. +7. For application source, select upload your own and upload Dockerrun.aws.json from docker/Dockerrun.aws.json. Everything else may be left at default. +8. Select an environment name, this is how you will refer to your environment. Make sure the URL is available then press next. +9. The options on the additional resources page may be left at default unless you wish to change them. Press Next. +10. On the configuration details place. Select an instance type of t2.small or larger. +11. You can set the configuration details as you please but they may be left at their defaults. When you are done press next. +12. Environment tags my be left blank. Press next. +13. You will be asked to review your information. Press Launch. +14. Up near the top of the dashboard you will see a domain of the form \*.elasticbeanstalk.com copy this as you will need it later. +15. From the AWS console select route 53 16. From the sidebar select Hosted Zones -17. Select the domain you want to use or create a new one. -18. Modify an existing CNAME record set or create a new one with the name * and the value of the domain you copied in step 13. -19. Save the record set - -20. Return the Elastic Beanstalk from the AWS console. -21. Select the environment you created. -22. Select configuration from the sidebar. -23. Click the gear beside software configuration. -24. Add an environment property with the name “MATTERMOST\_DOMAIN” and a value of the domain you mapped in route 53. For example if your domain is \*.example.com you would enter example.com not www.example.com. -25. Select apply. -26. Return to the dashboard on the sidebar and wait for beanstalk update the environment. +17. Select the domain you want to use or create a new one. +18. Modify an existing CNAME record set or create a new one with the name * and the value of the domain you copied in step 13. +19. Save the record set +20. Return the Elastic Beanstalk from the AWS console. +21. Select the environment you created. +22. Select configuration from the sidebar. +23. Click the gear beside software configuration. +24. Add an environment property with the name “MATTERMOST\_DOMAIN” and a value of the domain you mapped in route 53. For example if your domain is \*.example.com you would enter example.com not www.example.com. +25. Select apply. +26. Return to the dashboard on the sidebar and wait for beanstalk update the environment. 27. Try it out by entering the domain you mapped into your browser. License -- cgit v1.2.3-1-g7c22 From ac8e1fe97ed83d2fda23490cfd2ffcf4b42e4f42 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Fri, 19 Jun 2015 08:08:54 -0400 Subject: fix a bug where mentions wouldn't update for words after a new line --- api/post.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/post.go b/api/post.go index 36607c231..f8125a442 100644 --- a/api/post.go +++ b/api/post.go @@ -302,10 +302,11 @@ func fireAndForgetNotifications(post *model.Post, teamId, teamUrl string) { // Build a map as a list of unique user_ids that are mentioned in this post splitF := func(c rune) bool { - return c == ',' || c == ' ' || c == '.' || c == '!' || c == '?' || c == ':' || c == '<' || c == '>' + return c == ',' || c == ' ' || c == '.' || c == '!' || c == '?' || c == ':' || c == '<' || c == '>' || c == '\n' } splitMessage := strings.FieldsFunc(strings.Replace(post.Message, "
", " ", -1), splitF) for _, word := range splitMessage { + l4g.Debug(word) // Non-case-sensitive check for regular keys userIds1, keyMatch := keywordMap[strings.ToLower(word)] -- cgit v1.2.3-1-g7c22 From 6051b01cdfbf426a6d069aa57cb612c1813a8c3f Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Fri, 19 Jun 2015 08:09:35 -0400 Subject: remove logging --- api/post.go | 1 - 1 file changed, 1 deletion(-) diff --git a/api/post.go b/api/post.go index f8125a442..0e521034d 100644 --- a/api/post.go +++ b/api/post.go @@ -306,7 +306,6 @@ func fireAndForgetNotifications(post *model.Post, teamId, teamUrl string) { } splitMessage := strings.FieldsFunc(strings.Replace(post.Message, "
", " ", -1), splitF) for _, word := range splitMessage { - l4g.Debug(word) // Non-case-sensitive check for regular keys userIds1, keyMatch := keywordMap[strings.ToLower(word)] -- cgit v1.2.3-1-g7c22 From 09c4089c95ed8f4306f0005918677bdbaa18a486 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Fri, 19 Jun 2015 08:25:47 -0400 Subject: improved split function --- api/post.go | 2 +- model/utils.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api/post.go b/api/post.go index 0e521034d..3acc95551 100644 --- a/api/post.go +++ b/api/post.go @@ -302,7 +302,7 @@ func fireAndForgetNotifications(post *model.Post, teamId, teamUrl string) { // Build a map as a list of unique user_ids that are mentioned in this post splitF := func(c rune) bool { - return c == ',' || c == ' ' || c == '.' || c == '!' || c == '?' || c == ':' || c == '<' || c == '>' || c == '\n' + return model.SplitRunes[c] } splitMessage := strings.FieldsFunc(strings.Replace(post.Message, "
", " ", -1), splitF) for _, word := range splitMessage { diff --git a/model/utils.go b/model/utils.go index 2541247de..9f1788699 100644 --- a/model/utils.go +++ b/model/utils.go @@ -319,3 +319,5 @@ func ClearMentionTags(post string) string { var UrlRegex = regexp.MustCompile(`^((?:[a-z]+:\/\/)?(?:(?:[a-z0-9\-]+\.)+(?:[a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|local|internal))(:[0-9]{1,5})?(?:\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(?:\?[a-z0-9+_~\-\.%=&]*)?)?(?:#[a-zA-Z0-9!$&'()*+.=-_~:@/?]*)?)(?:\s+|$)$`) var PartialUrlRegex = regexp.MustCompile(`/api/v1/files/(get|get_image)/([A-Za-z0-9]{26})/([A-Za-z0-9]{26})/(([A-Za-z0-9]+/)?.+\.[A-Za-z0-9]{3,})`) + +var SplitRunes = map[rune]bool{',': true, ' ': true, '.': true, '!': true, '?': true, ':': true, ';': true, '\n': true, '<': true, '>': true, '(': true, ')': true, '{': true, '}': true, '[': true, ']': true, '+': true} -- cgit v1.2.3-1-g7c22 From 5aef020ca2684a816fce8bc22b0b53ffd594756c Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Fri, 19 Jun 2015 08:30:16 -0400 Subject: added slashes to split map --- model/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/utils.go b/model/utils.go index 9f1788699..262bda319 100644 --- a/model/utils.go +++ b/model/utils.go @@ -320,4 +320,4 @@ func ClearMentionTags(post string) string { var UrlRegex = regexp.MustCompile(`^((?:[a-z]+:\/\/)?(?:(?:[a-z0-9\-]+\.)+(?:[a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|local|internal))(:[0-9]{1,5})?(?:\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(?:\?[a-z0-9+_~\-\.%=&]*)?)?(?:#[a-zA-Z0-9!$&'()*+.=-_~:@/?]*)?)(?:\s+|$)$`) var PartialUrlRegex = regexp.MustCompile(`/api/v1/files/(get|get_image)/([A-Za-z0-9]{26})/([A-Za-z0-9]{26})/(([A-Za-z0-9]+/)?.+\.[A-Za-z0-9]{3,})`) -var SplitRunes = map[rune]bool{',': true, ' ': true, '.': true, '!': true, '?': true, ':': true, ';': true, '\n': true, '<': true, '>': true, '(': true, ')': true, '{': true, '}': true, '[': true, ']': true, '+': true} +var SplitRunes = map[rune]bool{',': true, ' ': true, '.': true, '!': true, '?': true, ':': true, ';': true, '\n': true, '<': true, '>': true, '(': true, ')': true, '{': true, '}': true, '[': true, ']': true, '+': true, '/': true, '\\': true} -- cgit v1.2.3-1-g7c22 From a15b4219579c89cc44d0ed1f9a35bc58f7367426 Mon Sep 17 00:00:00 2001 From: it33 Date: Fri, 19 Jun 2015 05:52:31 -0700 Subject: Adding "About Mattermost" to README.md --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0a2ff2b38..9c42d9da9 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ **Team Communication Service** **Version 0.40** -What matters most to your team? -=============================== +WHAT MATTERS MOST TO YOUR TEAM? Words have power. Mattermost serves teams who use words to shape the future. @@ -11,6 +10,13 @@ The words you choose are up to you. *- SpinPunch* + +About Mattermost +================ + +Mattermost is an open source team communication service. It brings messages and files shared by your team into one place accessible across PCs and phones, with archiving and search. + + Installing the Mattermost Preview ================================= -- cgit v1.2.3-1-g7c22 From 5ca9397c3ca4a34b4e5546deec03d6c1fe967b43 Mon Sep 17 00:00:00 2001 From: it33 Date: Fri, 19 Jun 2015 05:57:56 -0700 Subject: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c42d9da9..db513b16b 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ The words you choose are up to you. About Mattermost ================ -Mattermost is an open source team communication service. It brings messages and files shared by your team into one place accessible across PCs and phones, with archiving and search. +Mattermost is an open source team communication service. It brings messaging and files shared by your team into one place accessible across PCs and phones, with archiving and search. Installing the Mattermost Preview -- cgit v1.2.3-1-g7c22 From ce0b89a26ef5d45b6aa797eac9426faa7c04d2d2 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 19 Jun 2015 09:00:28 -0400 Subject: Adding linux setup instructions to readme. Adding Dockerrun.aws.json file --- README.md | 33 ++++++++++++++++++++++++++++++--- docker/Dockerrun.aws.json | 13 +++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-) create mode 100755 docker/Dockerrun.aws.json diff --git a/README.md b/README.md index db513b16b..0a3798aef 100644 --- a/README.md +++ b/README.md @@ -24,18 +24,44 @@ You're installing "Mattermost Preview", a pre-released 0.40 version intended for That said, any issues at all, please let us know on the Mattermost forum at: http://bit.ly/1MY1kul -Developer Machine Setup (Docker/Mac) ------------------------------------- +Local Machine Setup (Docker) +----------------------------- + +### Mac OSX ### 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` 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 `boot2docker shellinit` and copy the export statements to your ~/.bash\_profile 5. Run `docker run --name mattermost-dev -d --publish 8065:80 mattermost/platform:helium` 6. When docker is done fetching the image, open http://dockerhost:8065/ in your browser +### Ubuntu ### +1. Follow the instructions at https://docs.docker.com/installation/ubuntulinux/ or use the summery below. +`sudo apt-get update` +`sudo apt-get install wget` +`wget -qO- https://get.docker.com/ | sh` +`sudo usermod -aG docker ` +`sudo service docker start` +`newgrp docker` +2. Run `docker run -d --publish 8086:80 mattermost/platform` +3. When docker is done fetching the image, open http://localhost:8086/ in your browser + +### Arch ### +1. Install docker using the following commands +`pacman -S docker` +`systemctl enable docker.service` +`systemctl start docker.service` +`gpasswd -a docker` +`newgrp docker` +2. docker run -d --publish 8086:80 mattermost/platform +3. When docker is done fetching the image, open http://localhost:8086/ in your browser + +### Notes ### +If your ISP blocks port 25 then you may install locally but email will not be sent. + If you want to work with the latest bits in the repo you can run the cmd `docker run --name mattermost-dev -d --publish 8065:80 mattermost/platform:latest` @@ -46,6 +72,7 @@ If you wish to remove mattermost-dev use the following commands 1. `docker stop mattermost-dev` 2. `docker rm -v mattermost-dev` + AWS Elastic Beanstalk Setup (Docker) ------------------------------------ diff --git a/docker/Dockerrun.aws.json b/docker/Dockerrun.aws.json new file mode 100755 index 000000000..52bbb2ae5 --- /dev/null +++ b/docker/Dockerrun.aws.json @@ -0,0 +1,13 @@ +{ + "AWSEBDockerrunVersion": "1", + "Image": { + "Name": "mattermost/platform", + "Update": "true" + }, + "Ports": [ + { + "ContainerPort": "80" + } + ], + "Logging": "/var/log/" +} -- cgit v1.2.3-1-g7c22 From 60ccc8fcfe35c4c8baa3816ea11a7f90425c4d17 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 19 Jun 2015 09:21:16 -0400 Subject: Adding name and tag to commands --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0a3798aef..ed51ad652 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Local Machine Setup (Docker) `sudo usermod -aG docker ` `sudo service docker start` `newgrp docker` -2. Run `docker run -d --publish 8086:80 mattermost/platform` +2. Run `docker run --name mattermost-dev -d --publish 8086:80 mattermost/platform:helium 3. When docker is done fetching the image, open http://localhost:8086/ in your browser ### Arch ### @@ -56,7 +56,7 @@ Local Machine Setup (Docker) `systemctl start docker.service` `gpasswd -a docker` `newgrp docker` -2. docker run -d --publish 8086:80 mattermost/platform +2. docker run --name mattermost-dev -d --publish 8086:80 mattermost/platform:helium 3. When docker is done fetching the image, open http://localhost:8086/ in your browser ### Notes ### -- cgit v1.2.3-1-g7c22 From 4f0563ddea6cfc2ad067f141123d4c6023927c2e Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 19 Jun 2015 09:23:27 -0400 Subject: Switching port --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ed51ad652..7e564fdd6 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,8 @@ Local Machine Setup (Docker) `sudo usermod -aG docker ` `sudo service docker start` `newgrp docker` -2. Run `docker run --name mattermost-dev -d --publish 8086:80 mattermost/platform:helium -3. When docker is done fetching the image, open http://localhost:8086/ in your browser +2. Run `docker run --name mattermost-dev -d --publish 8065:80 mattermost/platform:helium +3. When docker is done fetching the image, open http://localhost:8065/ in your browser ### Arch ### 1. Install docker using the following commands @@ -56,8 +56,8 @@ Local Machine Setup (Docker) `systemctl start docker.service` `gpasswd -a docker` `newgrp docker` -2. docker run --name mattermost-dev -d --publish 8086:80 mattermost/platform:helium -3. When docker is done fetching the image, open http://localhost:8086/ in your browser +2. docker run --name mattermost-dev -d --publish 8065:80 mattermost/platform:helium +3. When docker is done fetching the image, open http://localhost:8065/ in your browser ### Notes ### If your ISP blocks port 25 then you may install locally but email will not be sent. -- cgit v1.2.3-1-g7c22 From 634d29feadd6602895c595e791cd53f81eea41ff Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 19 Jun 2015 09:52:04 -0400 Subject: Defaulting to domain of localhost when no domain is given --- utils/config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/config.go b/utils/config.go index 23bd3e85a..6a7e4589c 100644 --- a/utils/config.go +++ b/utils/config.go @@ -221,6 +221,10 @@ func LoadConfig(fileName string) { // Grabs the domain from enviroment variable if not in configuration if config.ServiceSettings.Domain == "" { config.ServiceSettings.Domain = os.Getenv("MATTERMOST_DOMAIN") + // If the enviroment variable is not set, use a default + if config.ServiceSettings.Domain == "" { + config.ServiceSettings.Domain = "localhost" + } } // Check for a valid email for feedback, if not then do feedback@domain -- cgit v1.2.3-1-g7c22 From cb38322bcc157f1836b81a1a9eadcd74d07851f9 Mon Sep 17 00:00:00 2001 From: it33 Date: Fri, 19 Jun 2015 06:58:24 -0700 Subject: Update README.md --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7e564fdd6..6bcb0fcfc 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,13 @@ **Team Communication Service** **Version 0.40** + +About Mattermost +================ + +Mattermost is an open source team communication service. It brings messaging and files shared by your team into one place accessible across PCs and phones, with archiving and search. + +
WHAT MATTERS MOST TO YOUR TEAM? Words have power. @@ -11,12 +18,6 @@ The words you choose are up to you. *- SpinPunch* -About Mattermost -================ - -Mattermost is an open source team communication service. It brings messaging and files shared by your team into one place accessible across PCs and phones, with archiving and search. - - Installing the Mattermost Preview ================================= -- cgit v1.2.3-1-g7c22 From 1cbb10105ba7c95d27be816d2a9e5c83e8773779 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Fri, 19 Jun 2015 10:11:51 -0400 Subject: fixes mm-1315 adds confirmation dialog when closing invite dialog with typed in emails --- web/react/components/confirm_modal.jsx | 31 +++++++ web/react/components/invite_member_modal.jsx | 120 ++++++++++++++++++--------- 2 files changed, 113 insertions(+), 38 deletions(-) create mode 100644 web/react/components/confirm_modal.jsx diff --git a/web/react/components/confirm_modal.jsx b/web/react/components/confirm_modal.jsx new file mode 100644 index 000000000..3be13cf9b --- /dev/null +++ b/web/react/components/confirm_modal.jsx @@ -0,0 +1,31 @@ +// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. +// See License.txt for license information. + +module.exports = React.createClass({ + handleConfirm: function() { + $('#'+this.props.parent_id).attr('data-confirm', 'true'); + $('#'+this.props.parent_id).modal('hide'); + $('#'+this.props.id).modal('hide'); + }, + render: function() { + return ( + + ); + } +}); + diff --git a/web/react/components/invite_member_modal.jsx b/web/react/components/invite_member_modal.jsx index 1d2bbed84..5980664de 100644 --- a/web/react/components/invite_member_modal.jsx +++ b/web/react/components/invite_member_modal.jsx @@ -4,8 +4,37 @@ var utils = require('../utils/utils.jsx'); var Client =require('../utils/client.jsx'); var UserStore = require('../stores/user_store.jsx'); +var ConfirmModal = require('./confirm_modal.jsx'); module.exports = React.createClass({ + componentDidMount: function() { + var self = this; + $('#invite_member').on('hide.bs.modal', function(e) { + if ($('#invite_member').attr('data-confirm') === 'true') { + $('#invite_member').attr('data-confirm', 'false'); + return; + } + + var not_empty = false; + for (var i = 0; i < self.state.invite_ids.length; i++) { + var index = self.state.invite_ids[i]; + if (self.refs["email"+index].getDOMNode().value.trim() !== '') { + not_empty = true; + break; + } + } + + if (not_empty) { + $('#confirm_invite_modal').modal('show'); + e.preventDefault(); + } + + }); + + $('#invite_member').on('hidden.bs.modal', function() { + self.clearFields(); + }); + }, handleSubmit: function(e) { var invite_ids = this.state.invite_ids; var count = invite_ids.length; @@ -56,22 +85,8 @@ module.exports = React.createClass({ Client.inviteMembers(data, function() { + $(this.refs.modal.getDOMNode()).attr('data-confirm', 'true'); $(this.refs.modal.getDOMNode()).modal('hide'); - for (var i = 0; i < invite_ids.length; i++) { - var index = invite_ids[i]; - this.refs["email"+index].getDOMNode().value = ""; - if (config.AllowInviteNames) { - this.refs["first_name"+index].getDOMNode().value = ""; - this.refs["last_name"+index].getDOMNode().value = ""; - } - } - this.setState({ - invite_ids: [0], - id_count: 0, - email_errors: {}, - first_name_errors: {}, - last_name_errors: {} - }); }.bind(this), function(err) { this.setState({ server_error: err }); @@ -89,6 +104,26 @@ module.exports = React.createClass({ invite_ids.push(count); this.setState({ invite_ids: invite_ids, id_count: count }); }, + clearFields: function() { + var invite_ids = this.state.invite_ids; + + for (var i = 0; i < invite_ids.length; i++) { + var index = invite_ids[i]; + this.refs["email"+index].getDOMNode().value = ""; + if (config.AllowInviteNames) { + this.refs["first_name"+index].getDOMNode().value = ""; + this.refs["last_name"+index].getDOMNode().value = ""; + } + } + + this.setState({ + invite_ids: [0], + id_count: 0, + email_errors: {}, + first_name_errors: {}, + last_name_errors: {} + }); + }, removeInviteFields: function(index) { var invite_ids = this.state.invite_ids; var i = invite_ids.indexOf(index); @@ -147,29 +182,38 @@ module.exports = React.createClass({ var server_error = this.state.server_error ?
: null; return ( -