summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--README.md3
-rw-r--r--app.js2
-rw-r--r--docs/guides/auth/ldap-AD.md42
-rw-r--r--lib/config/default.js3
-rw-r--r--lib/config/index.js2
-rw-r--r--lib/response.js14
-rw-r--r--locales/id.json115
-rw-r--r--package.json2
-rw-r--r--public/docs/features.md2
-rw-r--r--public/docs/release-notes.md49
-rw-r--r--public/views/index/body.ejs5
11 files changed, 228 insertions, 11 deletions
diff --git a/README.md b/README.md
index e93108c8..ecdc8c77 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,6 @@ CodiMD
[![#CodiMD on matrix.org][matrix.org-image]][matrix.org-url]
[![build status][travis-image]][travis-url]
[![version][github-version-badge]][github-release-page]
-[![Help Contribute to Open Source][codetriage-image]][codetriage-url]
[![POEditor][poeditor-image]][poeditor-url]
CodiMD lets you create real-time collaborative markdown notes on all platforms.
@@ -366,7 +365,5 @@ See more at [http://operational-transformation.github.io/](http://operational-tr
[github-release-page]: https://github.com/hackmdio/codimd/releases
[standardjs-image]: https://cdn.rawgit.com/feross/standard/master/badge.svg
[standardjs-url]: https://github.com/feross/standard
-[codetriage-image]: https://www.codetriage.com/hackmdio/codimd/badges/users.svg
-[codetriage-url]: https://www.codetriage.com/hackmdio/codimd
[poeditor-image]: https://img.shields.io/badge/POEditor-translate-blue.svg
[poeditor-url]: https://poeditor.com/join/project/1OpGjF2Jir
diff --git a/app.js b/app.js
index 24f0516f..ab37bff1 100644
--- a/app.js
+++ b/app.js
@@ -113,7 +113,7 @@ if (config.csp.enable) {
}
i18n.configure({
- locales: ['en', 'zh-CN', 'zh-TW', 'fr', 'de', 'ja', 'es', 'ca', 'el', 'pt', 'it', 'tr', 'ru', 'nl', 'hr', 'pl', 'uk', 'hi', 'sv', 'eo', 'da', 'ko'],
+ locales: ['en', 'zh-CN', 'zh-TW', 'fr', 'de', 'ja', 'es', 'ca', 'el', 'pt', 'it', 'tr', 'ru', 'nl', 'hr', 'pl', 'uk', 'hi', 'sv', 'eo', 'da', 'ko', 'id'],
cookie: 'locale',
directory: path.join(__dirname, '/locales'),
updateFiles: config.updateI18nFiles
diff --git a/docs/guides/auth/ldap-AD.md b/docs/guides/auth/ldap-AD.md
new file mode 100644
index 00000000..77521db3
--- /dev/null
+++ b/docs/guides/auth/ldap-AD.md
@@ -0,0 +1,42 @@
+AD LDAP auth
+===
+
+
+To setup your CodiMD instance with Active Directory you need the following configs:
+
+```
+CMD_LDAP_URL=ldap://internal.example.com
+CMD_LDAP_BINDDN=cn=binduser,cn=Users,dc=internal,dc=example,dc=com
+CMD_LDAP_BINDCREDENTIALS=<super secret password>
+CMD_LDAP_SEARCHBASE=dc=internal,dc=example,dc=com
+CMD_LDAP_SEARCHFILTER=(&(objectcategory=person)(objectclass=user)(|(sAMAccountName={{username}})(mail={{username}})))
+CMD_LDAP_USERIDFIELD=sAMAccountName
+CMD_LDAP_PROVIDERNAME=Example Inc AD
+```
+
+
+`CMD_LDAP_BINDDN` is either the `distinguishedName` or the `userPrincipalName`. *This can cause "username/password is invalid" when either this value or the password from `CMD_LDAP_BINDCREDENTIALS` are incorrect.*
+
+`CMD_LDAP_SEARCHFILTER` matches on all users and uses either the email address or the `sAMAccountName` (usually the login name you also use to login to Windows).
+
+*Only using `sAMAccountName` looks like this:* `(&(objectcategory=person)(objectclass=user)(sAMAccountName={{username}}))`
+
+`CMD_LDAP_USERIDFIELD` says we want to use `sAMAccountName` as unique identifier for the account itself.
+
+`CMD_LDAP_PROVIDERNAME` just the name written above the username and password field on the login page.
+
+
+Same in json:
+
+```json
+"ldap": {
+ "url": "ldap://internal.example.com",
+ "bindDn": "cn=binduser,cn=Users,dc=internal,dc=example,dc=com",
+ "bindCredentials": "<super secret password>",
+ "searchBase": "dc=internal,dc=example,dc=com",
+ "searchFilter": "(&(objectcategory=person)(objectclass=user)(|(sAMAccountName={{username}})(mail={{username}})))",
+ "useridField": "sAMAccountName",
+},
+```
+
+More details and example: https://www.npmjs.com/package/passport-ldapauth
diff --git a/lib/config/default.js b/lib/config/default.js
index 6096bce4..c34279bd 100644
--- a/lib/config/default.js
+++ b/lib/config/default.js
@@ -104,7 +104,8 @@ module.exports = {
baseURL: undefined,
clientID: undefined,
clientSecret: undefined,
- scope: undefined
+ scope: undefined,
+ version: 'v4'
},
mattermost: {
baseURL: undefined,
diff --git a/lib/config/index.js b/lib/config/index.js
index f96684ea..26f0ae96 100644
--- a/lib/config/index.js
+++ b/lib/config/index.js
@@ -104,7 +104,7 @@ config.isOAuth2Enable = config.oauth2.clientID && config.oauth2.clientSecret
config.isPDFExportEnable = config.allowPDFExport
// Check gitlab api version
-if (config.gitlab.version !== 'v4' && config.gitlab.version !== 'v3') {
+if (config.gitlab && config.gitlab.version !== 'v4' && config.gitlab.version !== 'v3') {
logger.warn('config.js contains wrong version (' + config.gitlab.version + ') for gitlab api; it should be \'v3\' or \'v4\'. Defaulting to v4')
config.gitlab.version = 'v4'
}
diff --git a/lib/response.js b/lib/response.js
index 37211998..4df036b7 100644
--- a/lib/response.js
+++ b/lib/response.js
@@ -32,6 +32,9 @@ var response = {
errorBadRequest: function (res) {
responseError(res, '400', 'Bad Request', 'something not right.')
},
+ errorTooLong: function (res) {
+ responseError(res, '413', 'Payload Too Large', 'Shorten your note!')
+ },
errorInternalError: function (res) {
responseError(res, '500', 'Internal Error', 'wtf.')
},
@@ -145,7 +148,12 @@ function responseCodiMD (res, note) {
function newNote (req, res, next) {
var owner = null
- var body = req.body ? req.body : ''
+ var body = ''
+ if (req.body && req.body.length > config.documentMaxLength) {
+ return response.errorTooLong(res)
+ } else if (req.body) {
+ body = req.body
+ }
body = body.replace(/[\r]/g, '')
if (req.isAuthenticated()) {
owner = req.user.id
@@ -341,6 +349,10 @@ function actionPDF (req, res, note) {
var path = config.tmpPath + '/' + Date.now() + '.pdf'
content = content.replace(/\]\(\//g, '](' + url + '/')
markdownpdf().from.string(content).to(path, function () {
+ if (!fs.existsSync(path)) {
+ logger.error('PDF seems to not be generated as expected. File doesn\'t exist: ' + path)
+ return response.errorInternalError(res)
+ }
var stream = fs.createReadStream(path)
var filename = title
// Be careful of special characters
diff --git a/locales/id.json b/locales/id.json
new file mode 100644
index 00000000..9748a5f4
--- /dev/null
+++ b/locales/id.json
@@ -0,0 +1,115 @@
+{
+ "Collaborative markdown notes": "Catatan markdown kolaboratif",
+ "Realtime collaborative markdown notes on all platforms.": "Berkolaborasi di catatan markdown di semua platform secara realtime",
+ "Best way to write and share your knowledge in markdown.": "Platform terbaik untuk menulis dan membagikan markdown",
+ "Intro": "Perkenalan",
+ "History": "Riwayat",
+ "New guest note": "Catatan baru (sebagai tamu)",
+ "Collaborate with URL": "Kolaborasi real-time",
+ "Support charts and MathJax": "Mendukung charts dan MathJax",
+ "Support slide mode": "Mendukung mode slide",
+ "Sign In": "Masuk",
+ "Below is the history from browser": "Dibawah ini adalah riwayat dari peramban ini",
+ "Welcome!": "Selamat Datang",
+ "New note": "Catatan Baru",
+ "or": "atau",
+ "Sign Out": "Keluar",
+ "Explore all features": "Jelajahi semua fitur",
+ "Select tags...": "Pilih tanda...",
+ "Search keyword...": "Cari berdasarkan kata kunci...",
+ "Sort by title": "Urutkan berdasarkan judul",
+ "Title": "Judul",
+ "Sort by time": "Urutkan berdasarkan waktu",
+ "Time": "Waktu",
+ "Export history": "Ekspor Riwayat",
+ "Import history": "Impor Riwayat",
+ "Clear history": "Bersihkan Riwayat",
+ "Refresh history": "Muat-ulang Riwayat",
+ "No history": "Tidak ada riwayat",
+ "Import from browser": "Impor dari browser",
+ "Releases": "Penerbitan",
+ "Are you sure?": "Apakah anda yakin?",
+ "Do you really want to delete this note?": "Apakah anda yakin ingin menghapus catatan ini?",
+ "All users will lose their connection.": "Semua pengguna akan kehilangan koneksi nya",
+ "Cancel": "Batal",
+ "Yes, do it!": "Ya, lakukan!",
+ "Choose method": "Pilih cara",
+ "Sign in via %s": "Masuk menggunakan %s",
+ "New": "Baru",
+ "Publish": "Terbitkan",
+ "Extra": "Tambahan",
+ "Revision": "Revisi",
+ "Slide Mode": "Mode Slide",
+ "Export": "Ekspor",
+ "Import": "Impor",
+ "Clipboard": "Papan Klip",
+ "Download": "Unduh",
+ "Raw HTML": "File HTML",
+ "Edit": "Ubah",
+ "View": "Lihat",
+ "Both": "Keduanya",
+ "Help": "Bantuan",
+ "Upload Image": "Unggah Gambar",
+ "Menu": "Menu",
+ "This page need refresh": "Halaman ini perlu dimuat ulang",
+ "You have an incompatible client version.": "Versi pramban anda tidak kompatibel",
+ "Refresh to update.": "Muat ulang untuk memperbarui",
+ "New version available!": "Versi baru tersedia!",
+ "See releases notes here": "Lihat catatan penerbitan",
+ "Refresh to enjoy new features.": "Muat ulang untuk menikmati fitur baru.",
+ "Your user state has changed.": "Data pengguna anda telah berubah.",
+ "Refresh to load new user state.": "Muat ulang untuk memuat data baru pengguna.",
+ "Refresh": "Muat ulang",
+ "Contacts": "Kontak",
+ "Report an issue": "Laporkan kesalahan",
+ "Meet us on %s": "Temui kami di %s",
+ "Send us email": "Kirim kami email",
+ "Documents": "Dokumen",
+ "Features": "Fitur",
+ "YAML Metadata": "Metadata YML",
+ "Slide Example": "Contoh Slide",
+ "Cheatsheet": "Cheatsheet",
+ "Example": "Contoh",
+ "Syntax": "Sintaks",
+ "Header": "Header",
+ "Unordered List": "Daftar tak ber-urutan",
+ "Ordered List": "Daftar ber-urutan",
+ "Todo List": "Centang",
+ "Blockquote": "Blok kutipan",
+ "Bold font": "Tebal",
+ "Italics font": "Miring",
+ "Strikethrough": "Garis",
+ "Inserted text": "Teks ber-garis bawah",
+ "Marked text": "Teks yang disorot",
+ "Link": "Link",
+ "Image": "Gambar",
+ "Code": "Kode",
+ "Externals": "Eksternal",
+ "This is a alert area.": "Ini adalah area alert.",
+ "Revert": "Kembalikan",
+ "Import from clipboard": "Impor dari papan klip",
+ "Paste your markdown or webpage here...": "Tempel markdown atau halaman web disini",
+ "Clear": "Bersihkan",
+ "This note is locked": "Catatan ini terkunci",
+ "Sorry, only owner can edit this note.": "Maaf, hanya pemilik yang bisa mengubah catatan ini",
+ "OK": "OK",
+ "Reach the limit": "Memenuhi batas",
+ "Sorry, you've reached the max length this note can be.": "Maaf, anda telah memenuhi batas maksimum jumlah catatan ini",
+ "Please reduce the content or divide it to more notes, thank you!": "Tolong persingkat catatan nya.",
+ "Import from Gist": "Impor dari Gist",
+ "Paste your gist url here...": "Templekan URL gist anda disini...",
+ "Import from Snippet": "Impor dari Snippet",
+ "Select From Available Projects": "Pilih dari Project yang tersedia",
+ "Select From Available Snippets": "Pilih dari Snippet yang tersedia",
+ "OR": "Atau",
+ "Export to Snippet": "Ekspor ke Snippet",
+ "Select Visibility Level": "Pilih tingkat penglihatan",
+ "Night Theme": "Mode Malam",
+ "Follow us on %s and %s.": "Ikuti kami di %s, dan %s.",
+ "Privacy": "Privasi",
+ "Terms of Use": "Aturan Penggunaan",
+ "Do you really want to delete your user account?": "Apakah anda yakin ingin menghapus akun anda?",
+ "This will delete your account, all notes that are owned by you and remove all references to your account from other notes.": "Ini akan menghapus akun anda, semua catatan yang dimiliki oleh anda akan dihapus dan menghapus semua referensi ke akun anda dari catatan lain.",
+ "Delete user": "Hapus pengguna",
+ "Export user data": "Ekspor data pengguna"
+} \ No newline at end of file
diff --git a/package.json b/package.json
index a25a929f..a6f935c5 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "CodiMD",
- "version": "1.2.0",
+ "version": "1.2.1",
"description": "Realtime collaborative markdown notes on all platforms.",
"main": "app.js",
"license": "AGPL-3.0",
diff --git a/public/docs/features.md b/public/docs/features.md
index f684ca62..1915f0ef 100644
--- a/public/docs/features.md
+++ b/public/docs/features.md
@@ -195,7 +195,7 @@ When you’re a carpenter making a beautiful chest of drawers, you’re not goin
## Externals
### YouTube
-{%youtube 1G4isv_Fylg %}
+{%youtube aqz-KE-bpKQ %}
### Vimeo
{%vimeo 124148255 %}
diff --git a/public/docs/release-notes.md b/public/docs/release-notes.md
index 66202009..c775b70a 100644
--- a/public/docs/release-notes.md
+++ b/public/docs/release-notes.md
@@ -1,6 +1,55 @@
Release Notes
===
+<i class="fa fa-tag"></i> 1.2.1 <i class="fa fa-clock-o"></i> 2018-09-26 00:00
+---
+
+### Enhancements
+* Update Italian translations
+* Update Japanese translations
+* Update markdown-pdf
+* Add support for unix sockets
+* Update "follow us" information to Community channel and translation
+* Add Cloudron installation method
+* Add guide for Mattermost authentication
+* Update various packages
+* Add Indonesian language as new translation
+
+### Fixes
+* Fix content types in status router
+* Fix some modal colors in night mode
+* Fix CSP to allow usage of speaker notes
+* Fix some wrong title attributes in the editor toolbar
+* Fix some confusion about the default location of images. It's always the local filesystem now
+* Fix object handling in avatar generation code
+* Finally fix error handling of LZ-String by using self-maintained version
+* Fix migration handling
+* Fix gitlab API version
+* Fix some server crashes caused by PDF creation
+* Fix document length limit on post to `/new`
+* Fix broken youtube embedding on `/features` page
+
+### Refactors
+* Refactor generation of table of contents
+* Refactor "copyright"-section to be a "Powered by"
+
+### Removes
+* Remove unneeded inline styling
+
+### Deprecations
+* NodeJS version 6
+* Mattermost login integration (is replaced by [generic oAuth2 module](https://github.com/hackmdio/codimd/blob/6ce7b20a7f92ccff2f7f870ff5d116d685310cfd/docs/guides/auth/mattermost-self-hosted.md))
+
+### Honorable mentions
+* [Alex Hesse (Pingu501)](https://github.com/Pingu501)
+* [Alexander Wellbrock (w4tsn)](https://github.com/w4tsn)
+* [Cédric Couralet (micedre)](https://github.com/micedre)
+* [Girish Ramakrishnan (gramakri)](https://github.com/gramakri)
+* [maahl](https://github.com/maahl)
+* [Max Wu (jackycute)](https://github.com/jackycute)
+* [Miranda (ahihi)](https://github.com/ahihi)
+* [Ondřej Slabý (maxer456)](https://github.com/maxer456)
+
<i class="fa fa-tag"></i> 1.2.0 <i class="fa fa-clock-o"></i> 2018-06-28 00:00
---
diff --git a/public/views/index/body.ejs b/public/views/index/body.ejs
index 53dbf2a2..0f2813b9 100644
--- a/public/views/index/body.ejs
+++ b/public/views/index/body.ejs
@@ -147,12 +147,13 @@
<option value="eo">Esperanto</option>
<option value="da">dansk</option>
<option value="ko">한국어</option>
+ <option value="id">Bahasa Indonesia</option>
</select>
<p>
- &copy; 2018 <a href="https://hackmd.io">CodiMD</a> | <a href="<%- url %>/s/release-notes" target="_blank"><%= __('Releases') %></a><% if(privacyStatement) { %> | <a href="<%- url %>/s/privacy" target="_blank"><%= __('Privacy') %></a><% } %><% if(termsOfUse) { %> | <a href="<%- url %>/s/terms-of-use" target="_blank"><%= __('Terms of Use') %></a><% } %>
+ Powered by <a href="https://codimd.org">CodiMD</a> | <a href="<%- url %>/s/release-notes" target="_blank"><%= __('Releases') %></a><% if(privacyStatement) { %> | <a href="<%- url %>/s/privacy" target="_blank"><%= __('Privacy') %></a><% } %><% if(termsOfUse) { %> | <a href="<%- url %>/s/terms-of-use" target="_blank"><%= __('Terms of Use') %></a><% } %>
</p>
<h6 class="social-foot">
- <%- __('Follow us on %s and %s.', '<a href="https://github.com/hackmdio/CodiMD" target="_blank"><i class="fa fa-github"></i> GitHub</a>, <a href="https://riot.im/app/#/room/#codimd:matrix.org" target="_blank"><i class="fa fa-comments"></i> Riot</a>') %>
+ <%- __('Follow us on %s and %s.', '<a href="https://github.com/hackmdio/CodiMD" target="_blank"><i class="fa fa-github"></i> GitHub</a>, <a href="https://riot.im/app/#/room/#codimd:matrix.org" target="_blank"><i class="fa fa-comments"></i> Riot</a>', '<a href="https://translate.codimd.org" target="_blank"><i class="fa fa-globe"></i> POEditor</a>') %>
</h6>
</div>
</div>