summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--app.js2
-rw-r--r--lib/config/default.js3
-rw-r--r--lib/config/defaultSSL.js2
-rw-r--r--lib/config/dockerSecret.js3
-rw-r--r--lib/config/environment.js3
-rw-r--r--lib/config/index.js9
-rw-r--r--lib/migrations/20171009121200-longtext-for-mysql.js16
-rw-r--r--lib/models/note.js2
-rw-r--r--lib/models/revision.js10
-rw-r--r--package.json2
-rw-r--r--public/docs/release-notes.md41
-rw-r--r--public/js/extra.js3
-rw-r--r--public/views/index/body.ejs2
14 files changed, 82 insertions, 17 deletions
diff --git a/.gitignore b/.gitignore
index ab83c145..755e3f94 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
node_modules
+package-lock.json
composer.phar
composer.lock
.env.*.php
diff --git a/app.js b/app.js
index c3f1fe8e..37e772bc 100644
--- a/app.js
+++ b/app.js
@@ -34,7 +34,7 @@ var data = {
version: config.version,
GOOGLE_API_KEY: config.google.clientSecret,
GOOGLE_CLIENT_ID: config.google.clientID,
- DROPBOX_APP_KEY: config.dropbox.clientSecret
+ DROPBOX_APP_KEY: config.dropbox.appKey
}
ejs.renderFile(constpath, data, {}, function (err, str) {
diff --git a/lib/config/default.js b/lib/config/default.js
index 8d36db02..40803476 100644
--- a/lib/config/default.js
+++ b/lib/config/default.js
@@ -81,7 +81,8 @@ module.exports = {
},
dropbox: {
clientID: undefined,
- clientSecret: undefined
+ clientSecret: undefined,
+ appKey: undefined
},
google: {
clientID: undefined,
diff --git a/lib/config/defaultSSL.js b/lib/config/defaultSSL.js
index 1f1d5590..362c62a1 100644
--- a/lib/config/defaultSSL.js
+++ b/lib/config/defaultSSL.js
@@ -12,6 +12,6 @@ function getFile (path) {
module.exports = {
sslkeypath: getFile('/run/secrets/key.pem'),
sslcertpath: getFile('/run/secrets/cert.pem'),
- sslcapath: getFile('/run/secrets/ca.pem'),
+ sslcapath: getFile('/run/secrets/ca.pem') !== undefined ? [getFile('/run/secrets/ca.pem')] : [],
dhparampath: getFile('/run/secrets/dhparam.pem')
}
diff --git a/lib/config/dockerSecret.js b/lib/config/dockerSecret.js
index ac54fd19..b9116cd3 100644
--- a/lib/config/dockerSecret.js
+++ b/lib/config/dockerSecret.js
@@ -44,7 +44,8 @@ if (fs.existsSync(basePath)) {
},
dropbox: {
clientID: getSecret('dropbox_clientID'),
- clientSecret: getSecret('dropbox_clientSecret')
+ clientSecret: getSecret('dropbox_clientSecret'),
+ appKey: getSecret('dropbox_appKey')
},
google: {
clientID: getSecret('google_clientID'),
diff --git a/lib/config/environment.js b/lib/config/environment.js
index 27e63591..5a297382 100644
--- a/lib/config/environment.js
+++ b/lib/config/environment.js
@@ -56,7 +56,8 @@ module.exports = {
},
dropbox: {
clientID: process.env.HMD_DROPBOX_CLIENTID,
- clientSecret: process.env.HMD_DROPBOX_CLIENTSECRET
+ clientSecret: process.env.HMD_DROPBOX_CLIENTSECRET,
+ appKey: process.env.HMD_DROPBOX_APPKEY
},
google: {
clientID: process.env.HMD_GOOGLE_CLIENTID,
diff --git a/lib/config/index.js b/lib/config/index.js
index 3ac3de53..d44207bf 100644
--- a/lib/config/index.js
+++ b/lib/config/index.js
@@ -13,8 +13,10 @@ const debugConfig = {
debug: (env === Environment.development)
}
+const {version} = require(path.join(appRootPath, 'package.json'))
+
const packageConfig = {
- version: '0.5.1',
+ version: version,
minimumCompatibleVersion: '0.5.0'
}
@@ -96,7 +98,10 @@ config.isSAMLEnable = config.saml.idpSsoUrl
config.isPDFExportEnable = config.allowpdfexport
// generate correct path
-config.sslcapath = path.join(appRootPath, config.sslcapath)
+config.sslcapath.forEach(function (capath, i, array) {
+ array[i] = path.resolve(appRootPath, capath)
+})
+
config.sslcertpath = path.join(appRootPath, config.sslcertpath)
config.sslkeypath = path.join(appRootPath, config.sslkeypath)
config.dhparampath = path.join(appRootPath, config.dhparampath)
diff --git a/lib/migrations/20171009121200-longtext-for-mysql.js b/lib/migrations/20171009121200-longtext-for-mysql.js
new file mode 100644
index 00000000..61b409ca
--- /dev/null
+++ b/lib/migrations/20171009121200-longtext-for-mysql.js
@@ -0,0 +1,16 @@
+'use strict'
+module.exports = {
+ up: function (queryInterface, Sequelize) {
+ queryInterface.changeColumn('Notes', 'content', {type: Sequelize.TEXT('long')})
+ queryInterface.changeColumn('Revisions', 'patch', {type: Sequelize.TEXT('long')})
+ queryInterface.changeColumn('Revisions', 'content', {type: Sequelize.TEXT('long')})
+ queryInterface.changeColumn('Revisions', 'latContent', {type: Sequelize.TEXT('long')})
+ },
+
+ down: function (queryInterface, Sequelize) {
+ queryInterface.changeColumn('Notes', 'content', {type: Sequelize.TEXT})
+ queryInterface.changeColumn('Revisions', 'patch', {type: Sequelize.TEXT})
+ queryInterface.changeColumn('Revisions', 'content', {type: Sequelize.TEXT})
+ queryInterface.changeColumn('Revisions', 'latContent', {type: Sequelize.TEXT})
+ }
+}
diff --git a/lib/models/note.js b/lib/models/note.js
index c0ef1374..33dde80d 100644
--- a/lib/models/note.js
+++ b/lib/models/note.js
@@ -60,7 +60,7 @@ module.exports = function (sequelize, DataTypes) {
}
},
content: {
- type: DataTypes.TEXT,
+ type: DataTypes.TEXT('long'),
get: function () {
return sequelize.processData(this.getDataValue('content'), '')
},
diff --git a/lib/models/revision.js b/lib/models/revision.js
index 225a95d4..170931b8 100644
--- a/lib/models/revision.js
+++ b/lib/models/revision.js
@@ -58,7 +58,7 @@ module.exports = function (sequelize, DataTypes) {
defaultValue: Sequelize.UUIDV4
},
patch: {
- type: DataTypes.TEXT,
+ type: DataTypes.TEXT('long'),
get: function () {
return sequelize.processData(this.getDataValue('patch'), '')
},
@@ -67,7 +67,7 @@ module.exports = function (sequelize, DataTypes) {
}
},
lastContent: {
- type: DataTypes.TEXT,
+ type: DataTypes.TEXT('long'),
get: function () {
return sequelize.processData(this.getDataValue('lastContent'), '')
},
@@ -76,7 +76,7 @@ module.exports = function (sequelize, DataTypes) {
}
},
content: {
- type: DataTypes.TEXT,
+ type: DataTypes.TEXT('long'),
get: function () {
return sequelize.processData(this.getDataValue('content'), '')
},
@@ -237,8 +237,8 @@ module.exports = function (sequelize, DataTypes) {
// if no revision available
Revision.create({
noteId: note.id,
- lastContent: note.content,
- length: note.content.length,
+ lastContent: note.content ? note.content : '',
+ length: note.content ? note.content.length : 0,
authorship: note.authorship
}).then(function (revision) {
Revision.finishSaveNoteRevision(note, revision, callback)
diff --git a/package.json b/package.json
index 43668883..3f30b133 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "hackmd",
- "version": "0.5.1",
+ "version": "1.0.0-ce",
"description": "Realtime collaborative markdown notes on all platforms.",
"main": "app.js",
"license": "AGPL-3.0",
diff --git a/public/docs/release-notes.md b/public/docs/release-notes.md
index 2e0a71c6..fa0c5875 100644
--- a/public/docs/release-notes.md
+++ b/public/docs/release-notes.md
@@ -1,6 +1,45 @@
Release Notes
===
+<i class="fa fa-tag"></i> 1.0.0-ce <i class="fa fa-clock-o"></i> 2018-01-18 12:00
+---
+### License
+* Switch from MIT to AGPL
+
+### Enhancements
+* Improve language support
+* Allow themes for reveal
+* Add dark theme for editor and view
+* Add danish translation
+* Add simplified chinese translation
+* Provide new permission table
+* Make HSTS configurable
+* Make PDF export configurable
+* Add Mattermost auth support
+* Add SAML support
+
+### Fixes
+* Fix regex for speaker notes
+* Fix S3 endpoint support
+* Fix German translation
+* Fix English translation
+* Fix broken profile images
+* Fix XSS attacks
+* Fix history order
+* Fix missing boolean settings
+* Fix LDAP auth
+* Fix too long notes droping content
+* Fix mermaid compatiblity with new version
+* Fix SSL CA path parsing
+
+### Refactor
+* Refactor main page
+* Refactor status pages
+* Refactor config handling
+* Refactor auth backend
+* Refactor code styling
+* Refactor middleware to modules
+
<i class="fa fa-tag"></i> 0.5.1 `Doppio` <i class="fa fa-clock-o"></i> 2017-03-23 00:20
---
### Enhancements
@@ -636,4 +675,4 @@ Release Notes
+ Preview html
+ Realtime collaborate
+ Cross-platformed
-+ Recently used history \ No newline at end of file
++ Recently used history
diff --git a/public/js/extra.js b/public/js/extra.js
index 75aa29af..ec7d39da 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -1007,9 +1007,10 @@ md.use(markdownitContainer, 'info', { render: renderContainer })
md.use(markdownitContainer, 'warning', { render: renderContainer })
md.use(markdownitContainer, 'danger', { render: renderContainer })
+let defaultImageRender = md.renderer.rules.image
md.renderer.rules.image = function (tokens, idx, options, env, self) {
tokens[idx].attrJoin('class', 'raw')
- return self.renderToken(...arguments)
+ return defaultImageRender(...arguments)
}
md.renderer.rules.list_item_open = function (tokens, idx, options, env, self) {
tokens[idx].attrJoin('class', 'raw')
diff --git a/public/views/index/body.ejs b/public/views/index/body.ejs
index d7b4458e..913eef10 100644
--- a/public/views/index/body.ejs
+++ b/public/views/index/body.ejs
@@ -126,7 +126,7 @@
<iframe src="//ghbtns.com/github-btn.html?user=hackmdio&repo=hackmd&type=star&count=true" frameborder="0" scrolling="0" width="104px" height="20px"></iframe>
</h6>
<p>
- &copy; 2017 <a href="https://www.facebook.com/hackmdio" target="_blank"><i class="fa fa-facebook-square"></i> HackMD</a> | <a href="<%- url %>/s/release-notes" target="_blank"><%= __('Releases') %></a>
+ &copy; 2018 <a href="https://www.facebook.com/hackmdio" target="_blank"><i class="fa fa-facebook-square"></i> HackMD</a> | <a href="<%- url %>/s/release-notes" target="_blank"><%= __('Releases') %></a>
</p>
<select class="ui-locale">
<option value="en">English</option>