summaryrefslogtreecommitdiff
path: root/lib/web (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-04-28findNoteOrCreate: Create new note with empty string instead of `null`Sandro1-1/+1
Backport of #345 to 1.x Signed-off-by: Sandro Jäckel <sandro.jaeckel@gmail.com>
2020-03-21Backport Fix for relative theme pathSheogorath1-1/+1
This commit backport 856fc01fb9b30489b254f2ef9d29de80aa189118 Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2020-02-08Add Google oauth variable: hostedDomainike1-1/+1
Which is part of `passport-google-oauth2`. It could be used as whitelist to a domain supported by google oauth. Ref: https://github.com/jaredhanson/passport-google-oauth2/issues/3 Signed-off-by: ike <developer@ikewat.com>
2019-11-28Removing returnTo setting from referer in all other authentication sourcesRalph Krimmel12-28/+8
Signed-off-by: Ralph Krimmel <rkrimme1@gwdg.de>
2019-11-28Moving the storage of referrer information to main authorization check ↵Ralph Krimmel1-5/+3
instead of doing it in the authentication source Signed-off-by: Ralph Krimmel <rkrimme1@gwdg.de>
2019-11-27Fixing linting problemsRalph Krimmel1-4/+3
Signed-off-by: Ralph Krimmel <rkrimme1@gwdg.de>
2019-11-27Fixing redirection after SAML loginfoobarable1-2/+5
Saving referer into session in SAML auth so passport can redirect correctly after SAML login. Signed-off-by: Ralph Krimmel <rkrimme1@gwdg.de>
2019-10-29Fix crash in lutim integrationGirish Ramakrishnan1-1/+1
Signed-off-by: Girish Ramakrishnan <girish@cloudron.io>
2019-10-27Inline renderPublishSlideDavid Mehren1-8/+4
Signed-off-by: David Mehren <dmehren1@gmail.com>
2019-10-27Inline responseCodiMDDavid Mehren1-18/+14
Signed-off-by: David Mehren <dmehren1@gmail.com>
2019-10-27Inline publish and slideDavid Mehren1-10/+2
Signed-off-by: David Mehren <dmehren1@gmail.com>
2019-10-27Inline renderPublishDavid Mehren1-8/+4
Signed-off-by: David Mehren <dmehren1@gmail.com>
2019-10-27Move showPublishNote and publishNoteActions to note controllerDavid Mehren5-43/+99
Signed-off-by: David Mehren <dmehren1@gmail.com>
2019-10-27Move showNote to note controllerDavid Mehren2-105/+19
Signed-off-by: David Mehren <dmehren1@gmail.com>
2019-10-27Move note actions into their own fileDavid Mehren2-9/+131
Signed-off-by: David Mehren <dmehren1@gmail.com>
2019-10-27Rename actions.js to controller.js and rename functions to be more descriptiveDavid Mehren2-20/+31
Move postNote to NoteController and rename to createFromPost Signed-off-by: David Mehren <dmehren1@gmail.com>
2019-10-27Move slide actions to own fileDavid Mehren2-2/+86
Signed-off-by: David Mehren <dmehren1@gmail.com>
2019-10-27Fix errors constant in note/actions.jsDavid Mehren1-7/+7
Signed-off-by: David Mehren <dmehren1@gmail.com>
2019-10-27Move note actions to their own file.David Mehren12-67/+325
Because of circular import problems, this commit also moves the error messages from response.js to errors.js Signed-off-by: David Mehren <dmehren1@gmail.com>
2019-10-22Allow to generate lower case header references through the confighoijui1-1/+2
This makes the references consistent/compatible with GitHub, GitLab, Pandoc and many other tools. This behavior can be enabled in config.json with: ``` "linkifyHeaderStyle": "gfm" ``` Signed-off-by: hoijui <hoijui.quaero@gmail.com>
2019-09-04Refactored note-creation with given noteIdErik Michelson1-3/+3
Known bugs/features: - pushing towards an existing note results in an error 500 Signed-off-by: Erik Michelson <erik@liltv.de>
2019-09-04Added endpoint for note-creation with given aliasErik Michelson1-0/+2
Signed-off-by: Erik Michelson <erik@liltv.de>
2019-06-08Rework debug loggingSheogorath11-37/+33
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 warningsSheogorath20-38/+37
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-25Add config for toobusy middlewareSheogorath1-0/+4
With very low CPU frequency or bad IO situation, as well as not-loaded JS CodiMD happens to present unneeded "I'm busy"-messages to users. This patch allows to configure the lag. The default is taken from the libray but set in our own default configs. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2019-05-13asyncified setting and verifying the passwordClaudius1-2/+8
Signed-off-by: Claudius <opensource@amenthes.de>
2019-04-10Add lutim supportDylan Dervaux1-0/+31
Signed-off-by: Dylan Dervaux <dylanderv05@gmail.com>
2019-04-06Added a configuration option for passport-saml:Emmanuel Ormancey1-1/+2
disableRequestedAuthnContext: true|false By default only Password authmethod is accepted, this option allows any other method. Issue and option described here: https://github.com/bergie/passport-saml/issues/226 Signed-off-by: Emmanuel Ormancey <emmanuel.ormancey@cern.ch>
2019-04-06Hide port from minio URL for protocol default portThor771-1/+3
Signed-off-by: Thor77 <thor77@thor77.org>
2019-03-09Add required change for Google+ API deprecationSheogorath1-1/+2
Since Google+ is shutting down soon, we need to get the profile data from another URL. Since the library already supports it, all we need to do is adding a single line of code. Details: https://github.com/hackmdio/codimd/issues/1160 Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2019-02-11make aws s3 endpoint configurableMathias Merscher1-1/+3
Signed-off-by: Mathias Merscher <Mathias.Merscher@dg-i.net>
2018-12-18Fix usage of new URL APISheogorath1-2/+2
Due to the deprecation of the old `url`-API provided by NodeJS we replaced `url.resolve` with `url.URL.resolve`, which doesn't exist. This patch fixes the local filesystem upload of CodiMD by using the new API correctly. Creating an URL object and using its href. Some more background: https://nodejs.org/api/url.html#url_url_href https://nodejs.org/api/url.html#url_url_resolve_from_to Fixes https://github.com/hackmdio/codimd/issues/1102 Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-11-28Prevent subdirectories in user exportDaan Sprenkels1-9/+11
This commit also refactors the code a bit, and adds a '-' separator between a filename and its duplicate index. This commit fixes #1079. Signed-off-by: Daan Sprenkels <hello@dsprenkels.com>
2018-11-27Fix typoCloudYu2-4/+4
Signed-off-by: CloudYu <cloudyu322@gmail.com>
2018-11-14switching to eslint for code checkingClaudius Coenen1-1/+1
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-11-14InternalOAuthError is not part of passport, but of passport-oauth2Claudius Coenen1-4/+4
This fixes part of #1056: an error while obtaining the profile would have `502`-crashed the server. Signed-off-by: Claudius Coenen <opensource@amenthes.de>
2018-11-11Add full version stringSheogorath1-1/+1
Currently we only provide the version from `package.json`. This means that during updates of instances, e.g. the demo instance, which runs latest master instead of a stable release, changes are not reflected to the webclient. This patch adds a fullversion string that contains the current commit and this way makes that clients are notified about changes. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-10-05Add OpenID to CodiMDSheogorath2-0/+62
With OpenID every OpenID capable provider can provide authentication for users of a CodiMD instance. This means we have federated authentication. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-09-26removing superfluous config parameters for template filesClaudius1-1/+1
Signed-off-by: Claudius <opensource@amenthes.de>
2018-09-26imageRouter/filesystem: make callback path-independentWilliButz1-1/+2
Images are now properly served when `config.uploadsPath` differs from its default value. Signed-off-by: WilliButz <wbutz@cyberfnord.de>
2018-07-03Fixing content types in status routerSheogorath1-2/+4
As it turns out, expressjs doesn't detect the right mimetype and it seems like I didn't bother to test this enough. So lets fix it for the next release. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-30Update passport-ldapSheogorath1-1/+1
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-24Do final internal renameingSheogorath2-4/+12
A little minor change, by moving the CodiMD version header in its own middleware. Should simplify to determine the version number of the Backend in future. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-24Fix breaking regexSheogorath1-1/+1
The image upload regex breaks with the new path for uploads. This commit fixes it. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-24Move config out of statics pathSheogorath1-0/+17
Since static path is providing with a high expiration data, we provide configs via API. This shouldn't add any noticeable load while making it uncached and this way working again. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-23Fix possible error if HackMD is started with wrong workdirSheogorath1-1/+1
In https://github.com/hackmdio/hackmd/issues/834 is described how starting HackMD crashes when using the wrong working dir. This is caused by a relative path in our upload routine. This change should fix it and prevent future crashes. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-01Fix callback validationAdam Hoka4-4/+7
Signed-off-by: Adam Hoka <hoka.adam@nexogen.hu>
2018-06-01Add Azure Blob Storage supportÁdám Hóka1-0/+35
Signed-off-by: Adam Hoka <hoka.adam@nexogen.hu>
2018-05-26Add note export functionSheogorath1-0/+56
This function is the first step to get out data following GDPR about the transportability of data. Details: https://gdpr-info.eu/art-20-gdpr/ Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-05-25Add token based security featureSheogorath1-8/+12
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>