Merge pull request #1194 from hackmdio/upgrade-dependency

Upgrade dependency to fix vulnerabilities issue
This commit is contained in:
Raccoon 2019-04-15 13:21:35 +08:00 committed by GitHub
commit 602548cd24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 868 additions and 909 deletions

View File

@ -5,7 +5,7 @@ var path = require('path')
var LZString = require('@hackmd/lz-string')
var base64url = require('base64url')
var md = require('markdown-it')()
var metaMarked = require('meta-marked')
var metaMarked = require('@hackmd/meta-marked')
var cheerio = require('cheerio')
var shortId = require('shortid')
var Sequelize = require('sequelize')

View File

@ -1,16 +1,17 @@
'use strict'
require('babel-polyfill')
require('isomorphic-fetch');
const Router = require('express').Router
const passport = require('passport')
const Mattermost = require('mattermost')
const MattermostClient = require('mattermost-redux/client/client4').default
const OAuthStrategy = require('passport-oauth2').Strategy
const config = require('../../../config')
const { setReturnToFromReferer, passportGeneralCallback } = require('../utils')
const mattermost = new Mattermost.Client()
let mattermostAuth = module.exports = Router()
const mattermostClient = new MattermostClient()
let mattermostStrategy = new OAuthStrategy({
authorizationURL: config.mattermost.baseURL + '/oauth/authorize',
tokenURL: config.mattermost.baseURL + '/oauth/access_token',
@ -20,17 +21,11 @@ let mattermostStrategy = new OAuthStrategy({
}, passportGeneralCallback)
mattermostStrategy.userProfile = (accessToken, done) => {
mattermost.setUrl(config.mattermost.baseURL)
mattermost.token = accessToken
mattermost.useHeaderToken()
mattermost.getMe(
(data) => {
done(null, data)
},
(err) => {
done(err)
}
)
mattermostClient.setUrl(config.mattermost.baseURL)
mattermostClient.setToken(accessToken)
mattermostClient.getMe()
.then((data) => done(null, data))
.catch((err) => done(err))
}
passport.use(mattermostStrategy)

View File

@ -2,149 +2,193 @@
"name": "codimd",
"version": "1.3.1",
"description": "Realtime collaborative markdown notes on all platforms.",
"main": "app.js",
"license": "AGPL-3.0",
"scripts": {
"test": "npm run-script eslint && npm run-script jsonlint && mocha",
"eslint": "node_modules/.bin/eslint lib public test app.js",
"jsonlint": "find . -not -path './node_modules/*' -type f -name '*.json' -o -type f -name '*.json.example' | while read json; do echo $json ; jq . $json; done",
"standard": "echo 'standard is no longer being used, use `npm run eslint` instead!' && exit 1",
"dev": "webpack --config webpack.dev.js --progress --colors --watch",
"build": "webpack --config webpack.prod.js --progress --colors --bail",
"postinstall": "bin/heroku",
"start": "sequelize db:migrate && node app.js",
"doctoc": "doctoc --title='# Table of Contents' README.md"
},
"dependencies": {
"@hackmd/codemirror": "^5.41.2",
"@hackmd/diff-match-patch": "^1.1.1",
"@hackmd/idle-js": "^1.0.1",
"@hackmd/imgur": "^0.4.1",
"@hackmd/js-sequence-diagrams": "^0.0.1-alpha.3",
"@hackmd/lz-string": "1.4.4",
"@passport-next/passport-openid": "^1.0.0",
"archiver": "^2.1.1",
"async": "^2.1.4",
"aws-sdk": "^2.345.0",
"azure-storage": "^2.7.0",
"base64url": "^3.0.0",
"body-parser": "^1.15.2",
"bootstrap": "^3.4.0",
"bootstrap-validator": "^0.11.8",
"chance": "^1.0.4",
"cheerio": "^0.22.0",
"compression": "^1.6.2",
"connect-flash": "^0.1.1",
"connect-session-sequelize": "^6.0.0",
"cookie": "0.3.1",
"cookie-parser": "1.4.3",
"deep-freeze": "^0.0.1",
"ejs": "^2.5.5",
"emojify.js": "~1.1.0",
"express": ">=4.14",
"express-session": "^1.14.2",
"file-saver": "^1.3.3",
"flowchart.js": "^1.6.4",
"fork-awesome": "^1.1.3",
"formidable": "^1.0.17",
"gist-embed": "~2.6.0",
"graceful-fs": "^4.1.11",
"handlebars": "^4.0.13",
"helmet": "^3.13.0",
"highlight.js": "~9.12.0",
"i18n": "^0.8.3",
"ionicons": "~2.0.1",
"jquery": "^3.1.1",
"jquery-mousewheel": "^3.1.13",
"jquery-ui": "^1.12.1",
"js-cookie": "^2.1.3",
"js-yaml": "^3.7.0",
"jsdom-nogyp": "^0.8.3",
"keymaster": "^1.6.2",
"list.js": "^1.5.0",
"lodash": "^4.17.11",
"markdown-it": "^8.2.2",
"markdown-it-abbr": "^1.0.4",
"markdown-it-container": "^2.0.0",
"markdown-it-deflist": "^2.0.1",
"markdown-it-emoji": "^1.3.0",
"markdown-it-footnote": "^3.0.1",
"markdown-it-imsize": "^2.0.1",
"markdown-it-ins": "^2.0.0",
"markdown-it-mark": "^2.0.0",
"markdown-it-mathjax": "^2.0.0",
"markdown-it-regexp": "^0.4.0",
"markdown-it-sub": "^1.0.0",
"markdown-it-sup": "^1.0.0",
"markdown-pdf": "^9.0.0",
"mathjax": "~2.7.0",
"mattermost": "^3.4.0",
"mermaid": "~7.1.0",
"meta-marked": "^0.4.2",
"method-override": "^2.3.7",
"minimist": "^1.2.0",
"minio": "^6.0.0",
"moment": "^2.17.1",
"morgan": "^1.7.0",
"mysql": "^2.12.0",
"passport": "^0.4.0",
"passport-dropbox-oauth2": "^1.1.0",
"passport-facebook": "^2.1.1",
"passport-github": "^1.1.0",
"passport-gitlab2": "^4.0.0",
"passport-google-oauth20": "^1.0.0",
"passport-ldapauth": "^2.0.0",
"passport-local": "^1.0.0",
"passport-oauth2": "^1.4.0",
"passport-saml": "^1.0.0",
"passport-twitter": "^1.0.4",
"passport.socketio": "^3.7.0",
"pdfobject": "^2.0.201604172",
"pg": "^6.1.2",
"pg-hstore": "^2.3.2",
"prismjs": "^1.6.0",
"randomcolor": "^0.5.3",
"raphael": "^2.2.8",
"readline-sync": "^1.4.7",
"request": "^2.88.0",
"reveal.js": "~3.7.0",
"scrypt": "^6.0.3",
"select2": "^3.5.2-browserify",
"sequelize": "5.3.2",
"shortid": "2.2.8",
"socket.io": "~2.1.1",
"socket.io-client": "~2.1.1",
"spin.js": "^2.3.2",
"sqlite3": "^4.0.1",
"store": "^2.0.12",
"tedious": "^1.14.0",
"toobusy-js": "^0.5.1",
"turndown": "^5.0.1",
"uuid": "^3.1.0",
"validator": "^10.4.0",
"velocity-animate": "^1.4.0",
"visibilityjs": "^1.2.4",
"viz.js": "^1.7.0",
"winston": "^3.1.0",
"ws": "^6.0.0",
"wurl": "^2.5.3",
"xss": "^1.0.3"
},
"resolutions": {
"**/tough-cookie": "~2.4.0",
"**/minimatch": "^3.0.2",
"**/request": "^2.88.0"
},
"engines": {
"node": ">=8.0.0"
},
"bugs": "https://github.com/hackmdio/codimd/issues",
"keywords": [
"Collaborative",
"Markdown",
"Notes"
],
"homepage": "https://codimd.org",
"bugs": "https://github.com/hackmdio/codimd/issues",
"repository": {
"type": "git",
"url": "https://github.com/hackmdio/codimd.git"
},
"license": "AGPL-3.0",
"main": "app.js",
"scripts": {
"build": "webpack --config webpack.prod.js --progress --colors --bail",
"dev": "webpack --config webpack.dev.js --progress --colors --watch",
"doctoc": "doctoc --title='# Table of Contents' README.md",
"eslint": "eslint lib public test app.js",
"postinstall": "bin/heroku",
"jsonlint": "find . -not -path './node_modules/*' -type f -name '*.json' -o -type f -name '*.json.example' | while read json; do echo $json ; jq . $json; done",
"standard": "echo 'standard is no longer being used, use `npm run eslint` instead!' && exit 1",
"start": "sequelize db:migrate && node app.js",
"test": "npm run-script eslint && npm run-script jsonlint && mocha"
},
"dependencies": {
"@hackmd/codemirror": "~5.41.2",
"@hackmd/diff-match-patch": "~1.1.1",
"@hackmd/idle-js": "~1.0.1",
"@hackmd/imgur": "~0.4.1",
"@hackmd/js-sequence-diagrams": "~0.0.1-alpha.3",
"@hackmd/lz-string": "~1.4.4",
"@hackmd/meta-marked": "~0.4.4",
"@passport-next/passport-openid": "~1.0.0",
"archiver": "~2.1.1",
"async": "~2.1.4",
"aws-sdk": "~2.345.0",
"azure-storage": "~2.10.2",
"base64url": "~3.0.0",
"body-parser": "~1.18.3",
"bootstrap": "~3.4.0",
"bootstrap-validator": "~0.11.8",
"chance": "~1.0.4",
"cheerio": "~0.22.0",
"compression": "~1.7.4",
"connect-flash": "~0.1.1",
"connect-session-sequelize": "~6.0.0",
"cookie": "~0.3.1",
"cookie-parser": "~1.4.3",
"deep-freeze": "~0.0.1",
"ejs": "~2.5.5",
"emojify.js": "~1.1.0",
"express": "~4.16.4",
"express-session": "~1.16.1",
"file-saver": "~1.3.3",
"flowchart.js": "~1.6.4",
"fork-awesome": "~1.1.3",
"formidable": "~1.2.1",
"gist-embed": "~2.6.0",
"graceful-fs": "~4.1.11",
"handlebars": "~4.0.13",
"helmet": "~3.13.0",
"highlight.js": "~9.12.0",
"i18n": "~0.8.3",
"ionicons": "~2.0.1",
"isomorphic-fetch": "^2.2.1",
"jquery": "~3.1.1",
"jquery-mousewheel": "~3.1.13",
"jquery-ui": "~1.12.1",
"js-cookie": "~2.1.3",
"js-yaml": "~3.13.1",
"jsdom-nogyp": "~0.8.3",
"keymaster": "~1.6.2",
"list.js": "~1.5.0",
"lodash": "~4.17.11",
"markdown-it": "~8.2.2",
"markdown-it-abbr": "~1.0.4",
"markdown-it-container": "~2.0.0",
"markdown-it-deflist": "~2.0.1",
"markdown-it-emoji": "~1.3.0",
"markdown-it-footnote": "~3.0.1",
"markdown-it-imsize": "~2.0.1",
"markdown-it-ins": "~2.0.0",
"markdown-it-mark": "~2.0.0",
"markdown-it-mathjax": "~2.0.0",
"markdown-it-regexp": "~0.4.0",
"markdown-it-sub": "~1.0.0",
"markdown-it-sup": "~1.0.0",
"markdown-pdf": "~9.0.0",
"mathjax": "~2.7.0",
"mattermost-redux": "^5.9.0",
"mermaid": "~7.1.0",
"method-override": "~2.3.7",
"minimist": "~1.2.0",
"minio": "~6.0.0",
"moment": "~2.24.0",
"morgan": "~1.9.1",
"mysql": "~2.16.0",
"passport": "~0.4.0",
"passport-dropbox-oauth2": "~1.1.0",
"passport-facebook": "~2.1.1",
"passport-github": "~1.1.0",
"passport-gitlab2": "~4.0.0",
"passport-google-oauth20": "~1.0.0",
"passport-ldapauth": "~2.1.3",
"passport-local": "~1.0.0",
"passport-oauth2": "~1.4.0",
"passport-saml": "~1.0.0",
"passport-twitter": "~1.0.4",
"passport.socketio": "~3.7.0",
"pdfobject": "~2.0.201604172",
"pg": "~6.1.2",
"pg-hstore": "~2.3.2",
"prismjs": "~1.6.0",
"randomcolor": "~0.5.3",
"raphael": "~2.2.8",
"readline-sync": "~1.4.7",
"request": "~2.88.0",
"reveal.js": "~3.7.0",
"scrypt": "~6.0.3",
"select2": "~3.5.2-browserify",
"sequelize": "5.3.5",
"shortid": "~2.2.8",
"socket.io": "~2.1.1",
"socket.io-client": "~2.1.1",
"spin.js": "~2.3.2",
"sqlite3": "~4.0.1",
"store": "~2.0.12",
"tedious": "~6.1.0",
"toobusy-js": "~0.5.1",
"turndown": "~5.0.1",
"uuid": "~3.1.0",
"validator": "~10.4.0",
"velocity-animate": "~1.4.0",
"visibilityjs": "~1.2.4",
"viz.js": "~1.7.0",
"winston": "~3.1.0",
"ws": "~6.0.0",
"wurl": "~2.5.3",
"xss": "~1.0.3"
},
"devDependencies": {
"acorn": "~6.1.1",
"babel-core": "~6.26.3",
"babel-loader": "~7.1.4",
"babel-plugin-transform-runtime": "~6.23.0",
"babel-polyfill": "~6.26.0",
"babel-preset-env": "~1.7.0",
"babel-runtime": "~6.26.0",
"copy-webpack-plugin": "~4.5.2",
"css-loader": "~1.0.0",
"doctoc": "~1.4.0",
"ejs-loader": "~0.3.1",
"eslint": "~5.16.0",
"eslint-config-standard": "~12.0.0",
"eslint-plugin-import": "~2.17.1",
"eslint-plugin-node": "~8.0.1",
"eslint-plugin-promise": "~4.1.1",
"eslint-plugin-standard": "~4.0.0",
"exports-loader": "~0.7.0",
"expose-loader": "~0.7.5",
"file-loader": "~2.0.0",
"html-webpack-plugin": "~4.0.0-beta.2",
"imports-loader": "~0.8.0",
"jsonlint": "~1.6.2",
"less": "~3.9.0",
"less-loader": "~4.1.0",
"mini-css-extract-plugin": "~0.4.1",
"mocha": "~5.2.0",
"mock-require": "~3.0.3",
"optimize-css-assets-webpack-plugin": "~5.0.0",
"script-loader": "~0.7.2",
"sequelize-cli": "~5.4.0",
"string-loader": "~0.0.1",
"style-loader": "~0.21.0",
"uglifyjs-webpack-plugin": "~1.2.7",
"url-loader": "~1.0.1",
"webpack": "~4.30.0",
"webpack-cli": "~3.3.0",
"webpack-merge": "~4.1.4",
"webpack-parallel-uglify-plugin": "~1.1.0"
},
"optionalDependencies": {
"bufferutil": "~4.0.0",
"utf-8-validate": "~5.0.1"
},
"engines": {
"node": ">=8.0.0"
},
"maintainers": [
{
"name": "Max Wu",
@ -154,54 +198,5 @@
"name": "Christoph (Sheogorath) Kern",
"email": "codimd@sheogorath.shivering-isles.com"
}
],
"repository": {
"type": "git",
"url": "https://github.com/hackmdio/codimd.git"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-runtime": "^6.26.0",
"copy-webpack-plugin": "^4.5.2",
"css-loader": "^1.0.0",
"doctoc": "^1.4.0",
"ejs-loader": "^0.3.1",
"eslint": "^5.9.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"exports-loader": "^0.7.0",
"expose-loader": "^0.7.5",
"file-loader": "^2.0.0",
"html-webpack-plugin": "4.0.0-beta.2",
"imports-loader": "^0.8.0",
"jsonlint": "^1.6.2",
"less": "^3.9.0",
"less-loader": "^4.1.0",
"mini-css-extract-plugin": "^0.4.1",
"mocha": "^5.2.0",
"mock-require": "^3.0.3",
"optimize-css-assets-webpack-plugin": "^5.0.0",
"script-loader": "^0.7.2",
"sequelize-cli": "^5.4.0",
"string-loader": "^0.0.1",
"style-loader": "^0.21.0",
"uglifyjs-webpack-plugin": "^1.2.7",
"url-loader": "^1.0.1",
"webpack": "^4.14.0",
"webpack-cli": "^3.1.0",
"webpack-merge": "^4.1.4",
"webpack-parallel-uglify-plugin": "^1.1.0"
},
"optionalDependencies": {
"bufferutil": "^4.0.0",
"utf-8-validate": "^5.0.1"
}
]
}

View File

@ -371,4 +371,42 @@ select {
.ui-use-tags {
max-width: 100%;
}
}
}
.btn-mattermost {
background-color: #2179ec;
border-color: rgba(0,0,0,0.2);
color: #fff;
}
.btn-gitlab {
background-color: #e35431;
border-color: rgba(0,0,0,0.2);
color: #fff;
}
.btn-mattermost:hover, .btn-mattermost:active {
background-color: #105fc6;
border-color: rgba(0,0,0,0.2);
color: #fff;
}
.btn-gitlab:hover, .btn-gitlab:active {
background-color: #c23b1a;
border-color: rgba(0,0,0,0.2);
color: #fff;
}
a.btn.btn-social > i.oauth-icon {
display: inline-flex;
height: 45px;
width: 45px;
line-height: inherit;
padding: 6px;
}
a.btn.btn-social > i.oauth-icon > img {
width: 100%;
height: 100%;
line-height: inherit;
}

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg xmlns="http://www.w3.org/2000/svg"
width="500" height="500" viewBox="0 0 500 500">
<path id="mattermost" fill="#ffffff" stroke="none"
d="M 250.05,34.00
C 251.95,34.04 253.85,34.11 255.65,34.20
255.65,34.20 225.86,69.71 225.86,69.71
225.79,69.72 225.71,69.74 225.63,69.75
149.26,84.10 98.22,146.50 98.22,222.97
98.22,264.53 121.29,313.47 157.97,342.07
186.58,364.39 222.26,378.97 259.18,378.97
352.58,378.97 419.33,310.36 419.33,222.97
419.33,188.06 403.34,150.20 377.57,122.21
377.57,122.21 375.94,74.82 375.94,74.82
430.39,113.97 465.89,177.84 466.00,249.99
466.00,250.00 466.00,250.00 466.00,250.00
466.00,369.29 369.30,466.00 250.00,466.00
130.71,466.00 34.00,369.29 34.00,250.00
34.00,130.71 130.71,34.00 250.00,34.00
250.00,34.00 250.05,34.00 250.05,34.00 Z
M 314.15,54.29
C 314.81,54.25 315.47,54.32 316.11,54.54
319.12,55.54 319.96,58.11 320.04,60.99
320.04,60.99 323.88,207.87 323.88,207.87
324.64,236.53 306.72,276.31 263.49,276.43
232.52,276.51 199.81,255.60 199.81,216.30
199.82,201.57 205.42,185.04 219.06,168.19
219.06,168.19 309.09,57.01 309.09,57.01
310.24,55.59 312.17,54.43 314.15,54.29
314.15,54.29 314.15,54.29 314.15,54.29 Z" />
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -24,13 +24,13 @@
</a>
<% } %>
<% if (authProviders.gitlab) { %>
<a href="<%- serverURL %>/auth/gitlab" class="btn btn-lg btn-block btn-social btn-soundcloud">
<a href="<%- serverURL %>/auth/gitlab" class="btn btn-lg btn-block btn-social btn-gitlab">
<i class="fa fa-gitlab"></i> <%= __('Sign in via %s', 'GitLab') %>
</a>
<% } %>
<% if (authProviders.mattermost) { %>
<a href="<%- serverURL %>/auth/mattermost" class="btn btn-lg btn-block btn-social btn-soundcloud">
<i class="fa fa-mattermost"></i> <%= __('Sign in via %s', 'Mattermost') %>
<a href="<%- serverURL %>/auth/mattermost" class="btn btn-lg btn-block btn-social btn-mattermost">
<i class="oauth-icon"><img alt="mattermost-logo" src="<%- serverURL %>/images/mattermost-logo.svg" /></i> <%= __('Sign in via %s', 'Mattermost') %>
</a>
<% } %>
<% if (authProviders.dropbox) { %>

1300
yarn.lock

File diff suppressed because it is too large Load Diff