summaryrefslogtreecommitdiff
path: root/lib/web (unfollow)
Commit message (Collapse)AuthorFilesLines
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>
2018-05-25Add delete function for authenticated usersSheogorath1-0/+24
Allow users to delete themselbes. This is require to be GDPR compliant. See: https://gdpr-info.eu/art-17-gdpr/ Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-04-27Fix typo of "grouptAttribute" in saml auth moduleMax Wu1-2/+2
Signed-off-by: Max Wu <jackymaxj@gmail.com>
2018-04-17Move letter-avatars into own requestSheogorath1-0/+7
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-03-26Add support for generic OAuth2 providersPedro Ferreira2-0/+107
Signed-off-by: Pedro Ferreira <pedro.ferreira@cern.ch>
2018-03-25Change config to camel case with backwards compatibilitySheogorath15-43/+43
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-20Refactoring imageRouter to modularitySheogorath6-132/+183
This should make the imageRouter more modular and easier to extent. Also a lot of code duplication was removed which should simplify maintenance in future. In the new setup we only need to provide a new module file which exports a function called `uploadImage` and takes a filePath and a callback as argument. The callback itself takes an error and an url as parameter. This eliminates the need of a try-catch-block around the statement and re-enabled the optimization in NodeJS. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-03-18Add check for undefined UUIDSheogorath1-1/+8
This check is needed at there are tons of LDAP implementations out there and none has at least one guaranteed unique field. As we currently check three fields and added an option to select one yourself, it's still not said that any of these fields is set. This will now create an error and fail the authentication instead of letting people may get access to other people's notes which are stored under a this way deterministic wrong userid named `LDAP-undefined`. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-03-09Multiple emails from LDAP are already an ArrayFelix Schäfer1-1/+1
Signed-off-by: Felix Schäfer <felix@thegcat.net>
2018-03-01Introduce ldap.useridFieldDustin Frisch1-1/+4
Signed-off-by: Dustin Frisch <fooker@lab.sh>
2018-01-30Fix uncaught exception for non-existent userSheogorath1-0/+5
Since we added user management it's possible to get non-existent users which can cause a crash of the Backend server. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-01-27Remove camel case from `imageuploadtype` in configSheogorath1-2/+2
This removes the only camel cased option of the config options **we** added to the config.json. In auth provider's config parts are a lot of camel cased options provided. We shouldn't touch them to keep them as similar as possible to the examples. Fixes #315 Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-01-18Allow posting new note with contentDustin Frisch2-0/+11
Signed-off-by: Dustin Frisch <fooker@lab.sh>
2017-12-09Add setting `ldap.usernameField`Lukas Kalbertodt1-1/+7
This determines which ldap field is used as the username on HackMD. By default, the "id" is used as username, too. The id is taken from the fields `uidNumber`, `uid` or `sAMAccountName`. To give the user more flexibility, they can now choose the field used for the username instead.
2017-12-04added guide for SAML settingsNorihito Nakae1-1/+0
2017-11-29fixed the SAML callback URL to unconfigurable.Norihito Nakae1-1/+1
2017-11-28Initial support for SAML authenticationNorihito Nakae2-0/+97
2017-10-31Add mattermost authenticationChristoph Witzany2-0/+50
2017-10-12Fix LDAP problem about missing uidNumberSheogorath1-2/+3
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2017-09-04Give google the correct name.Kaiyu Shi1-3/+3
2017-08-30Add support for minioMarc Deop1-0/+34
2017-06-14fix s3 us-east-1 region endpointKotaro Yamamoto1-1/+4
2017-05-17fix: export to gist occurred 404 not foundMax Wu1-0/+4