diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | docs/guides/auth/mattermost-self-hosted.md | 58 | ||||
-rw-r--r-- | docs/guides/images/auth/mattermost-enable-oauth2.png | bin | 0 -> 26034 bytes | |||
-rw-r--r-- | docs/guides/images/auth/mattermost-oauth-app-add.png | bin | 0 -> 21443 bytes | |||
-rw-r--r-- | docs/guides/images/auth/mattermost-oauth-app-done.png | bin | 0 -> 31767 bytes | |||
-rw-r--r-- | docs/guides/images/auth/mattermost-oauth-app-form.png | bin | 0 -> 62160 bytes | |||
-rw-r--r-- | package.json | 8 |
8 files changed, 68 insertions, 10 deletions
diff --git a/.travis.yml b/.travis.yml index 2ce5723c..887299b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ jobs: - export PATH="$HOME/.yarn/bin:$PATH" - env: task=npm-test node_js: - - 7 + - 8 before_install: - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version "$YARN_VERSION" - export PATH="$HOME/.yarn/bin:$PATH" @@ -101,7 +101,7 @@ To install use `helm install stable/hackmd`. For all further details, please check out the offical CodiMD [K8s helm chart](https://github.com/kubernetes/charts/tree/master/stable/hackmd). ## CodiMD by docker container -[![Try in PWD](https://cdn.rawgit.com/play-with-docker/stacks/cff22438/assets/images/button.png)](http://play-with-docker.com?stack=https://github.com/hackmdio/docker-hackmd/raw/master/docker-compose.yml&stack_name=codimd) +[![Try in PWD](https://cdn.rawgit.com/play-with-docker/stacks/cff22438/assets/images/button.png)](http://play-with-docker.com?stack=https://github.com/hackmdio/codimd-container/raw/master/docker-compose.yml&stack_name=codimd) **Debian-based version:** @@ -116,11 +116,11 @@ For all further details, please check out the offical CodiMD [K8s helm chart](h The easiest way to setup CodiMD using docker are using the following three commands: ```console -git clone https://github.com/hackmdio/docker-hackmd.git -cd docker-codimd +git clone https://github.com/hackmdio/codimd-container.git +cd codimd-container docker-compose up ``` -Read more about it in the [docker repository…](https://github.com/hackmdio/docker-hackmd) +Read more about it in the [container repository…](https://github.com/hackmdio/codimd-container) ## Cloudron @@ -202,7 +202,7 @@ There are some config settings you need to change in the files below. | `CMD_GITLAB_CLIENTID` | no example | GitLab API client id | | `CMD_GITLAB_CLIENTSECRET` | no example | GitLab API client secret | | `CMD_GITLAB_VERSION` | no example | GitLab API version (v3 or v4) | -| `CMD_MATTERMOST_BASEURL` | no example | Mattermost authentication endpoint | +| `CMD_MATTERMOST_BASEURL` | no example | Mattermost authentication endpoint for versions below 5.0. For Mattermost version 5.0 and above, see [guide](docs/guides/auth/mattermost-self-hosted.md). | | `CMD_MATTERMOST_CLIENTID` | no example | Mattermost API client id | | `CMD_MATTERMOST_CLIENTSECRET` | no example | Mattermost API client secret | | `CMD_DROPBOX_CLIENTID` | no example | Dropbox API client id | diff --git a/docs/guides/auth/mattermost-self-hosted.md b/docs/guides/auth/mattermost-self-hosted.md new file mode 100644 index 00000000..631aabd3 --- /dev/null +++ b/docs/guides/auth/mattermost-self-hosted.md @@ -0,0 +1,58 @@ +Authentication guide - Mattermost (self-hosted) +=== + +*Note: The Mattermost setup portion of this document is just a quick guide. See the [official documentation](https://docs.mattermost.com/developer/oauth-2-0-applications.html) for more details.* + +This guide uses the generic OAuth2 module for compatibility with Mattermost version 5.0 and above. + +1. Sign-in with an administrator account to your Mattermost instance +2. Make sure **OAuth 2.0 Service Provider** is enabled in the Main Menu (menu button next to your username in the top left corner) --> System Console --> Custom Integrations menu, which you can find at `https://your.mattermost.domain/admin_console/integrations/custom` + +![mattermost-enable-oauth2](../images/auth/mattermost-enable-oauth2.png) + +3. Navigate to the OAuth integration settings through Main Menu --> Integrations --> OAuth 2.0 Applications, at `https://your.mattermost.domain/yourteam/integrations/oauth2-apps` +4. Click on the **Add OAuth 2.0 Application** button to add a new OAuth application + +![mattermost-oauth-app-add](../images/auth/mattermost-oauth-app-add.png) + +5. Fill out the form and click **Save** + +![mattermost-oauth-app-form](../images/auth/mattermost-oauth-app-form.png) + +*Note: The callback URL is \<your-codimd-url\>/auth/oauth2/callback* + +6. After saving the application, you'll receive the Client ID and Client Secret + +![mattermost-oauth-app-done](../images/auth/mattermost-oauth-app-done.png) + +7. Add the Client ID and Client Secret to your config.json file or pass them as environment variables + * config.json: + ````javascript + { + "production": { + "oauth2": { + "baseURL": "https://your.mattermost.domain", + "userProfileURL": "https://your.mattermost.domain/api/v4/users/me", + "userProfileUsernameAttr": "id", + "userProfileDisplayNameAttr": "username", + "userProfileEmailAttr": "email", + "tokenURL": "https://your.mattermost.domain/oauth/access_token", + "authorizationURL": "https://your.mattermost.domain/oauth/authorize", + "clientID": "ii4p1u3jz7dXXXXXXXXXXXXXXX", + "clientSecret": "mqzzx6fydbXXXXXXXXXXXXXXXX" + } + } + } + ```` + * environment variables: + ```` + CMD_OAUTH2_BASEURL=https://your.mattermost.domain + CMD_OAUTH2_USER_PROFILE_URL=https://your.mattermost.domain/api/v4/users/me + CMD_OAUTH2_USER_PROFILE_USERNAME_ATTR=id + CMD_OAUTH2_USER_PROFILE_DISPLAY_NAME_ATTR=username + CMD_OAUTH2_USER_PROFILE_EMAIL_ATTR=email + CMD_OAUTH2_TOKEN_URL=https://your.mattermost.domain/oauth/access_token + CMD_OAUTH2_AUTHORIZATION_URL=https://your.mattermost.domain/oauth/authorize + CMD_OAUTH2_CLIENT_ID=ii4p1u3jz7dXXXXXXXXXXXXXXX + CMD_OAUTH2_CLIENT_SECRET=mqzzx6fydbXXXXXXXXXXXXXXXX + ```` diff --git a/docs/guides/images/auth/mattermost-enable-oauth2.png b/docs/guides/images/auth/mattermost-enable-oauth2.png Binary files differnew file mode 100644 index 00000000..af5cdbe2 --- /dev/null +++ b/docs/guides/images/auth/mattermost-enable-oauth2.png diff --git a/docs/guides/images/auth/mattermost-oauth-app-add.png b/docs/guides/images/auth/mattermost-oauth-app-add.png Binary files differnew file mode 100644 index 00000000..4a8cdfa7 --- /dev/null +++ b/docs/guides/images/auth/mattermost-oauth-app-add.png diff --git a/docs/guides/images/auth/mattermost-oauth-app-done.png b/docs/guides/images/auth/mattermost-oauth-app-done.png Binary files differnew file mode 100644 index 00000000..fcf1beaf --- /dev/null +++ b/docs/guides/images/auth/mattermost-oauth-app-done.png diff --git a/docs/guides/images/auth/mattermost-oauth-app-form.png b/docs/guides/images/auth/mattermost-oauth-app-form.png Binary files differnew file mode 100644 index 00000000..215947bf --- /dev/null +++ b/docs/guides/images/auth/mattermost-oauth-app-form.png diff --git a/package.json b/package.json index 1740500c..b257a114 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,8 @@ "archiver": "^2.1.1", "async": "^2.1.4", "aws-sdk": "^2.7.20", - "base64url": "^3.0.0", "azure-storage": "^2.7.0", + "base64url": "^3.0.0", "blueimp-md5": "^2.6.0", "body-parser": "^1.15.2", "bootstrap": "^3.3.7", @@ -62,7 +62,7 @@ "keymaster": "^1.6.2", "list.js": "^1.5.0", "lodash": "^4.17.4", - "lz-string": "1.4.4", + "lz-string": "git+https://github.com/hackmdio/lz-string.git", "markdown-it": "^8.2.2", "markdown-it-abbr": "^1.0.4", "markdown-it-container": "^2.0.0", @@ -78,8 +78,8 @@ "markdown-it-sup": "^1.0.0", "markdown-pdf": "^9.0.0", "mathjax": "~2.7.0", - "mermaid": "~7.1.0", "mattermost": "^3.4.0", + "mermaid": "~7.1.0", "meta-marked": "^0.4.2", "method-override": "^2.3.7", "minimist": "^1.2.0", @@ -98,8 +98,8 @@ "passport-ldapauth": "^2.0.0", "passport-local": "^1.0.0", "passport-oauth2": "^1.4.0", - "passport-twitter": "^1.0.4", "passport-saml": "^0.31.0", + "passport-twitter": "^1.0.4", "passport.socketio": "^3.7.0", "pdfobject": "^2.0.201604172", "pg": "^6.1.2", |