summaryrefslogtreecommitdiff
path: root/lib/config/index.js (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-12-21Update upload provider error messageDaan Sprenkels1-1/+1
Fixes #1107. Signed-off-by: Daan Sprenkels <hello@dsprenkels.com>
2018-11-28Warn on missing serverURLSheogorath1-0/+4
We see some issues that are based on not properly configured `config.serverURL`. This patch adds a warning when `config.serverURL` is an empty value. This should provide users direct feedback about how to improve their configs. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-11-14Upgrade winstonSheogorath1-0/+6
Our log library got a new major version which should be implemented. That's exactly what this patch does. Implementing the new version of the logging library. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-11-11Add full version stringSheogorath1-2/+9
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-11-07Fix menu for github and dropboxCédric Couralet1-0/+2
Signed-off-by: Cédric Couralet <cedric.couralet@gmail.com>
2018-10-05Add OpenID to CodiMDSheogorath1-0/+1
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-8/+2
Signed-off-by: Claudius <opensource@amenthes.de>
2018-09-26lib/config: use `path.resolve` instead of `path.join`WilliButz1-14/+14
While paths like `tmpPath` could previously be configured, they were all interpreted relative to `appRootPath` because of `path.join`. Now the configurable paths can be canonical and therefore independent of the `appRootPath`. Signed-off-by: WilliButz <wbutz@cyberfnord.de>
2018-09-26lib/config: add environment variable to set config fileWilliButz1-1/+2
Previously it was assumed that `config.json` would be placed in the same directory as the rest of CodiMD without any optional override. This allows to override the path to the `config.json` by setting `CMD_CONFIG_FILE` to the canonical path of the desired config file. Signed-off-by: WilliButz <wbutz@cyberfnord.de>
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-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 CodiMDSheogorath1-1/+1
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.Sheogorath1-0/+6
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 pathSheogorath1-0/+1
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-0/+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-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óka1-2/+2
Signed-off-by: Adam Hoka <hoka.adam@nexogen.hu>
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-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-26Add support for generic OAuth2 providersPedro Ferreira1-0/+1
Signed-off-by: Pedro Ferreira <pedro.ferreira@cern.ch>
2018-03-26Automatically generate a session secret if default is usedSheogorath1-0/+9
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 compatibilitySheogorath1-29/+42
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-01-27Remove camel case from `imageuploadtype` in configSheogorath1-2/+8
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-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 Ernst1-1/+1
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-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-05fixed sslcapath bugLaysDragon1-1/+9
2017-11-28Initial support for SAML authenticationNorihito Nakae1-0/+1
2017-10-31Add mattermost authenticationChristoph Witzany1-0/+1
2017-10-25Adds PDF export via configgeekyd1-1/+3
2017-06-01Read to correct tlsca file pathtkykm1-2/+2
2017-05-08refactor(config.js): Extract config fileBoHong Li1-0/+112
* Separate different config source to each files * Freeze config object