summaryrefslogtreecommitdiff
path: root/lib/models (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-02-27Run database migrations automatically on startupDavid Mehren1-0/+31
This commit removes the need for separate migrations with the sequelize-cli by running them with umzug on application startup. This is a port of #384 Co-authored-by: Sheogorath <sheogorath@shivering-isles.com> Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-15Linter: Fix all lint errorsPhilip Molares6-125/+127
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-02Fix note creation in FreeURL mode not using templateErik Michelson1-3/+4
As explained in #391, the previous note creation logic didn't handle the case "alias is set, but it's not a file on disk". The fix introduces a separate if-statement for this scenario at the cost of a doubled filesystem read access. Co-Authored-By: @evanlinde Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2020-11-14Replace CodiMD with HedgeDocErik Michelson1-1/+1
Signed-off-by: Erik Michelson <github@erik.michelson.eu> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: References in public/views Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Update links in README Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Update links in SECURITY.md Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Update links in LICENSE Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Update links in docs/configuration.md Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Update links in bin/setup Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: References in docs/guides Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: References in docs/dev Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: References in docs/guides/auth Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: References in docs/setup Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Update various links in code to the new GitHub org. Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: codiMDVersion.js is now hedgeDocVersion.js Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: References in docs/setup/yunohost Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rebrand to HedgeDoc: Add banner and logo Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Update links in docs/guides/migrate-etherpad Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Remove note in docs/guides/auth/github Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Replace links in public/docs/features Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Add todo placeholder in docs/history Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Replace github link in public/views/index/body Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Replace github link in README Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Add logo to README Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Add note about the renaming to the front page Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Removed Travis from README.md and change CodiMD to HedgeDoc in some places Signed-off-by: Yannick Bungers <git@innay.de> Some more renaming to HedgeDoc - Fixed capitalization of HedgeDoc - Added renaming for etherpad migration doc Signed-off-by: Yannick Bungers <git@innay.de> Changed Repo name to hedgedoc Signed-off-by: Yannick Bungers <git@innay.de>
2020-07-04Fixed meta parsing of lang-attribute for using it in the published-viewErik Michelson1-0/+1
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2019-10-04Added customizable og-metadata to notesErik Michelson1-0/+9
Signed-off-by: Erik Michelson <erik@liltv.de>
2019-06-11fix: upgrade sequelize to latest version to fix CVEBoHong Li5-745/+752
Signed-off-by: BoHong Li <a60814billy@gmail.com>
2019-06-08Rework debug loggingSheogorath1-3/+2
We have various places with overly simple if statements that could be handled by our logging library. Also a lot of those logs are not marked as debug logs but as info logs, which can cause confusion during debugging. This patch removed unneeded if clauses around debug logging statements, reworks debug log messages towards ECMA templates and add some new logging statements which might be helpful in order to debug things like image uploads. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2019-05-31Fix eslint warningsSheogorath1-8/+8
Since we are about to release it's time to finally fix our linting. This patch basically runs eslint --fix and does some further manual fixes. Also it sets up eslint to fail on every warning on order to make warnings visable in the CI process. There should no functional change be introduced. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2019-05-26Fix missing pictures for OpenIDSheogorath1-0/+3
Currently a problem appears when using OpenID for authentication as there is no method to add a profile picture right now. This patch makes sure that all undefined login methods get a profile picture. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2019-05-13polyfilling scrypt for node 8.5+Claudius1-4/+13
Signed-off-by: Claudius <opensource@amenthes.de>
2019-05-13asyncified setting and verifying the passwordClaudius1-9/+7
Signed-off-by: Claudius <opensource@amenthes.de>
2019-05-13getting password hashing into a hook where it could be asyncClaudius1-6/+14
Signed-off-by: Claudius <opensource@amenthes.de>
2018-11-21Switch scrypt library to a successorSheogorath1-1/+1
Since our previous scrypt library is unmaintained since 3 years, it's time to look for an alternative. A refactoring towards another password algorithm was worked on and this is probably still the way to go. But for now the successor of our previous library should already be enough. https://www.npmjs.com/package/scrypt (old library) https://github.com/ml1nk/node-scrypt (new library) Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-11-14switching to eslint for code checkingClaudius Coenen2-1/+2
most rules degraded to WARN, so we don't go insane. This will change over time. The aim is to conform to a common style Signed-off-by: Claudius Coenen <opensource@amenthes.de>
2018-09-26lib/models/revision.js: make independent of exec-pathWilliButz1-1/+2
Previously calling `app.js` from another directory than the base directory of CodiMD would result in an error being thrown because `lib/workers/dmpWorker.js` could not be found. This change makes the function call independent of the path CodiMD is started from. Signed-off-by: WilliButz <wbutz@cyberfnord.de>
2018-07-27Further improvement of error handling for LZStringSheogorath1-1/+5
This does some more in depth check on the error message and minimizes the log noise that is caused by LZString. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-24Rebrand HackMD to CodiMDSheogorath1-1/+1
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-23Allow to disable gravatarSheogorath1-25/+5
Since Gravatar is an external image source and not perfect from a privacy perspective, forbidding it allows to improve privacy. This commit also simplifies and optimizes the avatar code. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-05-25Add token based security featureSheogorath1-0/+4
In the current setup users could be tricked into deleting their data by providing a malicious link like `[click me](/me/delete)`. This commit prevents such an easy attack and need the user's deleteToken to get his data deleted. In case someone requests his deletion by email you can also ask him for this token. We can add a GUI that shows it later on. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-05-25Fix requests for deleted usersSheogorath1-0/+3
When users are requested from the authorship which no longer exist, they shouldn't cause a 500. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-05-25Use cascaded deletesSheogorath3-4/+12
When we delete a user we should delete all the notes that belong to this user including the revisions of these notes. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-05-25Use hard delete instead of soft deleteSheogorath1-1/+1
Right now we only flag notes as deleted. This is no longer allowed under GDPR. Make sure you do regular backups! Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-04-17Move letter-avatars into own requestSheogorath1-5/+5
To prevent further weakening of our CSP policies, moving the Avatars into a non-inline version is the way to go. This implementation probably needs some beautification. But already fixes the bug. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-04-10Add check for noteId lengthSheogorath1-0/+9
As we know the length of an UUID we can check if the base64 string of the provided UUID is long enough for a legacy base64 encoded nodeId and stop processing it in legacy mode, if it's not the case. This should make the ugly warning way less common. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-03-26Use TEXT instead of STRING for tokensPedro Ferreira1-2/+2
Signed-off-by: Pedro Ferreira <pedro.ferreira@cern.ch>
2018-03-25Change config to camel case with backwards compatibilitySheogorath2-8/+8
This refactors the configs a bit to now use camel case everywhere. This change should help to clean up the config interface and make it better understandable. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-03-11Fix to log instead of throwing error on parse note idMax Wu1-2/+4
Signed-off-by: Max Wu <jackymaxj@gmail.com>
2018-03-10Fix parseNoteId order to fix some edge caseMax Wu1-7/+7
that LZString note url could be parsed by base64url note url and thus return wrong note id Signed-off-by: Max Wu <jackymaxj@gmail.com>
2018-02-27Update to use buffer in encode/decode note idMax Wu1-2/+4
Signed-off-by: Max Wu <jackymaxj@gmail.com>
2018-02-26Remove and replace all note id compression in LZString with base64urlMax Wu1-0/+27
Signed-off-by: Max Wu <jackymaxj@gmail.com>
2018-02-09Fix field type to prevent data truncation of authorship (#721)Max Wu2-2/+2
* Fix field type to prevent data truncation of authorship
2018-01-18Ignore empty values for revision.Sheogorath1-2/+2
Fixes #420
2017-11-28Initial support for SAML authenticationNorihito Nakae1-0/+9
2017-10-31Add mattermost authenticationChristoph Witzany1-0/+9
2017-10-16Fix #521 by converting content fields to LONGTEXT in MySQL, to prevent ↵Claudius Coenen2-4/+4
truncation of data.
2017-10-09createdAt DESC with quotation marks did not work with MySQL fixes #565Claudius Coenen1-4/+4
2017-09-22Fix broken profile imagesSheogorath1-2/+6
2017-06-05Fix typo in the db configWu Cheng-Han1-1/+1
2017-05-08refactor(config.js): Extract config fileBoHong Li1-2/+3
* Separate different config source to each files * Freeze config object
2017-05-08refactor: Remove `require` extension filenameBoHong Li4-9/+9
2017-03-15Fix strip null byte in model should cast to string to use replace functionWu Cheng-Han1-0/+1
2017-03-14Fix update doc from filesystem cause redundant authorship stringifyWu Cheng-Han1-1/+1
2017-03-14Use strict mode in all backend filesBoHong Li6-0/+6
add ‘use strict’ in all backend file
2017-03-08Use JavaScript Standard StyleBoHong Li6-1033/+1010
Introduce JavaScript Standard Style as project style rule, and fixed all fail on backend code.
2017-02-18Fix user profile photo might not replace to proper sizeWu Cheng-Han1-4/+4
2017-02-10Add default permission configNV1-2/+2
2017-02-03Update to add biggerphoto on parsing user profileWu Cheng-Han1-10/+26
2017-01-12Fix permission order and keep wording consistencyWu Cheng-Han1-1/+1
2017-01-10Adjust permission order to more clarly蒼時弦也1-1/+1