fix healthcheck again

This commit is contained in:
Zoey
2024-01-26 23:30:14 +01:00
parent 235bdc262b
commit 740d4c74aa
2 changed files with 21 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ on:
jobs:
update-and-lint:
runs-on: ubuntu-latest
if: ${{ github.ref_name == 'develop' }}
steps:
- name: Checkout
uses: actions/checkout@v4

View File

@@ -1,6 +1,7 @@
#!/bin/sh
export HC_IP="localhost"
export HCNPM_IP="localhost"
export HCGOA_IP="localhost"
if [ "$NPM_LISTEN_LOCALHOST" = "true" ]; then
export NPM_IPV4_BINDING="127.0.0.1"
@@ -8,15 +9,29 @@ if [ "$NPM_LISTEN_LOCALHOST" = "true" ]; then
fi
if [ "$NPM_IPV6_BINDING" != "[::]" ] && [ "$NPM_IPV4_BINDING" != "0.0.0.0" ]; then
if [ "$NPM_IPV6_BINDING" != "[::]" ] && [ "$DISABLE_IPV6" = "false" ]; then
export HC_IP="$NPM_IPV6_BINDING"
if [ "$NPM_IPV6_BINDING" != "[::]" ] && [ "$NPM_DISABLE_IPV6" = "false" ]; then
export HCNPM_IP="$NPM_IPV6_BINDING"
fi
if [ "$NPM_IPV4_BINDING" != "0.0.0.0" ]; then
export HC_IP="$NPM_IPV4_BINDING"
export HCNPM_IP="$NPM_IPV4_BINDING"
fi
fi
if (if [ "$GOA" = "true" ]; then [ -f /tmp/goa/index.html ]; fi && if [ "$PHP81" = true ]; then cgi-fcgi -bind -connect /var/php81.sock > /dev/null 2>&1; fi && if [ "$PHP82" = true ]; then cgi-fcgi -bind -connect /var/php82.sock > /dev/null 2>&1; fi && if [ "$PHP83" = true ]; then cgi-fcgi -bind -connect /var/php83.sock > /dev/null 2>&1; fi && [ "$(curl -sk https://"$HC_IP":"$NPM_PORT"/api/ | jq --raw-output .status)" = "OK" ]); then
if [ "$GOA_LISTEN_LOCALHOST" = "true" ]; then
export GOA_IPV4_BINDING="127.0.0.1"
export GOA_IPV6_BINDING="[::1]"
fi
if [ "$GOA_IPV6_BINDING" != "[::]" ] && [ "$GOA_IPV4_BINDING" != "0.0.0.0" ]; then
if [ "$GOA_IPV6_BINDING" != "[::]" ] && [ "$GOA_DISABLE_IPV6" = "false" ]; then
export HCGOA_IP="$GOA_IPV6_BINDING"
fi
if [ "$NPM_IPV4_BINDING" != "0.0.0.0" ]; then
export HCGOA_IP="$GOA_IPV4_BINDING"
fi
fi
if (if [ "$GOA" = "true" ]; then [ -f /tmp/goa/index.html ] && nc -z "$HCGOA_IP" "$GOA_PORT"; fi && if [ "$PHP81" = true ]; then cgi-fcgi -bind -connect /run/php81.sock > /dev/null 2>&1; 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
echo "OK"
exit 0
else