summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-09-02 22:21:52 -0700
committer=Corey Hulen <corey@hulen.com>2015-09-02 22:21:52 -0700
commit623bd2a0bcd73e3f93540670c614e353d1f802b4 (patch)
treeff3c6afe863d9e28b58733dcb6d89413a46944d0 /doc
parentded313d9c9c988470d7832ab68fd91f9bd96408a (diff)
parentca9ff3161a7ffaeff3987b7ee3be4af904c7e7b6 (diff)
downloadchat-623bd2a0bcd73e3f93540670c614e353d1f802b4.tar.gz
chat-623bd2a0bcd73e3f93540670c614e353d1f802b4.tar.bz2
chat-623bd2a0bcd73e3f93540670c614e353d1f802b4.zip
Fixing merge
Diffstat (limited to 'doc')
-rw-r--r--doc/README.md8
-rw-r--r--doc/developer/style-guide.md167
-rw-r--r--doc/install/dev-setup.md82
3 files changed, 257 insertions, 0 deletions
diff --git a/doc/README.md b/doc/README.md
index 5195327b2..baf499777 100644
--- a/doc/README.md
+++ b/doc/README.md
@@ -2,4 +2,12 @@
## Administrator Documentation
+### Installation
+
+- [Install Requirements](doc/install/requirements.md)
+- [Local Machine Setup ](doc/install/single-container-install.md)
+- [AWS Elastic Beanstalk Setup](doc/install/aws-ebs-setup.md)
+
+### Configuration
+
- [GitLab SSO Configuration](integrations/sso/gitlab-sso.md) - Configure OAuth2 Single-Sign-On for GitLab.
diff --git a/doc/developer/style-guide.md b/doc/developer/style-guide.md
new file mode 100644
index 000000000..470788cf5
--- /dev/null
+++ b/doc/developer/style-guide.md
@@ -0,0 +1,167 @@
+# Mattermost Style Guide
+
+1. [Go](#go)
+2. [Javascript](#javascript)
+3. [React-JSX](#react-jsx)
+
+
+## Go
+
+All go code must follow the golang official [Style Guide](https://golang.org/doc/effective_go.html)
+
+In addition all code must be run though the official go formatter tool [gofmt](https://golang.org/cmd/gofmt/)
+
+
+## Javascript
+
+Part of the build process is running ESLint. ESLint is the final authority on all style issues. PRs will not be accepted unless there are no errors or warnings running ESLint. The ESLint configuration file can be found in: [web/react/.eslintrc](https://github.com/mattermost/platform/blob/master/web/react/.eslintrc.json)
+
+Instructions on how to use ESLint with your favourite editor can be found here: [http://eslint.org/docs/user-guide/integrations](http://eslint.org/docs/user-guide/integrations)
+
+The following is an abridged version of the [Airbnb Javascript Style Guide](https://github.com/airbnb/javascript/blob/master/README.md#airbnb-javascript-style-guide-), with modifications. Anything that is unclear here follow that guide. If there is a conflict, follow what is said below.
+
+### Whitespace
+
+- Indentation is four spaces.
+- Use a space before the leading brace.
+- Use one space between the comma and the next argument in a bracketed list. No other space.
+- Use whitespace to make code more readable.
+- Do not use more than one newline to separate code blocks.
+- Do not use a newline as the first line of a function
+
+```javascript
+// Correct
+function myFunction(parm1, parm2) {
+ stuff...;
+
+ morestuff;
+}
+
+// Incorrect
+function myFunction ( parm1, parm2 ){
+ stuff...;
+
+
+ morestuff;
+}
+
+```
+
+### Semicolons
+
+- You must use them always.
+
+```javascript
+// Correct
+var x = 1;
+
+// Incorrect
+var x = 1
+```
+
+### Variables
+
+- Declarations must always use var, let or const.
+- Prefer let or const over var.
+- camelCase for all variable names.
+
+```javascript
+// Correct
+let myVariable = 4;
+
+// OK
+var myVariable = 4;
+
+// Incorrect
+myVariable = 4;
+var my_variable = 4;
+```
+
+### Blocks
+
+- Braces must be used on all blocks.
+- Braces must start on the same line as the statement starting the block.
+- Else and else if must be on the same line as the if block closing brace.
+
+```javascript
+// Correct
+if (something) {
+ stuff...;
+} else if (otherthing) {
+ stuff...;
+}
+
+// Incorrect
+if (something)
+{
+ stuff...;
+}
+else
+{
+ stuff...;
+}
+
+// Incorrect
+if (something) stuff...;
+if (something)
+ stuff...;
+
+```
+
+### Strings
+
+- Use template strings instead of concatenation.
+
+```javascript
+// Correct
+function getStr(stuff) {
+ return "This is the ${stuff} string";
+}
+
+// Incorrect
+function wrongGetStr(stuff) {
+ return "This is the " + stuff + " string";
+}
+```
+
+## React-JSX
+
+Part of the build process is running ESLint. ESLint is the final authority on all style issues. PRs will not be accepted unless there are no errors or warnings running ESLint. The ESLint configuration file can be found in: [web/react/.eslintrc](https://github.com/mattermost/platform/blob/master/web/react/.eslintrc.json)
+
+Instructions on how to use ESLint with your favourite editor can be found here: [http://eslint.org/docs/user-guide/integrations](http://eslint.org/docs/user-guide/integrations)
+
+This is an abridged version of the [Airbnb React/JSX Style Guide](https://github.com/airbnb/javascript/tree/master/react#airbnb-reactjsx-style-guide). Anything that is unclear here follow that guide. If there is a conflict, follow what is said below.
+
+### General
+
+- Include only one React component per file.
+- Use class \<name\> extends React.Component over React.createClass unless you need mixins
+- CapitalCamelCase with .jsx extension for component filenames.
+- Filenames should be the component name.
+
+### Alignment
+
+- Follow alignment styles shown below:
+```xml
+// Correct
+<Tag
+ propertyOne="1"
+ propertyTwo="2"
+>
+ <Child />
+</Tag>
+
+// Correct
+<Tag propertyOne="1" />
+```
+
+### Naming
+
+- Property names use camelCase.
+- React component names use CapitalCamelCase.
+- Do not use an underscore for internal methods in a react component.
+
+```xml
+// Correct
+<ReactComponent propertyOne="value" />
+```
diff --git a/doc/install/dev-setup.md b/doc/install/dev-setup.md
new file mode 100644
index 000000000..a088bbbc2
--- /dev/null
+++ b/doc/install/dev-setup.md
@@ -0,0 +1,82 @@
+Developer Machine Setup
+-----------------------------
+
+### Mac OS X ###
+
+1. Download and set up Boot2Docker
+ 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 `<Docker IP> dockerhost`
+ 4. Run `boot2docker shellinit` and copy the export statements to your ~/.bash_profile
+2. Download Go from http://golang.org/dl/
+3. Set up your Go workspace
+ 1. `mkdir ~/go`
+ 2. Add the following to your ~/.bash_profile
+ `export GOPATH=$HOME/go`
+ `export PATH=$PATH:$GOPATH/bin`
+ 3. Reload your bash profile
+ `source ~/.bash_profile`
+4. Install Node.js using Homebrew
+ 1. Download Homebrew from http://brew.sh/
+ 2. `brew install node`
+5. Install Compass
+ 1. Make sure you have the latest verison of Ruby
+ 2. `gem install compass`
+6. Download Mattermost
+ `cd ~/go`
+ `mkdir -p src/github.com/mattermost`
+ `cd src/github.com/mattermost`
+ `git clone github.com/mattermost/platform.git`
+ `cd platform`
+7. Run unit tests on Mattermost using `make test` to make sure the installation was successful
+8. If tests passed, you can now run Mattermost using `make run`
+
+Any issues? Please let us know on our forums at: http://forum.mattermost.org
+
+### Ubuntu ###
+
+1. Download Docker
+ 1. Follow the instructions at https://docs.docker.com/installation/ubuntulinux/ or use the summary below:
+ `sudo apt-get update`
+ `sudo apt-get install wget`
+ `wget -qO- https://get.docker.com/ | sh`
+ `sudo usermod -aG docker <username>`
+ `sudo service docker start`
+ `newgrp docker`
+2. Set up your dockerhost address
+ 1. Edit your /etc/hosts file to include the following line
+ `127.0.0.1 dockerhost`
+3. Install build essentials
+ 1. `apt-get install build-essential`
+4. Download Go from http://golang.org/dl/
+5. Set up your Go workspace and add Go to the PATH
+ 1. `mkdir ~/go`
+ 2. Add the following to your ~/.bashrc
+ `export GOPATH=$HOME/go`
+ `export GOROOT=/usr/local/go`
+ `export PATH=$PATH:$GOROOT/bin`
+ 3. Reload your bashrc
+ `source ~/.bashrc`
+6. Install Node.js
+ 1. Download the newest version of the Node.js sources from https://nodejs.org/download/
+ 2. Extract the contents of the package and cd into the extracted files
+ 3. Compile and install Node.js
+ `./configure`
+ `make`
+ `make install`
+7. Install Ruby and Compass
+ `apt-get install ruby`
+ `apt-get install ruby-dev`
+ `gem install compass`
+8. Download Mattermost
+ `cd ~/go`
+ `mkdir -p src/github.com/mattermost`
+ `cd src/github.com/mattermost`
+ `git clone github.com/mattermost/platform.git`
+ `cd platform`
+9. Run unit tests on Mattermost using `make test` to make sure the installation was successful
+10. If tests passed, you can now run Mattermost using `make run`
+
+Any issues? Please let us know on our forums at: http://forum.mattermost.org