Skip to content

Commit

Permalink
add support for changing MailCommand from environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
netsandbox committed Feb 11, 2024
1 parent 56e731d commit a04300b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 4.4/RT_SiteConfig.pm
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
2 changes: 2 additions & 0 deletions 4.4/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
set -euo pipefail

: "${RT_CANONICALIZE_REDIRECT_URLS:=0}"
: "${RT_MAIL_COMMAND:=testfile}"
: "${RT_WEB_DOMAIN:=localhost}"
: "${RT_WEB_PORT:=80}"

: "${RT_ROOT_PASSWORD:=}"

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
Expand Down
2 changes: 1 addition & 1 deletion 5.0/RT_SiteConfig.pm
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
2 changes: 2 additions & 0 deletions 5.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
set -euo pipefail

: "${RT_CANONICALIZE_REDIRECT_URLS:=0}"
: "${RT_MAIL_COMMAND:=testfile}"
: "${RT_WEB_DOMAIN:=localhost}"
: "${RT_WEB_PORT:=80}"

: "${RT_ROOT_PASSWORD:=}"

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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
2 changes: 1 addition & 1 deletion RT_SiteConfig.pm
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
2 changes: 2 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
set -euo pipefail

: "${RT_CANONICALIZE_REDIRECT_URLS:=0}"
: "${RT_MAIL_COMMAND:=testfile}"
: "${RT_WEB_DOMAIN:=localhost}"
: "${RT_WEB_PORT:=80}"

: "${RT_ROOT_PASSWORD:=}"

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
Expand Down

0 comments on commit a04300b

Please sign in to comment.