mirror of
https://github.com/multipleof4/ntfy.git
synced 2026-10-08 21:05:21 +00:00
Limit memory usage in templates
This commit is contained in:
+4
-1
@@ -3227,7 +3227,10 @@ your templates there first ([example for Grafana alert](https://repeatit.io/#/sh
|
||||
!!! info
|
||||
A few Go template features are disabled for user-supplied templates: `{{define}}`, `{{template}}`,
|
||||
`{{block}}`, and `{{call}}` are not allowed. Templates also run with a short execution time limit --
|
||||
a template that loops too long is stopped and rejected with an HTTP 400 error.
|
||||
a template that loops too long is stopped and rejected with an HTTP 400 error. Templates are
|
||||
limited to 32 KB in size, `printf` widths and precisions must be below 1000 (`%999d` is
|
||||
allowed, `%1000d` is not), including the `%*d` form that takes the width from an argument, and
|
||||
`indent`/`nindent` are limited to 100 spaces.
|
||||
|
||||
### Template functions
|
||||
ntfy supports a subset of the **[Sprig template functions](publish/template-functions.md)** (originally copied from [Sprig](https://github.com/Masterminds/sprig),
|
||||
|
||||
@@ -2056,6 +2056,7 @@ and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/release
|
||||
**Security:**
|
||||
|
||||
* Exclude secrets (Stripe/Twilio/web push keys, SMTP password, provisioned users and tokens) from the config hash served to the web app
|
||||
* Limit message templates (`Template: yes`) to 32 KB, limit `printf` widths and precisions to below 1000, and limit `indent`/`nindent` to 100 spaces, preventing excessive memory use from a single small template
|
||||
|
||||
**Features:**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user