Describe the problem
Currently, FILTER_REGEX can only be set via environment variable. For long or frequently updated blacklists, this is inconvenient:
- Environment variables have length limits on some systems
- Updating the filter requires restarting the container with a modified compose file
- There's no easy way to manage the list outside the deployment config
- Long regex patterns clutter
docker-compose.yml / systemd unit files
Describe the solution you'd like
Allow FILTER_REGEX to accept either:
- A raw regex string (as it does now) — for simple, static filters
- A file path prefix, e.g.
/etc/remark42/filter.txt — the engine reads the regex pattern from the file
Suggestion: if the value starts with / or ./, treat it as a file path. Otherwise treat it as a regex string.
Alternative
Add a separate env var like FILTER_REGEX_FILE=/path/to/filter.txt that takes priority over FILTER_REGEX when set.
Use case example
# In docker-compose.yml (clean):
- FILTER_REGEX_FILE=/etc/remark42/blacklist.txt
# On the host (/etc/remark42/blacklist.txt):
\b(cazzo|merda|puttana|spam|viagra)\b|https?://\S*(?:casino|poker)\S*
This way the docker-compose.yml stays clean and the blacklist can be updated without touching the deployment config.
Describe the problem
Currently,
FILTER_REGEXcan only be set via environment variable. For long or frequently updated blacklists, this is inconvenient:docker-compose.yml/ systemd unit filesDescribe the solution you'd like
Allow
FILTER_REGEXto accept either:/etc/remark42/filter.txt— the engine reads the regex pattern from the fileSuggestion: if the value starts with
/or./, treat it as a file path. Otherwise treat it as a regex string.Alternative
Add a separate env var like
FILTER_REGEX_FILE=/path/to/filter.txtthat takes priority overFILTER_REGEXwhen set.Use case example
This way the
docker-compose.ymlstays clean and the blacklist can be updated without touching the deployment config.