You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can choose to configure CodiMD with either a config file or with environment variables.
Environment variables take precedence over configurations from the config files. They generally start with CMD_ for our own options, but we also list node-specific options you can configure this way.
Environment variables are processed in lib/config/environment.js - so this is the first place to look if anything is missing not obvious from this document. The default values are defined in lib/config/default.js, in case you wonder if you even need to override it.
The config file is processed in lib/config/index.js - so this is the first place to look if anything is missing not obvious from this document. The default values are defined in lib/config/default.js, in case you wonder if you even need to override it. To get started, it is a good idea to take the config.json.example and copy it
to config.json before filling in your own details.
Note:Due to the rename process we renamed all HMD_-prefix variables to be CMD_-prefixed. The old ones continue to work.
Node.JS
config file
environment
example value
description
NODE_ENV
production or development
set current environment (will apply corresponding settings in the config.json)
debug
DEBUG
true or false
set debug mode, show more logs
CodiMD basics
config file
environment
example value
description
allowPDFExport
CMD_ALLOW_PDF_EXPORT
true or false
Enable or disable PDF exports
CMD_CONFIG_FILE
/path/to/config.json
optional override for the path to CodiMD's config file
Configures Content Security Policy. Directives are passed to Helmet - see their documentation for more information on the format. Some defaults are added to the configured values so that the application doesn't break. To disable this behaviour, set addDefaults to false. Further, if usecdn is on, some CDN locations are allowed too. By default (auto), insecure (HTTP) requests are upgraded to HTTPS via CSP if useSSL is on. To change this behaviour, set upgradeInsecureRequests to either true or false.
CMD_CSP_ENABLE
true
whether to enable Content Security Policy (directives cannot be configured with environment variables)
CMD_CSP_REPORTURI
https://<someid>.report-uri.com/r/d/csp/enforce
Allows to add a URL for CSP reports in case of violations
Privacy and External Requests
config file
environment
example value
description
allowGravatar
CMD_ALLOW_GRAVATAR
true or false
set to false to disable Libravatar as profile picture source on your instance. Libravatar is a federated open-source alternative to Gravatar.
useCDN
CMD_USECDN
true or false
set to use CDN resources or not (default is false)
Users and Privileges
config file
environment
example value
description
allowAnonymous
CMD_ALLOW_ANONYMOUS
true or false
Set to allow anonymous usage (default is true).
allowAnonymousEdits
CMD_ALLOW_ANONYMOUS_EDITS
true or false
If allowAnonymous is false: allow users to select freely permission, allowing guests to edit existing notes (default is false).
allowFreeURL
CMD_ALLOW_FREEURL
true or false
Set to allow new note creation by accessing a nonexistent note URL. This is the behavior familiar from Etherpad.
defaultPermission
CMD_DEFAULT_PERMISSION
freely, editable, limited, locked, protected or private
Set notes default permission (only applied on signed-in users).
sessionName
connect.sid
Cookie session name.
sessionLife
CMD_SESSION_LIFE
14 * 24 * 60 * 60 * 1000, 1209600000 (14 days)
Cookie session life time in milliseconds.
sessionSecret
CMD_SESSION_SECRET
secret
Cookie session secret used to sign the session cookie. If none is set, one will randomly generated on each startup, meaning all your users will be logged out.
Login methods
Email (local account)
config file
environment
example value
description
email
CMD_EMAIL
true or false
Set to allow email sign-in. The default is true.
allowEmailRegister
CMD_ALLOW_EMAIL_REGISTER
true or false
Set to allow registration of new accounts using an email address. If set to false, you can still create accounts using the command line - see bin/manage_users for details (In production mode, remember to run it with NODE_ENV set as production in the enviroment). This setting has no effect if email or CMD_EMAIL is false. The default for allowEmailRegister or CMD_ALLOW_EMAIL_REGISTER is true.
Dropbox Login
config file
environment
example value
description
dropbox
{clientID: ..., clientSecret: ...}
An object containing the client ID and the client secret obtained by the Dropbox developer tools
CMD_DROPBOX_CLIENTID
no example
Dropbox API client id
CMD_DROPBOX_CLIENTSECRET
no example
Dropbox API client secret
Facebook Login
config file
environment
example value
description
facebook
{clientID: ..., clientSecret: ...}
An object containing the client ID and the client secret obtained by the Facebook app console
CMD_FACEBOOK_CLIENTID
no example
Facebook API client id
CMD_FACEBOOK_CLIENTSECRET
no example
Facebook API client secret
GitHub Login
config file
environment
example value
description
github
{clientID: ..., clientSecret: ...}
An object containing the client ID and the client secret obtained by the GitHub developer page. For more details have a look at the GitHub auth guide.
An object detailing your OAuth2 provider. Refer to the Mattermost or Nextcloud examples for more details!
CMD_OAUTH2_USER_PROFILE_URL
https://example.com
Where to retrieve information about a user after successful login. Needs to output JSON. (no default value) Refer to the Mattermost or Nextcloud examples for more details on all of the CMD_OAUTH2... options.
CMD_OAUTH2_USER_PROFILE_USERNAME_ATTR
name
where to find the username in the JSON from the user profile URL. (no default value)
CMD_OAUTH2_USER_PROFILE_DISPLAY_NAME_ATTR
display-name
where to find the display-name in the JSON from the user profile URL. (no default value)
CMD_OAUTH2_USER_PROFILE_EMAIL_ATTR
email
where to find the email address in the JSON from the user profile URL. (no default value)
CMD_OAUTH2_TOKEN_URL
https://example.com
sometimes called token endpoint, please refer to the documentation of your OAuth2 provider (no default value)
CMD_OAUTH2_AUTHORIZATION_URL
https://example.com
authorization URL of your provider, please refer to the documentation of your OAuth2 provider (no default value)
CMD_OAUTH2_CLIENT_ID
afae02fckafd...
you will get this from your OAuth2 provider when you register CodiMD as OAuth2-client, (no default value)
CMD_OAUTH2_CLIENT_SECRET
afae02fckafd...
you will get this from your OAuth2 provider when you register CodiMD as OAuth2-client, (no default value)
CMD_OAUTH2_PROVIDERNAME
My institution
Optional name to be displayed at login form indicating the oAuth2 provider
These are only relevant when they are also configured in sync with their
CMD_IMAGE_UPLOAD_TYPE. Also keep in mind, that filesystem is available, so
you don't have to use either of these.