Skip to content

Commit

Permalink
Add support for DEBUG_ENTRYPOINT environment variable in official image
Browse files Browse the repository at this point in the history
  • Loading branch information
victorpopkov committed Mar 9, 2024
1 parent 6d9b004 commit b2dc030
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ services:
- './data/:/data/:rw'
environment:
# system parameters
DEBUG_ENTRYPOINT: 0
DISABLE_COLORS: 0
DISABLE_SUMMARY: 0
TZ: UTC
Expand Down Expand Up @@ -634,6 +635,7 @@ exclusive to the system.
| Name | Image | Default | Description |
| ------------------------- | ------------------------ | --------- | --------------------------------------------------------- |
| `DEBUG_ENTRYPOINT` | `official` | `0` | Toggles debug messages in the entrypoint |
| `DISABLE_COLORS` | `official` | `0` | Toggles colored output |
| `DISABLE_SUMMARY` | `official` | `0` | Toggles configurations summary before starting the server |
| `TERRARIA_TSHOCK_VERSION` | `tshock` | `5.2.0` | Shows [TShock] version |
Expand Down
1 change: 1 addition & 0 deletions official/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ARG TERRARIA_VERSION="1.4.4.9"
ENV TERRARIA_VERSION="${TERRARIA_VERSION}"

ENV DEBUG_ENTRYPOINT=0
ENV DISABLE_COLORS=0
ENV DISABLE_SUMMARY=0
ENV TZ="UTC"
Expand Down
1 change: 1 addition & 0 deletions official/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
- './data/:/data/:rw'
environment:
# system parameters
DEBUG_ENTRYPOINT: 0
DISABLE_COLORS: 0
DISABLE_SUMMARY: 0
TZ: UTC
Expand Down
10 changes: 5 additions & 5 deletions official/entrypoint/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ args="-config $config"
binary_basename="$(basename $binary)"
capture_input_pid=''
capture_output_pid=''
debug=0
debug="$DEBUG_ENTRYPOINT"
journey_permissions='journeypermission_biomespread_setfrozen
journeypermission_godmode
journeypermission_increaseplacementrange
Expand Down Expand Up @@ -105,13 +105,13 @@ unlock() {
}

debug_echo() {
if [ "$debug" -eq 1 ]; then
if [ "$debug" = '1' ]; then
echo "$@"
fi
}

debug_printf() {
if [ "$debug" -eq 1 ]; then
if [ "$debug" = '1' ]; then
# shellcheck disable=SC2059
printf "$@"
fi
Expand Down Expand Up @@ -439,7 +439,7 @@ capture_output() {
}

cleanup() {
if [ "$debug" -eq 1 ]; then
if [ "$debug" = '1' ]; then
lock
fi

Expand Down Expand Up @@ -471,7 +471,7 @@ cleanup() {
wait "$capture_input_pid"
wait "$capture_output_pid"

if [ "$debug" -eq 1 ]; then
if [ "$debug" = '1' ]; then
unlock
fi

Expand Down

0 comments on commit b2dc030

Please sign in to comment.