Skip to content

Commit

Permalink
minimum UID/GID changed to 99instead of 1000 + fix healthcheck + dep …
Browse files Browse the repository at this point in the history
…updates

Signed-off-by: Zoey <[email protected]>
  • Loading branch information
Zoey2936 committed Jan 11, 2025
1 parent aff410c commit 6ec41a2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"license": "MIT",
"devDependencies": {
"@apidevtools/swagger-parser": "10.1.1",
"@eslint/js": "9.17.0",
"eslint": "9.17.0",
"@eslint/js": "9.18.0",
"eslint": "9.18.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.2.1",
"globals": "15.14.0",
Expand Down
22 changes: 14 additions & 8 deletions rootfs/usr/local/bin/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
#!/usr/bin/env sh

export HCNPM_IP="$NPM_IPV4_BINDING"
export HCGOA_IP="$GOA_IPV4_BINDING"


if [ "$NPM_IPV4_BINDING" = "0.0.0.0" ]; then
export HCNPM_IP="127.0.0.1"
export GOA="${GOA:-false}"
export GOA_PORT="${GOA_PORT:-91}"
export GOA_IPV4_BINDING="${GOA_IPV4_BINDING:-0.0.0.0}"
if [ "$GOA_IPV4_BINDING" = "0.0.0.0" ]; then
export GOA_IPV4_BINDING="127.0.0.1"
fi

if [ "$GOA_IPV4_BINDING" = "0.0.0.0" ]; then
export HCGOA_IP="127.0.0.1"
export PHP82="${PHP82:-false}"
export PHP83="${PHP83:-false}"
export PHP84="${PHP84:-false}"

export NPM_PORT="${NPM_PORT:-81}"
export NPM_IPV4_BINDING="${NPM_IPV4_BINDING:-0.0.0.0}"
if [ "$NPM_IPV4_BINDING" = "0.0.0.0" ]; then
export NPM_IPV4_BINDING="127.0.0.1"
fi

if (if [ "$GOA" = "true" ]; then [ -f /tmp/goa/index.html ] && nc -z "$HCGOA_IP" "$GOA_PORT"; fi && if [ "$PHP82" = true ]; then cgi-fcgi -bind -connect /run/php82.sock > /dev/null 2>&1; fi && if [ "$PHP83" = true ]; then cgi-fcgi -bind -connect /run/php83.sock > /dev/null 2>&1; fi && [ "$(curl -sk https://"$HCNPM_IP":"$NPM_PORT"/api/ | jq --raw-output .status)" = "OK" ]); then
if (if [ "$GOA" = "true" ]; then [ -f /tmp/goa/index.html ] && nc -z "$GOA_IPV4_BINDING" "$GOA_PORT"; fi && if [ "$PHP82" = true ]; then cgi-fcgi -bind -connect /run/php82.sock > /dev/null 2>&1; fi && if [ "$PHP83" = true ]; then cgi-fcgi -bind -connect /run/php83.sock > /dev/null 2>&1; fi && if [ "$PHP84" = true ]; then cgi-fcgi -bind -connect /run/php84.sock > /dev/null 2>&1; fi && [ "$(curl -sk https://"$NPM_IPV4_BINDING":"$NPM_PORT"/api/ | jq --raw-output .status)" = "OK" ]); then
echo "OK"
exit 0
else
Expand Down
4 changes: 2 additions & 2 deletions rootfs/usr/local/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ if ! echo "$PUID" | grep -q "^[0-9]\+$"; then
sleep inf
fi

if [ "$PUID" -lt "1000" ] && [ "$PUID" != "0" ]; then
if [ "$PUID" -lt "99" ] && [ "$PUID" != "0" ]; then
echo "PUID needs to be a number greater or equal to 1000, or equal to 0."
sleep inf
fi
Expand All @@ -170,7 +170,7 @@ if ! echo "$PGID" | grep -q "^[0-9]\+$"; then
sleep inf
fi

if [ "$PGID" -lt "1000" ] && [ "$PGID" != "0" ]; then
if [ "$PGID" -lt "99" ] && [ "$PGID" != "0" ]; then
echo "PGID needs to be a number greater or equal to 1000, or equal to 0."
sleep inf
fi
Expand Down

0 comments on commit 6ec41a2

Please sign in to comment.