From 6d9b004b54bb4859637ec80631ae8222ec99d129 Mon Sep 17 00:00:00 2001 From: Victor Popkov Date: Sat, 9 Mar 2024 18:40:44 +0200 Subject: [PATCH] Add support for DISABLE_SUMMARY environment variable in official image --- README.md | 14 ++++++++------ official/Dockerfile | 1 + official/docker-compose.yml | 1 + official/entrypoint/entrypoint.sh | 26 ++++++++++++++------------ 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 9bceccd..2ce5a4b 100644 --- a/README.md +++ b/README.md @@ -487,6 +487,7 @@ services: environment: # system parameters DISABLE_COLORS: 0 + DISABLE_SUMMARY: 0 TZ: UTC # general parameters TERRARIA_AUTOCREATE: 3 @@ -631,12 +632,13 @@ services: System environment variables are unrelated to the [Terraria] server and are exclusive to the system. -| Name | Image | Default | Description | -| ------------------------- | ------------------------ | --------- | ------------------------ | -| `DISABLE_COLORS` | `official` | `0` | Toggles colored output | -| `TERRARIA_TSHOCK_VERSION` | `tshock` | `5.2.0` | Shows [TShock] version | -| `TERRARIA_VERSION` | `official`
`tshock` | `1.4.4.9` | Shows [Terraria] version | -| `TZ` | `official`
`tshock` | `UTC` | Sets the timezone. | +| Name | Image | Default | Description | +| ------------------------- | ------------------------ | --------- | --------------------------------------------------------- | +| `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 | +| `TERRARIA_VERSION` | `official`
`tshock` | `1.4.4.9` | Shows [Terraria] version | +| `TZ` | `official`
`tshock` | `UTC` | Sets the timezone. | ### General diff --git a/official/Dockerfile b/official/Dockerfile index fc0d208..95f74af 100644 --- a/official/Dockerfile +++ b/official/Dockerfile @@ -6,6 +6,7 @@ ARG TERRARIA_VERSION="1.4.4.9" ENV TERRARIA_VERSION="${TERRARIA_VERSION}" ENV DISABLE_COLORS=0 +ENV DISABLE_SUMMARY=0 ENV TZ="UTC" # general parameters diff --git a/official/docker-compose.yml b/official/docker-compose.yml index dd927bd..8e961d4 100644 --- a/official/docker-compose.yml +++ b/official/docker-compose.yml @@ -12,6 +12,7 @@ services: environment: # system parameters DISABLE_COLORS: 0 + DISABLE_SUMMARY: 0 TZ: UTC # general parameters TERRARIA_AUTOCREATE: 3 diff --git a/official/entrypoint/entrypoint.sh b/official/entrypoint/entrypoint.sh index 8f0cf41..78f5dd0 100755 --- a/official/entrypoint/entrypoint.sh +++ b/official/entrypoint/entrypoint.sh @@ -618,21 +618,23 @@ done save_config if [ "$start_server" -eq 1 ]; then - echo "Terraria version: $TERRARIA_VERSION" - echo "Working directory: $(pwd)/" - echo "Configuration: $config" - echo "Command: $binary $args" + if [ "$DISABLE_SUMMARY" != '1' ]; then + echo "Terraria version: $TERRARIA_VERSION" + echo "Working directory: $(pwd)/" + echo "Configuration: $config" + echo "Command: $binary $args" + + if [ -t 0 ]; then + echo "TTY mode: enabled" + else + echo "TTY mode: disabled" + fi - if [ -t 0 ]; then - echo "TTY mode: enabled" - else - echo "TTY mode: disabled" + printf '\n' + print_parameters + echo '---' fi - printf '\n' - print_parameters - echo '---' - mkfifo "$input_fifo" mkfifo "$output_fifo"