Allow setting documentMaxLength via CMD_DOCUMENT_MAX_LENGTH

Signed-off-by: Jordi Mallach <jordi@igalia.com>
This commit is contained in:
Jordi Mallach 2023-03-09 09:09:55 +01:00 committed by Philip Molares
parent 9c0411e628
commit 9bda8f2180
3 changed files with 23 additions and 21 deletions

View file

@ -21,7 +21,7 @@ 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). |
@ -39,7 +39,7 @@ to `config.json` before filling in your own details.
| `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 |
| `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

View file

@ -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

View file

@ -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