Team Ai
Apppublic

Underground-Digital/Workflow-Engine

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
docker-entrypoint.sh43 linesDownload Raw Back to ssrf_proxy
1#!/bin/bash2 3# Modified based on Squid OCI image entrypoint4 5# This entrypoint aims to forward the squid logs to stdout to assist users of6# common container related tooling (e.g., kubernetes, docker-compose, etc) to7# access the service logs.8 9# Moreover, it invokes the squid binary, leaving all the desired parameters to10# be provided by the "command" passed to the spawned container. If no command11# is provided by the user, the default behavior (as per the CMD statement in12# the Dockerfile) will be to use Ubuntu's default configuration [1] and run13# squid with the "-NYC" options to mimic the behavior of the Ubuntu provided14# systemd unit.15 16# [1] The default configuration is changed in the Dockerfile to allow local17# network connections. See the Dockerfile for further information.18 19echo "[ENTRYPOINT] re-create snakeoil self-signed certificate removed in the build process"20if [ ! -f /etc/ssl/private/ssl-cert-snakeoil.key ]; then21    /usr/sbin/make-ssl-cert generate-default-snakeoil --force-overwrite > /dev/null 2>&122fi23 24tail -F /var/log/squid/access.log 2>/dev/null &25tail -F /var/log/squid/error.log 2>/dev/null &26tail -F /var/log/squid/store.log 2>/dev/null &27tail -F /var/log/squid/cache.log 2>/dev/null &28 29# Replace environment variables in the template and output to the squid.conf30echo "[ENTRYPOINT] replacing environment variables in the template"31awk '{32    while(match($0, /\${[A-Za-z_][A-Za-z_0-9]*}/)) {33        var = substr($0, RSTART+2, RLENGTH-3)34        val = ENVIRON[var]35        $0 = substr($0, 1, RSTART-1) val substr($0, RSTART+RLENGTH)36    }37    print38}' /etc/squid/squid.conf.template > /etc/squid/squid.conf39 40/usr/sbin/squid -Nz41echo "[ENTRYPOINT] starting squid"42/usr/sbin/squid -f /etc/squid/squid.conf -NYC 143