From fe44afa59b0c6a6063c6474dafde1ba6e8733389 Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Wed, 15 Nov 2023 12:43:06 +0000 Subject: [PATCH 1/3] fix: add missing env var in compose.yaml If we do not add the env var it will not be injected in the running container. --- compose.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compose.yaml b/compose.yaml index fa968c41..db66954f 100644 --- a/compose.yaml +++ b/compose.yaml @@ -8,6 +8,7 @@ services: target: release tty: true environment: + - USER_ID=${USER_ID} - TORRUST_INDEX_CONFIG=${TORRUST_INDEX_CONFIG} - TORRUST_INDEX_DATABASE_DRIVER=${TORRUST_INDEX_DATABASE_DRIVER:-sqlite3} - TORRUST_INDEX_TRACKER_API_TOKEN=${TORRUST_INDEX_TRACKER_API_TOKEN:-MyAccessToken} @@ -28,6 +29,7 @@ services: image: torrust/tracker:develop tty: true environment: + - USER_ID=${USER_ID} - TORRUST_TRACKER_CONFIG=${TORRUST_TRACKER_CONFIG} - TORRUST_TRACKER_DATABASE_DRIVER=${TORRUST_TRACKER_DATABASE_DRIVER:-sqlite3} - TORRUST_TRACKER_API_ADMIN_TOKEN=${TORRUST_TRACKER_API_ADMIN_TOKEN:-MyAccessToken} From 5b73255c7e86b82d417a99ad68f4118887e3536c Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Wed, 15 Nov 2023 12:45:47 +0000 Subject: [PATCH 2/3] chore: disable shellcheck SC2016 in entryscript We do not want to replace variables. --- share/container/entry_script_sh | 1 + 1 file changed, 1 insertion(+) diff --git a/share/container/entry_script_sh b/share/container/entry_script_sh index 5f8d9d21..1afd9e6b 100644 --- a/share/container/entry_script_sh +++ b/share/container/entry_script_sh @@ -73,6 +73,7 @@ if [ -e "/usr/share/torrust/container/message" ]; then fi # Load message of the day from Profile +# shellcheck disable=SC2016 echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' >> /etc/profile cd /home/torrust || exit 1 From 022b74efe5abd8359909f2458c0d8f2245beb011 Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Wed, 15 Nov 2023 12:46:42 +0000 Subject: [PATCH 3/3] chore: [#386] remove deprecated container varaibles --- Containerfile | 8 +------- contrib/dev-tools/container/build.sh | 3 --- contrib/dev-tools/container/e2e/sqlite/e2e-env-up.sh | 1 + 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Containerfile b/Containerfile index 378a9b10..4048d27d 100644 --- a/Containerfile +++ b/Containerfile @@ -98,20 +98,14 @@ COPY --from=gcc --chmod=0555 /usr/local/bin/su-exec /bin/su-exec ARG TORRUST_INDEX_PATH_CONFIG="/etc/torrust/index/index.toml" ARG TORRUST_INDEX_DATABASE_DRIVER="sqlite3" ARG USER_ID=1000 -ARG UDP_PORT=6969 -ARG HTTP_PORT=7070 -ARG API_PORT=1212 +ARG API_PORT=3001 ENV TORRUST_INDEX_PATH_CONFIG=${TORRUST_INDEX_PATH_CONFIG} ENV TORRUST_INDEX_DATABASE_DRIVER=${TORRUST_INDEX_DATABASE_DRIVER} ENV USER_ID=${USER_ID} -ENV UDP_PORT=${UDP_PORT} -ENV HTTP_PORT=${HTTP_PORT} ENV API_PORT=${API_PORT} ENV TZ=Etc/UTC -EXPOSE ${UDP_PORT}/udp -EXPOSE ${HTTP_PORT}/tcp EXPOSE ${API_PORT}/tcp RUN mkdir -p /var/lib/torrust/index /var/log/torrust/index /etc/torrust/index diff --git a/contrib/dev-tools/container/build.sh b/contrib/dev-tools/container/build.sh index e4dafebd..c6c28635 100755 --- a/contrib/dev-tools/container/build.sh +++ b/contrib/dev-tools/container/build.sh @@ -1,13 +1,10 @@ #!/bin/bash USER_ID=${USER_ID:-1000} -TORRUST_INDEX_RUN_AS_USER=${TORRUST_INDEX_RUN_AS_USER:-appuser} echo "Building docker image ..." echo "USER_ID: $USER_ID" -echo "TORRUST_INDEX_RUN_AS_USER: $TORRUST_INDEX_RUN_AS_USER" docker build \ --build-arg UID="$USER_ID" \ - --build-arg RUN_AS_USER="$TORRUST_INDEX_RUN_AS_USER" \ -t torrust-index . diff --git a/contrib/dev-tools/container/e2e/sqlite/e2e-env-up.sh b/contrib/dev-tools/container/e2e/sqlite/e2e-env-up.sh index 7eb7f16f..7d2d224f 100755 --- a/contrib/dev-tools/container/e2e/sqlite/e2e-env-up.sh +++ b/contrib/dev-tools/container/e2e/sqlite/e2e-env-up.sh @@ -11,3 +11,4 @@ USER_ID=${USER_ID:-1000} \ TORRUST_TRACKER_DATABASE_DRIVER="sqlite3" \ TORRUST_TRACKER_API_ADMIN_TOKEN="MyAccessToken" \ docker compose up -d +