diff --git a/.github/workflows/swarm-connectivity-tester.yml b/.github/workflows/swarm-connectivity-tester.yml index b3da671..67f9a20 100644 --- a/.github/workflows/swarm-connectivity-tester.yml +++ b/.github/workflows/swarm-connectivity-tester.yml @@ -82,11 +82,6 @@ jobs: platforms: ${{ !env.ACT && 'linux/amd64,linux/arm64' || 'linux/amd64' }} pull: true push: true - build-args: | - GIT_SHA=${{ github.sha }} - GIT_BUILD_ID=${{ github.ref_name }} - BUILD_DATE=${{ steps.date.outputs.container_build_datetime }} - GIT_COMMIT_MESSAGE=${{ github.event.head_commit.message }} tags: | ${{ !env.ACT && 'benzine/swarm-connectivity-tester:target' || '' }} ${{ !env.ACT && 'ghcr.io/benzine-framework/swarm-connectivity-tester:target' || 'ghcr.io/benzine-framework/swarm-connectivity-tester:target-devel' }} @@ -104,11 +99,6 @@ jobs: platforms: ${{ !env.ACT && 'linux/amd64,linux/arm64' || 'linux/amd64' }} pull: true push: true - build-args: | - GIT_SHA=${{ github.sha }} - GIT_BUILD_ID=${{ github.ref_name }} - BUILD_DATE=${{ steps.date.outputs.container_build_datetime }} - GIT_COMMIT_MESSAGE=${{ github.event.head_commit.message }} tags: | ${{ !env.ACT && 'benzine/swarm-connectivity-tester:reporter' || '' }} ${{ !env.ACT && 'ghcr.io/benzine-framework/swarm-connectivity-tester:reporter' || 'ghcr.io/benzine-framework/swarm-connectivity-tester:reporter-devel' }} diff --git a/php/nginx/logs-phpfpm-error.runit b/php/nginx/logs-phpfpm-error.runit index f7c4bbc..e4044c1 100644 --- a/php/nginx/logs-phpfpm-error.runit +++ b/php/nginx/logs-phpfpm-error.runit @@ -1,2 +1,3 @@ #!/usr/bin/env bash +# shellcheck disable=SC1083 tail -f /var/log/php{{PHP}}-fpm.log diff --git a/php/nginx/php-fpm.runit b/php/nginx/php-fpm.runit index b25b248..041a3b9 100755 --- a/php/nginx/php-fpm.runit +++ b/php/nginx/php-fpm.runit @@ -1,9 +1,10 @@ #!/usr/bin/env bash +# shellcheck disable=SC1083,SC2312 +# Create the log file to be able to run tail without errors touch /var/log/php{{PHP}}-fpm.log # Load envs into PHP-fpm's env.conf. -# shellcheck disable=SC1083,SC2312 env | sed "s/\(.*\)=\(.*\)/env[\1]='\2'/" >/etc/php/{{PHP}}/fpm/conf.d/env.conf if [[ ${DEBUG_MODE,,} == "on" ]]; then diff --git a/swarm-connectivity-tester/Dockerfile b/swarm-connectivity-tester/Dockerfile index d93cfce..e3ba2f6 100644 --- a/swarm-connectivity-tester/Dockerfile +++ b/swarm-connectivity-tester/Dockerfile @@ -3,9 +3,10 @@ FROM php:nginx as connect-target LABEL maintainer="Matthew Baggett " \ org.label-schema.vcs-url="https://github.com/benzine-framework/docker" \ org.opencontainers.image.source="https://github.com/benzine-framework/docker" +SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN echo -e "#!/bin/bash\n\ntail -f /var/log/php8.2-fpm.log" > /etc/service/logs-phpfpm-error/run && \ chmod +x /etc/service/logs-phpfpm-error/run -SHELL ["/bin/bash", "-o", "pipefail", "-c"] + WORKDIR /app HEALTHCHECK --interval=30s --timeout=3s \ CMD curl -f http://localhost/ping.php || exit 1 @@ -16,9 +17,9 @@ FROM php:nginx as connect-reporter LABEL maintainer="Matthew Baggett " \ org.label-schema.vcs-url="https://github.com/benzine-framework/docker" \ org.opencontainers.image.source="https://github.com/benzine-framework/docker" +SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN echo -e "#!/bin/bash\n\ntail -f /var/log/php8.2-fpm.log" > /etc/service/logs-phpfpm-error/run && \ chmod +x /etc/service/logs-phpfpm-error/run -SHELL ["/bin/bash", "-o", "pipefail", "-c"] WORKDIR /app HEALTHCHECK --interval=30s --timeout=3s \ CMD curl -f http://localhost/ping.php || exit 1 diff --git a/swarm-connectivity-tester/public-reporter/index.php b/swarm-connectivity-tester/public-reporter/index.php index 752f6ce..6d98a39 100644 --- a/swarm-connectivity-tester/public-reporter/index.php +++ b/swarm-connectivity-tester/public-reporter/index.php @@ -12,7 +12,7 @@ $targets = explode(",", $_ENV['TARGETS']); $targets = array_map('trim', $targets); # For each $target, resolve the target to IP addresses -foreach($targets as $target){ +foreach($targets as $target) { $targetIps[$target] = gethostbynamel($target) ?: []; $targetIps[$target] = array_values($targetIps[$target]); } @@ -27,21 +27,21 @@ foreach ($targets as $target) { $responses = Utils::settle($promises)->wait(); $rollup = true; $json = []; -foreach($responses as $target => $response){ +foreach($responses as $target => $response) { if(!isset($response['value']) || $response['value']->getStatusCode() != 200) { $rollup = false; if ($response['reason'] instanceof \Exception) { $json[$target] = ['Status' => 'ERROR', 'Reason' => $response['reason']->getMessage()]; - }else { + } else { $json[$target] = ['Status' => "ERROR", 'Reason' => 'Unknown']; } - }else{ + } else { $json[$target] = json_decode($response['value']->getBody()->getContents(), true); } $json[$target]['IP'] = $targetIps[$target]; } -if(!$rollup){ +if(!$rollup) { header("HTTP/1.0 500 Internal Server Error"); } header('Content-Type: application/json; charset=utf-8'); diff --git a/swarm-connectivity-tester/public-reporter/ping.php b/swarm-connectivity-tester/public-reporter/ping.php index 46086db..b32aa5e 100644 --- a/swarm-connectivity-tester/public-reporter/ping.php +++ b/swarm-connectivity-tester/public-reporter/ping.php @@ -1,2 +1,3 @@ 'OK', diff --git a/swarm-connectivity-tester/public-target/ping.php b/swarm-connectivity-tester/public-target/ping.php index 46086db..b32aa5e 100644 --- a/swarm-connectivity-tester/public-target/ping.php +++ b/swarm-connectivity-tester/public-target/ping.php @@ -1,2 +1,3 @@