diff --git a/Dockerfiles/netbox.Dockerfile b/Dockerfiles/netbox.Dockerfile index 0ff05beb2..63e5acb01 100644 --- a/Dockerfiles/netbox.Dockerfile +++ b/Dockerfiles/netbox.Dockerfile @@ -25,9 +25,6 @@ ENV PUSER_PRIV_DROP true ARG BASE_PATH=assets ENV BASE_PATH $BASE_PATH -ARG NETBOX_DISABLED=false -ENV NETBOX_DISABLED $NETBOX_DISABLED - RUN apt-get -q update && \ apt-get -y -q --no-install-recommends upgrade && \ apt-get install -q -y --no-install-recommends \ @@ -55,6 +52,7 @@ COPY --chmod=755 shared/bin/docker-uid-gid-setup.sh /usr/local/bin/ COPY --chmod=755 shared/bin/service_check_passthrough.sh /usr/local/bin/ COPY --chmod=755 netbox/scripts/* /usr/local/bin/ COPY --chmod=644 netbox/supervisord.conf /etc/supervisord.conf +COPY --from=pierrezemb/gostatic --chmod=755 /goStatic /usr/bin/goStatic ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/docker-uid-gid-setup.sh", "/usr/local/bin/service_check_passthrough.sh"] diff --git a/Dockerfiles/opensearch.Dockerfile b/Dockerfiles/opensearch.Dockerfile index f82be3423..ecb23a882 100644 --- a/Dockerfiles/opensearch.Dockerfile +++ b/Dockerfiles/opensearch.Dockerfile @@ -56,7 +56,8 @@ RUN yum install -y openssl util-linux procps && \ ADD shared/bin/docker-uid-gid-setup.sh /usr/local/bin/ ADD shared/bin/jdk-cacerts-auto-import.sh /usr/local/bin/ -ADD shared/bin/service_check_passthrough.sh /usr/local/bin/docker-entrypoint.sh +COPY --chmod=755 shared/bin/service_check_passthrough.sh /usr/local/bin/docker-entrypoint.sh +COPY --from=pierrezemb/gostatic --chmod=755 /goStatic /usr/bin/goStatic VOLUME ["/var/local/ca-trust"] diff --git a/Dockerfiles/postgresql.Dockerfile b/Dockerfiles/postgresql.Dockerfile index 3332b9aa6..bd4b6739e 100644 --- a/Dockerfiles/postgresql.Dockerfile +++ b/Dockerfiles/postgresql.Dockerfile @@ -22,20 +22,25 @@ ENV PUSER_CHOWN "/run/postgresql;/var/lib/postgresql" ENV TERM xterm COPY --chmod=755 shared/bin/docker-uid-gid-setup.sh /usr/local/bin/ - -RUN set -x && \ - apk --no-cache add bash procps psmisc rsync shadow tini && \ - rsync -a /usr/local/bin/ /usr/bin/ && \ - rsync -a /usr/local/share/ /usr/share/ && \ - rsync -a /usr/local/lib/ /usr/lib/ && \ - rm -rf /usr/local/bin /usr/local/share /usr/local/lib && \ - ln -s /usr/bin /usr/local/bin && \ - ln -s /usr/share /usr/local/share && \ - ln -s /usr/lib /usr/local/lib +COPY --chmod=755 shared/bin/service_check_passthrough.sh /usr/local/bin/ +COPY --from=pierrezemb/gostatic --chmod=755 /goStatic /usr/bin/goStatic + +RUN apk update --no-cache && \ + apk upgrade --no-cache && \ + apk add --no-cache bash procps psmisc shadow tini && \ + apk add --no-cache --virtual .build-deps rsync && \ + rsync -a /usr/local/bin/ /usr/bin/ && \ + rsync -a /usr/local/share/ /usr/share/ && \ + rsync -a /usr/local/lib/ /usr/lib/ && \ + rm -rf /usr/local/bin /usr/local/share /usr/local/lib && \ + ln -s /usr/bin /usr/local/bin && \ + ln -s /usr/share /usr/local/share && \ + ln -s /usr/lib /usr/local/lib && \ + apk del .build-deps USER root -ENTRYPOINT ["/sbin/tini", "--", "/usr/bin/docker-uid-gid-setup.sh"] +ENTRYPOINT ["/sbin/tini", "--", "/usr/bin/docker-uid-gid-setup.sh", "/usr/local/bin/service_check_passthrough.sh"] CMD ["/usr/bin/docker-entrypoint.sh", "postgres"] diff --git a/Dockerfiles/redis.Dockerfile b/Dockerfiles/redis.Dockerfile index 7ca752aab..c109f2ed7 100644 --- a/Dockerfiles/redis.Dockerfile +++ b/Dockerfiles/redis.Dockerfile @@ -21,6 +21,8 @@ ENV PUSER_PRIV_DROP true ENV TERM xterm COPY --chmod=755 shared/bin/docker-uid-gid-setup.sh /usr/local/bin/ +COPY --chmod=755 shared/bin/service_check_passthrough.sh /usr/local/bin/ +COPY --from=pierrezemb/gostatic --chmod=755 /goStatic /usr/bin/goStatic RUN apk update --no-cache && \ apk upgrade --no-cache && \ @@ -29,7 +31,7 @@ RUN apk update --no-cache && \ WORKDIR /home/${PUSER} -ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/docker-uid-gid-setup.sh"] +ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/docker-uid-gid-setup.sh", "/usr/local/bin/service_check_passthrough.sh"] # to be populated at build-time: ARG BUILD_DATE diff --git a/docker-compose-standalone.yml b/docker-compose-standalone.yml index a2d35f432..df5cda14b 100644 --- a/docker-compose-standalone.yml +++ b/docker-compose-standalone.yml @@ -265,7 +265,10 @@ x-filebeat-variables: &filebeat-variables x-netbox-variables: &netbox-variables # Parameters related to NetBox (and supporting tools). Note that other more specific parameters # can also be configured in the env_file files for netbox* services - NETBOX_DISABLED : 'true' + NETBOX_DISABLED : &netboxdisabled 'true' + NETBOX_POSTGRES_DISABLED : *netboxdisabled + NETBOX_REDIS_DISABLED : *netboxdisabled + NETBOX_REDIS_CACHE_DISABLED : *netboxdisabled x-common-upload-variables: &common-upload-variables # Whether or not to automatically apply tags based (on the PCAP filename) to network traffic metadata diff --git a/docker-compose.yml b/docker-compose.yml index 6d7c318e1..81d8bd6d3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -265,7 +265,10 @@ x-filebeat-variables: &filebeat-variables x-netbox-variables: &netbox-variables # Parameters related to NetBox (and supporting tools). Note that other more specific parameters # can also be configured in the env_file files for netbox* services - NETBOX_DISABLED : 'true' + NETBOX_DISABLED : &netboxdisabled 'true' + NETBOX_POSTGRES_DISABLED : *netboxdisabled + NETBOX_REDIS_DISABLED : *netboxdisabled + NETBOX_REDIS_CACHE_DISABLED : *netboxdisabled x-common-upload-variables: &common-upload-variables # Whether or not to automatically apply tags based (on the PCAP filename) to network traffic metadata diff --git a/shared/bin/service_check_passthrough.sh b/shared/bin/service_check_passthrough.sh index a56abfc04..013f52cf5 100755 --- a/shared/bin/service_check_passthrough.sh +++ b/shared/bin/service_check_passthrough.sh @@ -31,6 +31,7 @@ while getopts 'vds:p:f:' OPTION; do case "$OPTION" in v) VERBOSE_FLAG="-v" + set -x ;; d) @@ -71,7 +72,7 @@ if [[ -z "$SERVICE" ]]; then SERVICE="$(uname -a | awk '{print $2}')" fi fi -SERVICE_UCASE="$(echo ${SERVICE^^})" +SERVICE_UCASE="$(echo ${SERVICE^^} | tr '-' '_')" # if disabled wasn't specified, but service was, check environment variables if [[ -z "$DISABLED" ]] && [[ -n "$SERVICE" ]]; then @@ -154,7 +155,9 @@ EOF EOF fi # json vs http - if command -v python3 >/dev/null 2>&1; then + if command -v goStatic >/dev/null 2>&1; then + goStatic -path "$(pwd)" -fallback "index.html" -port $PORT + elif command -v python3 >/dev/null 2>&1; then python3 -m http.server --bind 0.0.0.0 $PORT elif command -v python >/dev/null 2>&1; then python -m SimpleHTTPServer $PORT