From a04300b9df057a5e8e99a7a8f2e3e01d3e9c585d Mon Sep 17 00:00:00 2001 From: Christian Loos Date: Sun, 11 Feb 2024 18:51:17 +0100 Subject: [PATCH] add support for changing MailCommand from environment variable --- 4.4/RT_SiteConfig.pm | 2 +- 4.4/docker-entrypoint.sh | 2 ++ 5.0/RT_SiteConfig.pm | 2 +- 5.0/docker-entrypoint.sh | 2 ++ README.md | 1 + RT_SiteConfig.pm | 2 +- docker-entrypoint.sh | 2 ++ 7 files changed, 10 insertions(+), 3 deletions(-) diff --git a/4.4/RT_SiteConfig.pm b/4.4/RT_SiteConfig.pm index bbc7ffe..69e4209 100644 --- a/4.4/RT_SiteConfig.pm +++ b/4.4/RT_SiteConfig.pm @@ -1,7 +1,7 @@ use utf8; Set($CanonicalizeRedirectURLs, RT_CANONICALIZE_REDIRECT_URLS); -Set($MailCommand, "testfile"); +Set($MailCommand, "RT_MAIL_COMMAND"); Set($WebDomain, "RT_WEB_DOMAIN"); Set($WebPort, RT_WEB_PORT); diff --git a/4.4/docker-entrypoint.sh b/4.4/docker-entrypoint.sh index 8a3a4b8..9b143cc 100755 --- a/4.4/docker-entrypoint.sh +++ b/4.4/docker-entrypoint.sh @@ -3,6 +3,7 @@ set -euo pipefail : "${RT_CANONICALIZE_REDIRECT_URLS:=0}" +: "${RT_MAIL_COMMAND:=testfile}" : "${RT_WEB_DOMAIN:=localhost}" : "${RT_WEB_PORT:=80}" @@ -10,6 +11,7 @@ set -euo pipefail sed -i \ -e "s/RT_CANONICALIZE_REDIRECT_URLS/$RT_CANONICALIZE_REDIRECT_URLS/" \ + -e "s/RT_MAIL_COMMAND/$RT_MAIL_COMMAND/" \ -e "s/RT_WEB_DOMAIN/$RT_WEB_DOMAIN/" \ -e "s/RT_WEB_PORT/$RT_WEB_PORT/" \ /opt/rt4/etc/RT_SiteConfig.pm diff --git a/5.0/RT_SiteConfig.pm b/5.0/RT_SiteConfig.pm index bbc7ffe..69e4209 100644 --- a/5.0/RT_SiteConfig.pm +++ b/5.0/RT_SiteConfig.pm @@ -1,7 +1,7 @@ use utf8; Set($CanonicalizeRedirectURLs, RT_CANONICALIZE_REDIRECT_URLS); -Set($MailCommand, "testfile"); +Set($MailCommand, "RT_MAIL_COMMAND"); Set($WebDomain, "RT_WEB_DOMAIN"); Set($WebPort, RT_WEB_PORT); diff --git a/5.0/docker-entrypoint.sh b/5.0/docker-entrypoint.sh index c1d5f89..ab5532a 100755 --- a/5.0/docker-entrypoint.sh +++ b/5.0/docker-entrypoint.sh @@ -3,6 +3,7 @@ set -euo pipefail : "${RT_CANONICALIZE_REDIRECT_URLS:=0}" +: "${RT_MAIL_COMMAND:=testfile}" : "${RT_WEB_DOMAIN:=localhost}" : "${RT_WEB_PORT:=80}" @@ -10,6 +11,7 @@ set -euo pipefail sed -i \ -e "s/RT_CANONICALIZE_REDIRECT_URLS/$RT_CANONICALIZE_REDIRECT_URLS/" \ + -e "s/RT_MAIL_COMMAND/$RT_MAIL_COMMAND/" \ -e "s/RT_WEB_DOMAIN/$RT_WEB_DOMAIN/" \ -e "s/RT_WEB_PORT/$RT_WEB_PORT/" \ /opt/rt5/etc/RT_SiteConfig.pm diff --git a/README.md b/README.md index 1d88364..5e0fba9 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,7 @@ Then, access it via `http://localhost:8080` or `http://host-ip:8080` in a browse | Environment Variable | Description | | --- | --- | | `RT_CANONICALIZE_REDIRECT_URLS` | RT [CanonicalizeRedirectURLs](https://docs.bestpractical.com/rt/latest/RT_Config.html#CanonicalizeRedirectURLs) | +| `RT_MAIL_COMMAND` | RT [MailCommand](https://docs.bestpractical.com/rt/latest/RT_Config.html#MailCommand), Default is 'testfile' | | `RT_ROOT_PASSWORD` | RT root user password | | `RT_WEB_DOMAIN` | RT [WebDomain](https://docs.bestpractical.com/rt/latest/RT_Config.html#WebDomain) | | `RT_WEB_PORT` | RT [WebPort](https://docs.bestpractical.com/rt/latest/RT_Config.html#WebPort) | diff --git a/RT_SiteConfig.pm b/RT_SiteConfig.pm index bbc7ffe..69e4209 100644 --- a/RT_SiteConfig.pm +++ b/RT_SiteConfig.pm @@ -1,7 +1,7 @@ use utf8; Set($CanonicalizeRedirectURLs, RT_CANONICALIZE_REDIRECT_URLS); -Set($MailCommand, "testfile"); +Set($MailCommand, "RT_MAIL_COMMAND"); Set($WebDomain, "RT_WEB_DOMAIN"); Set($WebPort, RT_WEB_PORT); diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 92b252b..d6a76f0 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -3,6 +3,7 @@ set -euo pipefail : "${RT_CANONICALIZE_REDIRECT_URLS:=0}" +: "${RT_MAIL_COMMAND:=testfile}" : "${RT_WEB_DOMAIN:=localhost}" : "${RT_WEB_PORT:=80}" @@ -10,6 +11,7 @@ set -euo pipefail sed -i \ -e "s/RT_CANONICALIZE_REDIRECT_URLS/$RT_CANONICALIZE_REDIRECT_URLS/" \ + -e "s/RT_MAIL_COMMAND/$RT_MAIL_COMMAND/" \ -e "s/RT_WEB_DOMAIN/$RT_WEB_DOMAIN/" \ -e "s/RT_WEB_PORT/$RT_WEB_PORT/" \ /opt/rt%%RT_VERSION_MAJOR%%/etc/RT_SiteConfig.pm