From f26cb08500977ae783749f33a5d38087576d0c74 Mon Sep 17 00:00:00 2001 From: Keonik1 Date: Tue, 18 Nov 2025 14:18:18 +0100 Subject: [PATCH] cmdeploy: Add config parameters `change_kernel_settings` and `fs_inotify_max_user_instances_and_watchers` --- CHANGELOG.md | 5 +++++ chatmaild/src/chatmaild/config.py | 6 ++++++ chatmaild/src/chatmaild/ini/chatmail.ini.f | 10 ++++++++++ docker-compose.yaml | 1 + docker/files/setup_chatmail_docker.sh | 1 + 5 files changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5a4a8a5..49fbea8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -124,6 +124,11 @@ - Add installation via docker compose (MVP 1). The instructions, known issues and limitations are located in `/docs` ([#614](https://github.com/chatmail/relay/pull/614)) +- Add configuration parameters + ([#614](https://github.com/chatmail/relay/pull/614)): + - `change_kernel_settings` - Whether to change kernel parameters during installation (default: `True`) + - `fs_inotify_max_user_instances_and_watchers` - Value for kernel parameters `fs.inotify.max_user_instances` and `fs.inotify.max_user_watches` (default: `65535`) + ## 1.7.0 2025-09-11 - Make www upload path configurable diff --git a/chatmaild/src/chatmaild/config.py b/chatmaild/src/chatmaild/config.py index d19e966a..42fc9c51 100644 --- a/chatmaild/src/chatmaild/config.py +++ b/chatmaild/src/chatmaild/config.py @@ -47,6 +47,12 @@ class Config: self.addr_v4 = os.environ.get("CHATMAIL_ADDR_V4", "") self.addr_v6 = os.environ.get("CHATMAIL_ADDR_V6", "") self.acme_email = params.get("acme_email", "") + self.change_kernel_settings = ( + params.get("change_kernel_settings", "true").lower() == "true" + ) + self.fs_inotify_max_user_instances_and_watchers = int( + params["fs_inotify_max_user_instances_and_watchers"] + ) self.imap_rawlog = params.get("imap_rawlog", "false").lower() == "true" self.imap_compress = params.get("imap_compress", "false").lower() == "true" if "iroh_relay" not in params: diff --git a/chatmaild/src/chatmaild/ini/chatmail.ini.f b/chatmaild/src/chatmaild/ini/chatmail.ini.f index 29d7baa9..fc2cfa78 100644 --- a/chatmaild/src/chatmaild/ini/chatmail.ini.f +++ b/chatmaild/src/chatmaild/ini/chatmail.ini.f @@ -69,6 +69,16 @@ disable_ipv6 = False # Your email adress, which will be used in acmetool to manage Let's Encrypt SSL certificates acme_email = +# +# Kernel settings +# + +# if you set "True", the kernel settings will be configured according to the values below +change_kernel_settings = True + +# change fs.inotify.max_user_instances and fs.inotify.max_user_watches kernel settings +fs_inotify_max_user_instances_and_watchers = 65535 + # Defaults to https://iroh.{{mail_domain}} and running `iroh-relay` on the chatmail # service. # If you set it to anything else, the service will be disabled diff --git a/docker-compose.yaml b/docker-compose.yaml index 79feb149..b339812d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -20,6 +20,7 @@ services: max-size: "10m" max-file: "3" environment: + CHANGE_KERNEL_SETTINGS: "False" MAIL_DOMAIN: $MAIL_DOMAIN ACME_EMAIL: $ACME_EMAIL RECREATE_VENV: $RECREATE_VENV diff --git a/docker/files/setup_chatmail_docker.sh b/docker/files/setup_chatmail_docker.sh index c5daff34..be3f0853 100755 --- a/docker/files/setup_chatmail_docker.sh +++ b/docker/files/setup_chatmail_docker.sh @@ -5,6 +5,7 @@ export INI_FILE="${INI_FILE:-chatmail.ini}" export ENABLE_CERTS_MONITORING="${ENABLE_CERTS_MONITORING:-true}" export CERTS_MONITORING_TIMEOUT="${CERTS_MONITORING_TIMEOUT:-60}" export PATH_TO_SSL="${PATH_TO_SSL:-/var/lib/acme/live/${MAIL_DOMAIN}}" +export CHANGE_KERNEL_SETTINGS=${CHANGE_KERNEL_SETTINGS:-"False"} export RECREATE_VENV=${RECREATE_VENV:-"false"} if [ -z "$MAIL_DOMAIN" ]; then