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
Rename environment variables and add legacy support.
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>
Copy file name to clipboardExpand all lines: README.md
+76-74Lines changed: 76 additions & 74 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -165,80 +165,82 @@ There are some config settings you need to change in the files below.
165
165
| --------- | ------ | ----------- |
166
166
|`NODE_ENV`|`production` or `development`| set current environment (will apply corresponding settings in the `config.json`) |
167
167
|`DEBUG`|`true` or `false`| set debug mode; show more logs |
168
-
|`HMD_DOMAIN`|`codimd.org`| domain name |
169
-
|`HMD_URL_PATH`|`codimd`| sub URL path, like `www.example.com/<URL_PATH>`|
170
-
|`HMD_PORT`|`80`| web app port |
171
-
|`HMD_ALLOW_ORIGIN`|`localhost, codimd.org`| domain name whitelist (use comma to separate) |
172
-
|`HMD_PROTOCOL_USESSL`|`true` or `false`| set to use SSL protocol for resources path (only applied when domain is set) |
173
-
|`HMD_URL_ADDPORT`|`true` or `false`| set to add port on callback URL (ports `80` or `443` won't be applied) (only applied when domain is set) |
174
-
|`HMD_USECDN`|`true` or `false`| set to use CDN resources or not (default is `true`) |
175
-
|`HMD_ALLOW_ANONYMOUS`|`true` or `false`| set to allow anonymous usage (default is `true`) |
176
-
|`HMD_ALLOW_ANONYMOUS_EDITS`|`true` or `false`| if `allowAnonymous` is `true`, allow users to select `freely` permission, allowing guests to edit existing notes (default is `false`) |
177
-
|`HMD_ALLOW_FREEURL`|`true` or `false`| set to allow new note creation by accessing a nonexistent note URL |
178
-
|`HMD_DEFAULT_PERMISSION`|`freely`, `editable`, `limited`, `locked` or `private`| set notes default permission (only applied on signed users) |
179
-
|`HMD_DB_URL`|`mysql://localhost:3306/database`| set the database URL |
180
-
|`HMD_SESSION_SECRET`| no example | Secret used to sign the session cookie. If non is set, one will randomly generated on startup |
181
-
|`HMD_SESSION_LIFE`|`1209600000`| Session life time. (milliseconds) |
182
-
|`HMD_FACEBOOK_CLIENTID`| no example | Facebook API client id |
183
-
|`HMD_FACEBOOK_CLIENTSECRET`| no example | Facebook API client secret |
184
-
|`HMD_TWITTER_CONSUMERKEY`| no example | Twitter API consumer key |
185
-
|`HMD_TWITTER_CONSUMERSECRET`| no example | Twitter API consumer secret |
186
-
|`HMD_GITHUB_CLIENTID`| no example | GitHub API client id |
187
-
|`HMD_GITHUB_CLIENTSECRET`| no example | GitHub API client secret |
188
-
|`HMD_GITLAB_SCOPE`|`read_user` or `api`| GitLab API requested scope (default is `api`) (GitLab snippet import/export need `api` scope) |
189
-
|`HMD_GITLAB_BASEURL`| no example | GitLab authentication endpoint, set to use other endpoint than GitLab.com (optional) |
190
-
|`HMD_GITLAB_CLIENTID`| no example | GitLab API client id |
191
-
|`HMD_GITLAB_CLIENTSECRET`| no example | GitLab API client secret |
192
-
|`HMD_MATTERMOST_BASEURL`| no example | Mattermost authentication endpoint |
193
-
|`HMD_MATTERMOST_CLIENTID`| no example | Mattermost API client id |
194
-
|`HMD_MATTERMOST_CLIENTSECRET`| no example | Mattermost API client secret |
195
-
|`HMD_DROPBOX_CLIENTID`| no example | Dropbox API client id |
196
-
|`HMD_DROPBOX_CLIENTSECRET`| no example | Dropbox API client secret |
197
-
|`HMD_GOOGLE_CLIENTID`| no example | Google API client id |
198
-
|`HMD_GOOGLE_CLIENTSECRET`| no example | Google API client secret |
199
-
|`HMD_LDAP_URL`|`ldap://example.com`| URL of LDAP server |
200
-
|`HMD_LDAP_BINDDN`| no example | bindDn for LDAP access |
201
-
|`HMD_LDAP_BINDCREDENTIALS`| no example | bindCredentials for LDAP access |
202
-
|`HMD_LDAP_SEARCHBASE`|`o=users,dc=example,dc=com`| LDAP directory to begin search from |
203
-
|`HMD_LDAP_SEARCHFILTER`|`(uid={{username}})`| LDAP filter to search with |
204
-
|`HMD_LDAP_SEARCHATTRIBUTES`|`displayName, mail`| LDAP attributes to search with (use comma to separate) |
205
-
|`HMD_LDAP_USERIDFIELD`|`uidNumber` or `uid` or `sAMAccountName`| The LDAP field which is used uniquely identify a user on CodiMD |
206
-
|`HMD_LDAP_USERNAMEFIELD`| Fallback to userid | The LDAP field which is used as the username on CodiMD |
207
-
|`HMD_LDAP_TLS_CA`|`server-cert.pem, root.pem`| Root CA for LDAP TLS in PEM format (use comma to separate) |
208
-
|`HMD_LDAP_PROVIDERNAME`|`My institution`| Optional name to be displayed at login form indicating the LDAP provider |
209
-
|`HMD_SAML_IDPSSOURL`|`https://idp.example.com/sso`| authentication endpoint of IdP. for details, see [guide](docs/guides/auth.md#saml-onelogin). |
210
-
|`HMD_SAML_IDPCERT`|`/path/to/cert.pem`| certificate file path of IdP in PEM format |
211
-
|`HMD_SAML_ISSUER`| no example | identity of the service provider (optional, default: serverurl)" |
212
-
|`HMD_SAML_IDENTIFIERFORMAT`| no example | name identifier format (optional, default: `urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress`) |
213
-
|`HMD_SAML_GROUPATTRIBUTE`|`memberOf`| attribute name for group list (optional) |
214
-
|`HMD_SAML_REQUIREDGROUPS`|`Hackmd-users`| group names that allowed (use vertical bar to separate) (optional) |
215
-
|`HMD_SAML_EXTERNALGROUPS`|`Temporary-staff`| group names that not allowed (use vertical bar to separate) (optional) |
216
-
|`HMD_SAML_ATTRIBUTE_ID`|`sAMAccountName`| attribute map for `id` (optional, default: NameID of SAML response) |
217
-
|`HMD_SAML_ATTRIBUTE_USERNAME`|`mailNickname`| attribute map for `username` (optional, default: NameID of SAML response) |
218
-
|`HMD_SAML_ATTRIBUTE_EMAIL`|`mail`| attribute map for `email` (optional, default: NameID of SAML response if `HMD_SAML_IDENTIFIERFORMAT` is default) |
219
-
|`HMD_IMGUR_CLIENTID`| no example | Imgur API client id |
220
-
|`HMD_EMAIL`|`true` or `false`| set to allow email signin |
221
-
|`HMD_ALLOW_PDF_EXPORT`|`true` or `false`| Enable or disable PDF exports |
222
-
|`HMD_ALLOW_EMAIL_REGISTER`|`true` or `false`| set to allow email register (only applied when email is set, default is `true`. Note `bin/manage_users` might help you if registration is `false`.) |
223
-
|`HMD_ALLOW_GRAVATAR`|`true` or `false`| set to `false` to disable gravatar as profile picture source on your instance |
224
-
|`HMD_IMAGE_UPLOAD_TYPE`|`imgur`, `s3`, `minio` or `filesystem`| Where to upload images. For S3, see our Image Upload Guides for [S3](docs/guides/s3-image-upload.md) or [Minio](docs/guides/minio-image-upload.md)|
225
-
|`HMD_S3_ACCESS_KEY_ID`| no example | AWS access key id |
226
-
|`HMD_S3_SECRET_ACCESS_KEY`| no example | AWS secret key |
227
-
|`HMD_S3_REGION`|`ap-northeast-1`| AWS S3 region |
228
-
|`HMD_S3_BUCKET`| no example | AWS S3 bucket name |
229
-
|`HMD_MINIO_ACCESS_KEY`| no example | Minio access key |
230
-
|`HMD_MINIO_SECRET_KEY`| no example | Minio secret key |
231
-
|`HMD_MINIO_ENDPOINT`|`minio.example.org`| Address of your Minio endpoint/instance |
232
-
|`HMD_MINIO_PORT`|`9000`| Port that is used for your Minio instance |
233
-
|`HMD_MINIO_SECURE`|`true`| If set to `true` HTTPS is used for Minio |
234
-
|`HMD_AZURE_CONNECTION_STRING`| no example | Azure Blob Storage connection string |
235
-
|`HMD_AZURE_CONTAINER`| no example | Azure Blob Storage container name (automatically created if non existent) |
236
-
|`HMD_HSTS_ENABLE`|` true`| set to enable [HSTS](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security) if HTTPS is also enabled (default is ` true`) |
237
-
|`HMD_HSTS_INCLUDE_SUBDOMAINS`|`true`| set to include subdomains in HSTS (default is `true`) |
238
-
|`HMD_HSTS_MAX_AGE`|`31536000`| max duration in seconds to tell clients to keep HSTS status (default is a year) |
239
-
|`HMD_HSTS_PRELOAD`|`true`| whether to allow preloading of the site's HSTS status (e.g. into browsers) |
240
-
|`HMD_CSP_ENABLE`|`true`| whether to enable Content Security Policy (directives cannot be configured with environment variables) |
241
-
|`HMD_CSP_REPORTURI`|`https://<someid>.report-uri.com/r/d/csp/enforce`| Allows to add a URL for CSP reports in case of violations |
168
+
|`CMD_DOMAIN`|`codimd.org`| domain name |
169
+
|`CMD_URL_PATH`|`codimd`| sub URL path, like `www.example.com/<URL_PATH>`|
170
+
|`CMD_PORT`|`80`| web app port |
171
+
|`CMD_ALLOW_ORIGIN`|`localhost, codimd.org`| domain name whitelist (use comma to separate) |
172
+
|`CMD_PROTOCOL_USESSL`|`true` or `false`| set to use SSL protocol for resources path (only applied when domain is set) |
173
+
|`CMD_URL_ADDPORT`|`true` or `false`| set to add port on callback URL (ports `80` or `443` won't be applied) (only applied when domain is set) |
174
+
|`CMD_USECDN`|`true` or `false`| set to use CDN resources or not (default is `true`) |
175
+
|`CMD_ALLOW_ANONYMOUS`|`true` or `false`| set to allow anonymous usage (default is `true`) |
176
+
|`CMD_ALLOW_ANONYMOUS_EDITS`|`true` or `false`| if `allowAnonymous` is `true`, allow users to select `freely` permission, allowing guests to edit existing notes (default is `false`) |
177
+
|`CMD_ALLOW_FREEURL`|`true` or `false`| set to allow new note creation by accessing a nonexistent note URL |
178
+
|`CMD_DEFAULT_PERMISSION`|`freely`, `editable`, `limited`, `locked` or `private`| set notes default permission (only applied on signed users) |
179
+
|`CMD_DB_URL`|`mysql://localhost:3306/database`| set the database URL |
180
+
|`CMD_SESSION_SECRET`| no example | Secret used to sign the session cookie. If non is set, one will randomly generated on startup |
181
+
|`CMD_SESSION_LIFE`|`1209600000`| Session life time. (milliseconds) |
182
+
|`CMD_FACEBOOK_CLIENTID`| no example | Facebook API client id |
183
+
|`CMD_FACEBOOK_CLIENTSECRET`| no example | Facebook API client secret |
184
+
|`CMD_TWITTER_CONSUMERKEY`| no example | Twitter API consumer key |
185
+
|`CMD_TWITTER_CONSUMERSECRET`| no example | Twitter API consumer secret |
186
+
|`CMD_GITHUB_CLIENTID`| no example | GitHub API client id |
187
+
|`CMD_GITHUB_CLIENTSECRET`| no example | GitHub API client secret |
188
+
|`CMD_GITLAB_SCOPE`|`read_user` or `api`| GitLab API requested scope (default is `api`) (GitLab snippet import/export need `api` scope) |
189
+
|`CMD_GITLAB_BASEURL`| no example | GitLab authentication endpoint, set to use other endpoint than GitLab.com (optional) |
190
+
|`CMD_GITLAB_CLIENTID`| no example | GitLab API client id |
191
+
|`CMD_GITLAB_CLIENTSECRET`| no example | GitLab API client secret |
192
+
|`CMD_MATTERMOST_BASEURL`| no example | Mattermost authentication endpoint |
193
+
|`CMD_MATTERMOST_CLIENTID`| no example | Mattermost API client id |
194
+
|`CMD_MATTERMOST_CLIENTSECRET`| no example | Mattermost API client secret |
195
+
|`CMD_DROPBOX_CLIENTID`| no example | Dropbox API client id |
196
+
|`CMD_DROPBOX_CLIENTSECRET`| no example | Dropbox API client secret |
197
+
|`CMD_GOOGLE_CLIENTID`| no example | Google API client id |
198
+
|`CMD_GOOGLE_CLIENTSECRET`| no example | Google API client secret |
199
+
|`CMD_LDAP_URL`|`ldap://example.com`| URL of LDAP server |
200
+
|`CMD_LDAP_BINDDN`| no example | bindDn for LDAP access |
201
+
|`CMD_LDAP_BINDCREDENTIALS`| no example | bindCredentials for LDAP access |
202
+
|`CMD_LDAP_SEARCHBASE`|`o=users,dc=example,dc=com`| LDAP directory to begin search from |
203
+
|`CMD_LDAP_SEARCHFILTER`|`(uid={{username}})`| LDAP filter to search with |
204
+
|`CMD_LDAP_SEARCHATTRIBUTES`|`displayName, mail`| LDAP attributes to search with (use comma to separate) |
205
+
|`CMD_LDAP_USERIDFIELD`|`uidNumber` or `uid` or `sAMAccountName`| The LDAP field which is used uniquely identify a user on CodiMD |
206
+
|`CMD_LDAP_USERNAMEFIELD`| Fallback to userid | The LDAP field which is used as the username on CodiMD |
207
+
|`CMD_LDAP_TLS_CA`|`server-cert.pem, root.pem`| Root CA for LDAP TLS in PEM format (use comma to separate) |
208
+
|`CMD_LDAP_PROVIDERNAME`|`My institution`| Optional name to be displayed at login form indicating the LDAP provider |
209
+
|`CMD_SAML_IDPSSOURL`|`https://idp.example.com/sso`| authentication endpoint of IdP. for details, see [guide](docs/guides/auth.md#saml-onelogin). |
210
+
|`CMD_SAML_IDPCERT`|`/path/to/cert.pem`| certificate file path of IdP in PEM format |
211
+
|`CMD_SAML_ISSUER`| no example | identity of the service provider (optional, default: serverurl)" |
212
+
|`CMD_SAML_IDENTIFIERFORMAT`| no example | name identifier format (optional, default: `urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress`) |
213
+
|`CMD_SAML_GROUPATTRIBUTE`|`memberOf`| attribute name for group list (optional) |
214
+
|`CMD_SAML_REQUIREDGROUPS`|`Hackmd-users`| group names that allowed (use vertical bar to separate) (optional) |
215
+
|`CMD_SAML_EXTERNALGROUPS`|`Temporary-staff`| group names that not allowed (use vertical bar to separate) (optional) |
216
+
|`CMD_SAML_ATTRIBUTE_ID`|`sAMAccountName`| attribute map for `id` (optional, default: NameID of SAML response) |
217
+
|`CMD_SAML_ATTRIBUTE_USERNAME`|`mailNickname`| attribute map for `username` (optional, default: NameID of SAML response) |
218
+
|`CMD_SAML_ATTRIBUTE_EMAIL`|`mail`| attribute map for `email` (optional, default: NameID of SAML response if `CMD_SAML_IDENTIFIERFORMAT` is default) |
219
+
|`CMD_IMGUR_CLIENTID`| no example | Imgur API client id |
220
+
|`CMD_EMAIL`|`true` or `false`| set to allow email signin |
221
+
|`CMD_ALLOW_PDF_EXPORT`|`true` or `false`| Enable or disable PDF exports |
222
+
|`CMD_ALLOW_EMAIL_REGISTER`|`true` or `false`| set to allow email register (only applied when email is set, default is `true`. Note `bin/manage_users` might help you if registration is `false`.) |
223
+
|`CMD_ALLOW_GRAVATAR`|`true` or `false`| set to `false` to disable gravatar as profile picture source on your instance |
224
+
|`CMD_IMAGE_UPLOAD_TYPE`|`imgur`, `s3`, `minio` or `filesystem`| Where to upload images. For S3, see our Image Upload Guides for [S3](docs/guides/s3-image-upload.md) or [Minio](docs/guides/minio-image-upload.md)|
225
+
|`CMD_S3_ACCESS_KEY_ID`| no example | AWS access key id |
226
+
|`CMD_S3_SECRET_ACCESS_KEY`| no example | AWS secret key |
227
+
|`CMD_S3_REGION`|`ap-northeast-1`| AWS S3 region |
228
+
|`CMD_S3_BUCKET`| no example | AWS S3 bucket name |
229
+
|`CMD_MINIO_ACCESS_KEY`| no example | Minio access key |
230
+
|`CMD_MINIO_SECRET_KEY`| no example | Minio secret key |
231
+
|`CMD_MINIO_ENDPOINT`|`minio.example.org`| Address of your Minio endpoint/instance |
232
+
|`CMD_MINIO_PORT`|`9000`| Port that is used for your Minio instance |
233
+
|`CMD_MINIO_SECURE`|`true`| If set to `true` HTTPS is used for Minio |
234
+
|`CMD_AZURE_CONNECTION_STRING`| no example | Azure Blob Storage connection string |
235
+
|`CMD_AZURE_CONTAINER`| no example | Azure Blob Storage container name (automatically created if non existent) |
236
+
|`CMD_HSTS_ENABLE`|` true`| set to enable [HSTS](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security) if HTTPS is also enabled (default is ` true`) |
237
+
|`CMD_HSTS_INCLUDE_SUBDOMAINS`|`true`| set to include subdomains in HSTS (default is `true`) |
238
+
|`CMD_HSTS_MAX_AGE`|`31536000`| max duration in seconds to tell clients to keep HSTS status (default is a year) |
239
+
|`CMD_HSTS_PRELOAD`|`true`| whether to allow preloading of the site's HSTS status (e.g. into browsers) |
240
+
|`CMD_CSP_ENABLE`|`true`| whether to enable Content Security Policy (directives cannot be configured with environment variables) |
241
+
|`CMD_CSP_REPORTURI`|`https://<someid>.report-uri.com/r/d/csp/enforce`| Allows to add a URL for CSP reports in case of violations |
242
+
243
+
***Note:** Due to the rename process we renamed all `HMD_`-prefix variables to be `CMD_`-prefixed. The old ones continue to work.*
0 commit comments