Allow setting documentMaxLength via CMD_DOCUMENT_MAX_LENGTH
Signed-off-by: Jordi Mallach <jordi@igalia.com>
This commit is contained in:
		
							parent
							
								
									9c0411e628
								
							
						
					
					
						commit
						9bda8f2180
					
				| @ -20,27 +20,27 @@ to `config.json` before filling in your own details. | ||||
| 
 | ||||
| ## HedgeDoc basics | ||||
| 
 | ||||
| | config file          | environment              | **default** and example value                                                                                                                       | description                                                                                                                                                                                                | | ||||
| | -------------------- | ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||||
| |                      | `CMD_CONFIG_FILE`        | **no default**, `/path/to/config.json`                                                                                                              | optional override for the path to HedgeDoc's config file                                                                                                                                                   | | ||||
| | `db`                 |                          | **`undefined`**, `{ "dialect": "sqlite", "storage": "./db.hedgedoc.sqlite" }`                                                                       | set the db configs, [see more here](https://sequelize.org/v5/manual/dialects.html)                                                                                                                         | | ||||
| | `db.username`        |  `CMD_DB_USERNAME`       | **`undefined`**, `hedgedoc-db-user`                                                                                                                 | Username used to authenticate to the database (host).                                                                                                                                                      | | ||||
| | `db.password`        |  `CMD_DB_PASSWORD`       | **`undefined`**                                                                                                                                     | Password used to authenticate to the database (host).                                                                                                                                                      | | ||||
| | `db.database`        |  `CMD_DB_DATABASE`       | **`undefined`**, `hedgedoc`                                                                                                                         | Name of the database used to store hedgedoc data.                                                                                                                                                          | | ||||
| | `db.host`            |  `CMD_DB_HOST`           | **`undefined`**, `db-host.example.com`                                                                                                              | Hostname used to connect the database server.                                                                                                                                                              | | ||||
| | `db.post`            |  `CMD_DB_PORT`           | **`undefined`**, `5432`                                                                                                                             | Port used to connect the database server.                                                                                                                                                                  | | ||||
| | `db.dialect`         |  `CMD_DB_DIALECT`        | **`undefined`**, `postgres`, `mariadb`                                                                                                              | [Dialect](https://sequelize.org/v5/manual/dialects.html) / protocol used to connect to the database.                                                                                                       | | ||||
| | `dbURL`              | `CMD_DB_URL`             | **`undefined`**, `postgres://username:password@localhost:5432/hedgedoc` or `mysql://username:password@localhost:3306/hedgedoc`                      | Set the db in URL style. If set, then the relevant `db` config entries will be overridden.                                                                                                                 | | ||||
| | `loglevel`           | `CMD_LOGLEVEL`           | **`info`**, `debug` ...                                                                                                                             | Defines what kind of logs are provided to stdout. Available options: `debug`, `verbose`, `info`, `warn`, `error`                                                                                           | | ||||
| | `forbiddenNoteIDs`   | `CMD_FORBIDDEN_NOTE_IDS` | **`['robots.txt', 'favicon.ico', 'api', 'build', 'css', 'docs', 'fonts', 'js', 'uploads', 'vendor', 'views']`**, `['robots.txt']` or `'robots.txt'` | disallow creation of notes, even if `allowFreeUrl` or `CMD_ALLOW_FREEURL` is `true`                                                                                                                        | | ||||
| | `imageUploadType`    | `CMD_IMAGE_UPLOAD_TYPE`  | **`filesystem`**, `imgur`, `s3`, `minio`, `azure`, `lutim`                                                                                          | Where to upload images. For S3, see our Image Upload Guides for [S3](guides/s3-image-upload.md) or [Minio](guides/minio-image-upload.md), also there's a whole section on their respective env vars below. | | ||||
| | `sourceURL`          | `CMD_SOURCE_URL`         | **no default**, `https://github.com/hedgedoc/hedgedoc/tree/<current commit>`                                                                        | Provides the link to the source code of HedgeDoc on the entry page (Please, make sure you change this when you run a modified version)                                                                     | | ||||
| | `tooBusyLag`         | `CMD_TOOBUSY_LAG`        | **`70`**                                                                                                                                            | CPU time for one event loop tick until node throttles connections. (milliseconds)                                                                                                                          | | ||||
| | `staticCacheTime`    |                          | **`1 * 24 * 60 * 60 * 1000`**                                                                                                                       | static file cache time                                                                                                                                                                                     | | ||||
| | `heartbeatInterval`  |                          | **`5000`**                                                                                                                                          | socket.io heartbeat interval                                                                                                                                                                               | | ||||
| | `heartbeatTimeout`   |                          | **`10000`**                                                                                                                                         | socket.io heartbeat timeout                                                                                                                                                                                | | ||||
| | `documentMaxLength`  |                          | **`100000`**                                                                                                                                        | note max length                                                                                                                                                                                            | | ||||
| | `linkifyHeaderStyle` |                          | **`keep-case`**, `lower-case`, `gfm`                                                                                                                | how is a header text converted into a link id                                                                                                                                                              | | ||||
| | config file          | environment               | **default** and example value                                                                                                                       | description                                                                                                                                                                                                | | ||||
| | -------------------- | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||||
| |                      | `CMD_CONFIG_FILE`         | **no default**, `/path/to/config.json`                                                                                                              | optional override for the path to HedgeDoc's config file                                                                                                                                                   | | ||||
| | `db`                 |                           | **`undefined`**, `{ "dialect": "sqlite", "storage": "./db.hedgedoc.sqlite" }`                                                                       | set the db configs, [see more here](https://sequelize.org/v5/manual/dialects.html)                                                                                                                         | | ||||
| | `db.username`        |  `CMD_DB_USERNAME`        | **`undefined`**, `hedgedoc-db-user`                                                                                                                 | Username used to authenticate to the database (host).                                                                                                                                                      | | ||||
| | `db.password`        |  `CMD_DB_PASSWORD`        | **`undefined`**                                                                                                                                     | Password used to authenticate to the database (host).                                                                                                                                                      | | ||||
| | `db.database`        |  `CMD_DB_DATABASE`        | **`undefined`**, `hedgedoc`                                                                                                                         | Name of the database used to store hedgedoc data.                                                                                                                                                          | | ||||
| | `db.host`            |  `CMD_DB_HOST`            | **`undefined`**, `db-host.example.com`                                                                                                              | Hostname used to connect the database server.                                                                                                                                                              | | ||||
| | `db.post`            |  `CMD_DB_PORT`            | **`undefined`**, `5432`                                                                                                                             | Port used to connect the database server.                                                                                                                                                                  | | ||||
| | `db.dialect`         |  `CMD_DB_DIALECT`         | **`undefined`**, `postgres`, `mariadb`                                                                                                              | [Dialect](https://sequelize.org/v5/manual/dialects.html) / protocol used to connect to the database.                                                                                                       | | ||||
| | `dbURL`              | `CMD_DB_URL`              | **`undefined`**, `postgres://username:password@localhost:5432/hedgedoc` or `mysql://username:password@localhost:3306/hedgedoc`                      | Set the db in URL style. If set, then the relevant `db` config entries will be overridden.                                                                                                                 | | ||||
| | `loglevel`           | `CMD_LOGLEVEL`            | **`info`**, `debug` ...                                                                                                                             | Defines what kind of logs are provided to stdout. Available options: `debug`, `verbose`, `info`, `warn`, `error`                                                                                           | | ||||
| | `forbiddenNoteIDs`   | `CMD_FORBIDDEN_NOTE_IDS`  | **`['robots.txt', 'favicon.ico', 'api', 'build', 'css', 'docs', 'fonts', 'js', 'uploads', 'vendor', 'views']`**, `['robots.txt']` or `'robots.txt'` | disallow creation of notes, even if `allowFreeUrl` or `CMD_ALLOW_FREEURL` is `true`                                                                                                                        | | ||||
| | `imageUploadType`    | `CMD_IMAGE_UPLOAD_TYPE`   | **`filesystem`**, `imgur`, `s3`, `minio`, `azure`, `lutim`                                                                                          | Where to upload images. For S3, see our Image Upload Guides for [S3](guides/s3-image-upload.md) or [Minio](guides/minio-image-upload.md), also there's a whole section on their respective env vars below. | | ||||
| | `sourceURL`          | `CMD_SOURCE_URL`          | **no default**, `https://github.com/hedgedoc/hedgedoc/tree/<current commit>`                                                                        | Provides the link to the source code of HedgeDoc on the entry page (Please, make sure you change this when you run a modified version)                                                                     | | ||||
| | `tooBusyLag`         | `CMD_TOOBUSY_LAG`         | **`70`**                                                                                                                                            | CPU time for one event loop tick until node throttles connections. (milliseconds)                                                                                                                          | | ||||
| | `staticCacheTime`    |                           | **`1 * 24 * 60 * 60 * 1000`**                                                                                                                       | static file cache time                                                                                                                                                                                     | | ||||
| | `heartbeatInterval`  |                           | **`5000`**                                                                                                                                          | socket.io heartbeat interval                                                                                                                                                                               | | ||||
| | `heartbeatTimeout`   |                           | **`10000`**                                                                                                                                         | socket.io heartbeat timeout                                                                                                                                                                                | | ||||
| | `documentMaxLength`  | `CMD_DOCUMENT_MAX_LENGTH` | **`100000`**                                                                                                                                        | note max length                                                                                                                                                                                            | | ||||
| | `linkifyHeaderStyle` |                           | **`keep-case`**, `lower-case`, `gfm`                                                                                                                | how is a header text converted into a link id                                                                                                                                                              | | ||||
| 
 | ||||
| ## HedgeDoc paths stuff | ||||
| 
 | ||||
|  | ||||
| @ -47,6 +47,7 @@ module.exports = { | ||||
|   sessionSecret: process.env.CMD_SESSION_SECRET, | ||||
|   sessionLife: toIntegerConfig(process.env.CMD_SESSION_LIFE), | ||||
|   tooBusyLag: toIntegerConfig(process.env.CMD_TOOBUSY_LAG), | ||||
|   documentMaxLength: toIntegerConfig(process.env.CMD_DOCUMENT_MAX_LENGTH), | ||||
|   imageUploadType: process.env.CMD_IMAGE_UPLOAD_TYPE, | ||||
|   imgur: { | ||||
|     clientID: process.env.CMD_IMGUR_CLIENTID | ||||
|  | ||||
| @ -4,6 +4,7 @@ | ||||
| 
 | ||||
| ### Enhancements | ||||
| - Extend boolean environment variable parsing with other positive answers and case insensitivity. | ||||
| - Allow setting of `documentMaxLength` via `CMD_DOCUMENT_MAX_LENGTH` environment variable. | ||||
| 
 | ||||
| ## <i class="fa fa-tag"></i> 1.9.7 <i class="fa fa-calendar-o"></i> 2023-02-19 | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user