Skip to content

Commit e29422f

Browse files
authored
Merge pull request #1477 from hackmdio/release/2.0.1
Release 2.0.1
2 parents 16b9409 + e07884c commit e29422f

File tree

16 files changed

+115
-35
lines changed

16 files changed

+115
-35
lines changed

Diff for: README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Built on [HackMD](https://hackmd.io) source code, CodiMD lets you host and contr
1515
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
1616
# Table of Contents
1717

18+
- [HackMD](#hackmd)
1819
- [CodiMD - The Open Source HackMD](#codimd---the-open-source-hackmd)
1920
- [Documentation](#documentation)
2021
- [Deployment](#deployment)
@@ -27,14 +28,17 @@ Built on [HackMD](https://hackmd.io) source code, CodiMD lets you host and contr
2728

2829
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2930

30-
## CodiMD - The Open Source HackMD
31+
## HackMD
32+
3133
[HackMD](https://hackmd.io) helps developers write better documents and build active communities with open collaboration.
3234
HackMD is built with one promise - **You own and control all your content**:
3335
- You should be able to easily [download all your online content at once](https://hackmd.io/c/news/%2Fs%2Fr1cx3a3SE).
3436
- Your content formatting should be portable as well. (That's why we choose [markdown](https://hackmd.io/features#Typography).)
3537
- You should be able to control your content's presentation with HTML, [slide mode](https://hackmd.io/p/slide-example), or [book mode](https://hackmd.io/c/book-example/).
3638

37-
With the same promise of you owning your content, CodiMD is the free software version of [HackMD](https://hackmd.io), developed and opened source by the HackMD team with reduced features, so you can use CodiMD for your community and own your data. *(See the [origin of the name CodiMD](https://github.com/hackmdio/hackmd/issues/720).)*
39+
## CodiMD - The Open Source HackMD
40+
41+
CodiMD is the free software version of [HackMD](https://hackmd.io), developed and opened source by the HackMD team with reduced features (without book mode), you can use CodiMD for your community and own all your data. *(See the [origin of the name CodiMD](https://github.com/hackmdio/hackmd/issues/720).)*
3842

3943
CodiMD is perfect for open communities, while HackMD emphasizes on permission and access controls for commercial use cases.
4044

Diff for: lib/auth/oauth2/strategy.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ function parseProfile (data) {
77
const username = extractProfileAttribute(data, config.oauth2.userProfileUsernameAttr)
88
const displayName = extractProfileAttribute(data, config.oauth2.userProfileDisplayNameAttr)
99
const email = extractProfileAttribute(data, config.oauth2.userProfileEmailAttr)
10+
const photo = extractProfileAttribute(data, config.oauth2.userProfilePhotoAttr)
1011

1112
if (!username) {
1213
throw new Error('cannot fetch username: please set correct CMD_OAUTH2_USER_PROFILE_USERNAME_ATTR')
@@ -16,7 +17,8 @@ function parseProfile (data) {
1617
id: username,
1718
username: username,
1819
displayName: displayName,
19-
email: email
20+
email: email,
21+
photo: photo
2022
}
2123
}
2224

Diff for: lib/config/default.js

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ module.exports = {
9999
userProfileUsernameAttr: 'username',
100100
userProfileDisplayNameAttr: 'displayName',
101101
userProfileEmailAttr: 'email',
102+
userProfilePhotoAttr: 'photo',
102103
scope: 'email'
103104
},
104105
facebook: {

Diff for: lib/config/dockerSecret.js

+26-6
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,32 @@ function getSecret (secret) {
1313

1414
if (fs.existsSync(basePath)) {
1515
module.exports = {
16-
sessionsecret: getSecret('sessionsecret'),
17-
sslkeypath: getSecret('sslkeypath'),
18-
sslcertpath: getSecret('sslcertpath'),
19-
sslcapath: getSecret('sslcapath'),
20-
dhparampath: getSecret('dhparampath'),
16+
dbURL: getSecret('dburl'),
17+
// ssl path
18+
sslKeyPath: getSecret('sslkeypath'),
19+
sslCertPath: getSecret('sslcertpath'),
20+
sslCAPath: getSecret('sslcapath'),
21+
dhParamPath: getSecret('dhparampath'),
22+
// session
23+
sessionSecret: getSecret('sessionsecret'),
24+
imgur: {
25+
clientID: getSecret('imgur_clientid')
26+
},
2127
s3: {
2228
accessKeyId: getSecret('s3_acccessKeyId'),
2329
secretAccessKey: getSecret('s3_secretAccessKey')
2430
},
31+
minio: {
32+
accessKey: getSecret('minio_accessKey'),
33+
secretKey: getSecret('minio_secretKey')
34+
},
2535
azure: {
2636
connectionString: getSecret('azure_connectionString')
2737
},
38+
oauth2: {
39+
clientID: getSecret('oauth2_clientID'),
40+
clientSecret: getSecret('oauth2_clientSecret')
41+
},
2842
facebook: {
2943
clientID: getSecret('facebook_clientID'),
3044
clientSecret: getSecret('facebook_clientSecret')
@@ -54,6 +68,12 @@ if (fs.existsSync(basePath)) {
5468
clientID: getSecret('google_clientID'),
5569
clientSecret: getSecret('google_clientSecret')
5670
},
57-
imgur: getSecret('imgur_clientid')
71+
ldap: {
72+
bindCredentials: getSecret('ldap_bindCredentials'),
73+
tlsca: getSecret('ldap_tlsca')
74+
},
75+
saml: {
76+
idpCert: getSecret('saml_idpCert')
77+
}
5878
}
5979
}

Diff for: lib/config/environment.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ module.exports = {
9696
scope: process.env.CMD_OAUTH2_SCOPE,
9797
userProfileUsernameAttr: process.env.CMD_OAUTH2_USER_PROFILE_USERNAME_ATTR,
9898
userProfileDisplayNameAttr: process.env.CMD_OAUTH2_USER_PROFILE_DISPLAY_NAME_ATTR,
99-
userProfileEmailAttr: process.env.CMD_OAUTH2_USER_PROFILE_EMAIL_ATTR
99+
userProfileEmailAttr: process.env.CMD_OAUTH2_USER_PROFILE_EMAIL_ATTR,
100+
userProfilePhotoAttr: process.env.CMD_OAUTH2_USER_PROFILE_PHOTO_ATTR
100101
},
101102
dropbox: {
102103
clientID: process.env.CMD_DROPBOX_CLIENTID,

Diff for: lib/imageRouter/minio.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const config = require('../config')
66
const { getImageMimeType } = require('../utils')
77
const logger = require('../logger')
88

9-
const Minio = require('lib/imageRouter/minio')
9+
const Minio = require('minio')
1010
const minioClient = new Minio.Client({
1111
endPoint: config.minio.endPoint,
1212
port: config.minio.port,

Diff for: lib/models/user.js

+4
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ module.exports = function (sequelize, DataTypes) {
140140
case 'saml':
141141
photo = generateAvatarURL(profile.username, profile.emails[0], bigger)
142142
break
143+
case 'oauth2':
144+
photo = profile.photo
145+
if (!photo) photo = generateAvatarURL(profile.username, profile.email, bigger)
146+
break
143147
}
144148
return photo
145149
}

Diff for: lib/note/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async function getNoteById (noteId, { includeUser } = { includeUser: false }) {
3434
}
3535

3636
async function createNote (userId, noteAlias) {
37-
if (!config.allowAnonymous && !!userId) {
37+
if (!config.allowAnonymous && !userId) {
3838
throw new Error('can not create note')
3939
}
4040

Diff for: lib/web/middleware/checkVersion.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ async function checkVersion (ctx) {
3030
const { statusCode, body: data } = await rp({
3131
url: `${VERSION_CHECK_ENDPOINT}?v=${config.version}`,
3232
method: 'GET',
33-
json: true
33+
json: true,
34+
timeout: 3000
3435
})
3536

3637
if (statusCode !== 200 || data.status === 'error') {
37-
logger.error('Version check failed.')
38+
logger.warn('Version check failed.')
3839
return
3940
}
4041

@@ -46,12 +47,12 @@ async function checkVersion (ctx) {
4647
if (!data.latest) {
4748
const { version, link } = data.versionItem
4849

49-
logger.warn(`Your CodiMD version is out of date! The latest version is ${version}. Please see what's new on ${link}.`)
50+
logger.info(`Your CodiMD version is out of date! The latest version is ${version}. Please see what's new on ${link}.`)
5051
}
5152
} catch (err) {
5253
// ignore and skip version check
53-
logger.error('Version check failed.')
54-
logger.error(err)
54+
logger.warn('Version check failed.')
55+
logger.warn(err)
5556
}
5657
}
5758

Diff for: package-lock.json

+30-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codimd",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Realtime collaborative markdown notes on all platforms.",
55
"keywords": [
66
"Collaborative",
@@ -33,7 +33,7 @@
3333
"@hackmd/codemirror": "~5.49.5",
3434
"@hackmd/diff-match-patch": "~1.1.3",
3535
"@hackmd/idle-js": "~1.0.1",
36-
"@hackmd/imgur": "~0.4.1",
36+
"@hackmd/imgur": "~0.5.0",
3737
"@hackmd/js-sequence-diagrams": "~0.0.1-alpha.3",
3838
"@hackmd/lz-string": "~1.4.4",
3939
"@hackmd/meta-marked": "~0.4.4",

Diff for: public/css/extra.css

+4-4
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
}
109109

110110
.ui-toc-label {
111-
opacity: 0.3;
111+
opacity: 0.9;
112112
background-color: #ccc;
113113
border: none;
114114
-webkit-transition: opacity 0.2s; /* Safari */
@@ -117,13 +117,13 @@
117117

118118
.ui-toc .open .ui-toc-label {
119119
opacity: 1;
120-
color: white;
120+
color: #5f5f5f;
121121
-webkit-transition: opacity 0.2s; /* Safari */
122122
transition: opacity 0.2s;
123123
}
124124

125125
.ui-toc-label:focus {
126-
opacity: 0.3;
126+
opacity: 1;
127127
background-color: #ccc;
128128
color: black;
129129
}
@@ -326,7 +326,7 @@
326326
margin-left: 10px;
327327
font-size: 12px;
328328
font-weight: 500;
329-
color: #999;
329+
color: rgba(0, 0, 0, 0.85);
330330
}
331331

332332
.expand-toggle:hover, .expand-toggle:focus, .back-to-top:hover, .back-to-top:focus, .go-to-bottom:hover, .go-to-bottom:focus {

Diff for: public/css/index.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ div[contenteditable]:empty:not(:focus):before{
570570
.ui-theme-toggle,
571571
.ui-linter-toggle,
572572
.ui-spellcheck-toggle {
573-
opacity: 0.2;
573+
opacity: 0.5;
574574
cursor: pointer;
575575
}
576576

Diff for: public/docs/release-notes.md

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
Release Notes
22
===
33

4+
<i class="fa fa-tag"></i> 2.0.1 Urocissa caerulea <i class="fa fa-clock-o"></i> 2020-04-09
5+
---
6+
7+
[CodiMD 2.0.1](https://github.com/hackmdio/codimd/releases/tag/2.0.1) is a minor release fixing bugs introduced in 2.0.0 and earlier versions along with some enhancements. We encourage everyone to upgrade to 2.0.1 now. See how things are going on [GitHub](https://github.com/hackmdio/codimd/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc+milestone%3ANext). Stay tuned and healthy, and we hope you love it!
8+
9+
10+
### Enhancements
11+
12+
- Allow inline markdown in spoiler summary syntax
13+
- Improve visibility of some UI elements
14+
- Support avatar for OAuth users
15+
16+
### Fixes
17+
18+
- Fix to add missing configs in docker secret
19+
- Fix not able to upload image using imgur
20+
- Fix to improve version checker behavior
21+
- Fix Wikipedia link in 2.0.0 release notes
22+
- Fix require path for minio
23+
- Fix check for creating free url notes
24+
25+
[Check out the complete release note][v2_0_1]. Thank you CodiMD community and all our contributors. ❤️
26+
27+
[v2_0_1]: https://hackmd.io/@codimd/release-notes/%2F%40codimd%2Fv2_0_1
28+
429
<i class="fa fa-tag"></i> 2.0.0 Urocissa caerulea <i class="fa fa-clock-o"></i> 2020-03-02
530
---
631

@@ -11,7 +36,7 @@ Release Notes
1136

1237
> The Taiwan blue magpie (Urocissa caerulea), also called the Taiwan magpie, Formosan blue magpie , or the "long-tailed mountain lady", is a species of bird of the crow family. It is endemic to Taiwan.
1338
>
14-
> \- Wikipedia [Taiwan blue magpie](en.wikipedia.org/wiki/Taiwan_blue_magpie)
39+
> \- Wikipedia [Taiwan blue magpie](https://en.wikipedia.org/wiki/Taiwan_blue_magpie)
1540
1641
In the past few months, we delivered not only a bunch of awesome features but also some critical bug fixes. Moreover, we refactored CodiMD's backend and started to write new tests.
1742

Diff for: public/js/extra.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ md.use(markdownitContainer, 'spoiler', {
11241124
// opening tag
11251125
const summary = m[1] && m[1].trim()
11261126
if (summary) {
1127-
return `<details><summary>${md.utils.escapeHtml(summary)}</summary>\n`
1127+
return `<details><summary>${md.renderInline(summary)}</summary>\n`
11281128
} else {
11291129
return `<details>\n`
11301130
}

Diff for: public/js/lib/syncscroll.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ md.use(markdownitContainer, 'spoiler', {
125125
const partClass = `class="part raw" data-startline="${startline}" data-endline="${endline}"`
126126
const summary = m[1] && m[1].trim()
127127
if (summary) {
128-
return `<details ${partClass}><summary>${md.utils.escapeHtml(summary)}</summary>\n`
128+
return `<details ${partClass}><summary>${md.renderInline(summary)}</summary>\n`
129129
} else {
130130
return `<details ${partClass}>\n`
131131
}

0 commit comments

Comments
 (0)