summaryrefslogtreecommitdiff
path: root/lib/config (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-09-27Set default to `v4`Sheogorath1-1/+2
Seems like we didn't fix the problem with the last patch. This should finally fix it. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-09-25Omit unneeded warning if no gitlab is configuredSheogorath1-1/+1
This patch should fix the unneeded warning of the wrong API version, when gitlab isn't configured at all. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-08-23BUGFIX: wrong version check for gitlab apiAlexander Hesse1-2/+2
Signed-off-by: Alexander Hesse <alexander.hesse@sandstorm-media.de>
2018-07-31Add possibility to choose between version v3 or v4 for the gitlab api.Cédric Couralet1-0/+6
Apart from the uri versioning, one big change is the snippet visibility post data (visibility_level -> visibility) Default gitlab api version to v4 Signed-off-by: Cédric Couralet <cedric.couralet@gmail.com>
2018-07-27Support 'host' & 'path' config optionsMiranda Kastemaa2-0/+3
Signed-off-by: Miranda Kastemaa <miranda@foldplop.com>
2018-07-09Upload images to the filesystem by default, rather than to imgurMaxence Ahlouche1-1/+1
Signed-off-by: Maxence Ahlouche <maxence.ahlouche@gmail.com>
2018-06-24Rename HackMD view to CodiMDSheogorath2-2/+2
Even when it looks a bit weird in first place to rename all internals step by step, it makes sense to do so, because we run into confusion afterwards. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-24Rename environment variables and add legacy support.Sheogorath3-86/+216
As we are no longer HackMD the short tag `HMD` doesn't match anymore. We move it to the matching prefix `CMD` and inform our users about the change. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-24Move config out of statics pathSheogorath2-0/+2
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-23Allow to disable gravatarSheogorath2-0/+2
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-06-23Fix possible error if HackMD is started with wrong workdirSheogorath2-0/+2
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-05Fix i18n writing locale files in productionSheogorath1-0/+3
This commit should prevent the i18n module from adding missing translations to the local files in setups that are not for development. This way we keep the directory clean and idempotent. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-01Add Azure Blob Storage supportÁdám Hóka4-3/+14
Signed-off-by: Adam Hoka <hoka.adam@nexogen.hu>
2018-05-16Revert "Workaround Google API problems"Christoph (Sheogorath) Kern2-2/+0
2018-04-13Use API key instead of clientSecretSheogorath2-0/+2
As recently discovered we send the clientSecret to the webclient which is potentionally dangerous. This patch should fix the problem and replace the clientSecret with the originally intended and correct way to implement it using the API key. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-04-10Fix typos for `allowAnonymousEdits`Sheogorath1-1/+1
Looks like we lost some variables during the refactoring of the configs to camel case. This should fix it. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-03-30Fix CSP for disqus and Google AnalyticsSheogorath1-0/+2
This commit should fix existing problems with Disqus and Google Analytics enabled in the meta-yaml section of a note. Before this commit they were blocked by the strict CSP. It's still possible to disable the added directives using `addDisqus` and `addGoogleAnalytics` in the `csp` config section. They are enabled by default to prevent breaking changes. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-03-29Add session data to env varsSheogorath1-0/+2
Currently the session secret can only be set by config.json or docker secrets. This creates a problem on Heroku hosted instances that can not set a session secret. Since we automatically generate them on startup this results in an logout of all users on every config change in Heroku. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-03-26Fix logical error in legacy config expressionSheogorath1-2/+2
We should check for an undefined and not just for a logical true or false. Example: When `usecdn` was set to false it was impossible to overwrite the new config value because the if statement becomes false. Thanks @davidmehren for pointing me to this issue. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-03-26Rename forgotten valuesSheogorath1-4/+4
Looks like we forgot something during the migration. This should fix it. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-03-26Add support for generic OAuth2 providersPedro Ferreira3-0/+18
Signed-off-by: Pedro Ferreira <pedro.ferreira@cern.ch>
2018-03-26Automatically generate a session secret if default is usedSheogorath2-0/+10
The session secret is used to sign and authenticate the session cookie and this way very important for the authentication process. By default the session secret is set to `secret` and never changes. This commit will add a generator for a dynamic session secret if it stays unchanged. It prevents session hijacking this way and will warn the user about the missing secret. This also implies that on a restart without configured session secret will log out all users. While it may seems annoying, it's for the users best. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-03-25Change config to camel case with backwards compatibilitySheogorath4-78/+131
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 modularitySheogorath1-0/+7
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-16Add helper function to fix number problemsSheogorath2-3/+10
As minio causes various problem if you configure it using environment variables and leave the port setting out, which will evaluate to NaN, this change should fix this in a clean way for this time and helps to support numbers in general in future. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-03-15Convert HMD_MINIO_PORT into Number type.vazontang1-1/+1
fix hackmdio/hackmd#763 Signed-off-by: Tang TsungYi <vazontang@gmail.com>
2018-03-14Add config option for report URI in CSPSheogorath2-2/+4
This option is needed as it's currently not possible to add an report URI by the directives array. This option also allows to get CSP reports not only on docker based setup but also on our heroku instances. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-03-05Remove unused LDAP option `tokenSecret`Felix Schäfer2-2/+0
hackmdio/hackmd#754 Signed-off-by: Felix Schäfer <felix@thegcat.net>
2018-03-01Introduce ldap.useridFieldDustin Frisch2-0/+2
Signed-off-by: Dustin Frisch <fooker@lab.sh>
2018-01-27Remove camel case from `imageuploadtype` in configSheogorath3-4/+12
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-23Fix broken port configSheogorath1-1/+1
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-01-20Allow more detailed configuration of upload mime typesSheogorath1-0/+20
Fixes #637 Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-01-20Add option to enable `freely` permission in closed instanceDario Ernst3-1/+3
Before, closed disallowed guest edits completely, by removing the `freely` permission. This makes it possible to explicitely bring back guest-editing, but not guest-note-creation, to closed instances. Signed-off-by: Dario Ernst <dario@kanojo.de>
2018-01-19Load version from package.jsonSheogorath1-1/+3
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-01-19Fix not passing app key correctly in dropbox configWu Cheng-Han3-3/+6
2018-01-18Release 1.0.0-ceSheogorath1-1/+1
2017-12-22Update index.jsChristoph (Sheogorath) Kern1-1/+1
2017-12-22Simplify loopChristoph (Sheogorath) Kern1-8/+3
2017-12-09parse HMD_LDAP_SEARCHATTRIBUTES env var as a comma-separated arrayalecdwm2-5/+12
Signed-off-by: Alec WM <firstcontact@owls.io>
2017-12-09Add setting `ldap.usernameField`Lukas Kalbertodt2-0/+2
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-05fixed sslcapath bugLaysDragon2-2/+10
2017-12-04added guide for SAML settingsNorihito Nakae2-2/+0
2017-11-29added environment variables for SAMLNorihito Nakae1-1/+12
2017-11-29fixed the SAML callback URL to unconfigurable.Norihito Nakae1-1/+0
2017-11-28Initial support for SAML authenticationNorihito Nakae3-0/+21
2017-10-31Add mattermost authenticationChristoph Witzany4-0/+15
2017-10-25Adds PDF export via configgeekyd3-3/+7
2017-10-22Change CSP config format to be more intuitiveLiterallie2-9/+4
2017-10-22CSP: Allow more content typesLiterallie1-3/+7
2017-10-22CSP: Upgrade insecure requests if possibleLiterallie1-2/+3
Config option; default is to only upgrade if usessl