Skip to content

Commit

Permalink
add support for changing root user password
Browse files Browse the repository at this point in the history
see #23
  • Loading branch information
netsandbox committed Feb 11, 2024
1 parent 0d40542 commit d7e0ead
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions 4.4/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

set -euo pipefail

: "${RT_ROOT_PASSWORD:=}"
: "${RT_WEB_PORT:=80}"

sed -i "s/RT_WEB_PORT/$RT_WEB_PORT/" /opt/rt4/etc/RT_SiteConfig.pm

if [[ -n "${RT_ROOT_PASSWORD}" ]]; then
(echo "${RT_ROOT_PASSWORD}" | /opt/rt4/sbin/rt-passwd root) || [[ $? -gt 1 ]] && exit 1
fi

exec "$@"
5 changes: 5 additions & 0 deletions 5.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

set -euo pipefail

: "${RT_ROOT_PASSWORD:=}"
: "${RT_WEB_PORT:=80}"

sed -i "s/RT_WEB_PORT/$RT_WEB_PORT/" /opt/rt5/etc/RT_SiteConfig.pm

if [[ -n "${RT_ROOT_PASSWORD}" ]]; then
(echo "${RT_ROOT_PASSWORD}" | /opt/rt5/sbin/rt-passwd root) || [[ $? -gt 1 ]] && exit 1
fi

exec "$@"
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ docker run -d --name rt -p 8080:8080 -e RT_WEB_PORT=8080 ghcr.io/netsandbox/requ

Then, access it via `http://localhost:8080` or `http://host-ip:8080` in a browser.

### Environment Variables

| Environment Variable | Description |
| --- | --- |
| `RT_ROOT_PASSWORD` | RT root user password |
| `RT_WEB_PORT` | RT [WebPort](https://docs.bestpractical.com/rt/latest/RT_Config.html#WebPort) |

## RT Extension Testing

You can use these Docker images to test your RT Extensions.
Expand Down
5 changes: 5 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

set -euo pipefail

: "${RT_ROOT_PASSWORD:=}"
: "${RT_WEB_PORT:=80}"

sed -i "s/RT_WEB_PORT/$RT_WEB_PORT/" /opt/rt%%RT_VERSION_MAJOR%%/etc/RT_SiteConfig.pm

if [[ -n "${RT_ROOT_PASSWORD}" ]]; then
(echo "${RT_ROOT_PASSWORD}" | /opt/rt%%RT_VERSION_MAJOR%%/sbin/rt-passwd root) || [[ $? -gt 1 ]] && exit 1
fi

exec "$@"

0 comments on commit d7e0ead

Please sign in to comment.