diff --git a/CHANGELOG.md b/CHANGELOG.md index b24513cd7..d41e77a3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * added `nodejs18` * updated `jira8`, `bitbucket`, `vscode` * updated `apache2`, `zabbix`, `nextcloud` + * added `retracker` by [vvampirius/retracker](https://github.com/vvampirius/retracker). * `february, march` * new `nextcloud` images, updated `atlassian` images. * new `nodejs` iamges. diff --git a/linux/ecosystem/retracker/Dockerfile b/linux/ecosystem/retracker/Dockerfile new file mode 100644 index 000000000..3d1f17a3b --- /dev/null +++ b/linux/ecosystem/retracker/Dockerfile @@ -0,0 +1,19 @@ +FROM epicmorg/debian:bullseye-develop as builder + +RUN go get -v github.com/vvampirius/retracker/... +RUN retracker -v + +FROM epicmorg/debian:bullseye +COPY --from=builder /go/bin/retracker /bin/retracker + +ENV RETRACKER_PORT=80 +ENV RETRACKER_MINUTS=180 +ENV RETRACKER_DEBUG=false +ENV RETRACKER_REAL_IP=true + +RUN retracker -v + +EXPOSE ${RETRACKER_PORT} + +ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] +CMD ["docker-entrypoint.sh"] diff --git a/linux/ecosystem/retracker/Makefile b/linux/ecosystem/retracker/Makefile new file mode 100644 index 000000000..bad6d73b5 --- /dev/null +++ b/linux/ecosystem/retracker/Makefile @@ -0,0 +1,19 @@ +all: app + +app: + make build + make deploy + make clean + +build: + docker-compose build --compress --parallel + +deploy: + docker-compose push + +clean: + docker container prune -f + docker image prune -f + docker network prune -f + docker volume prune -f + docker system prune -af diff --git a/linux/ecosystem/retracker/docker-compose.yml b/linux/ecosystem/retracker/docker-compose.yml new file mode 100644 index 000000000..3a3577107 --- /dev/null +++ b/linux/ecosystem/retracker/docker-compose.yml @@ -0,0 +1,6 @@ +version: '3.9' +services: + app: + image: "epicmorg/retracker:latest" + build: + context: . diff --git a/linux/ecosystem/retracker/docker-entrypoint.sh b/linux/ecosystem/retracker/docker-entrypoint.sh new file mode 100755 index 000000000..5dd4450d9 --- /dev/null +++ b/linux/ecosystem/retracker/docker-entrypoint.sh @@ -0,0 +1,62 @@ +#!/bin/bash +set -euo pipefail + +# Setup default Opts +: ${RETRACKER_PORT:=80} +: ${RETRACKER_MINUTS:=180} +: ${RETRACKER_DEBUG:=false} +: ${RETRACKER_REAL_IP:=true} +re='^[0-9]+$' + + +if [[ -z "${RETRACKER_REAL_IP}" ]]; then + echo "[retracker] RemoteAddr from X-Real-IP header env RETRACKER_REAL_IP is not set. Skipping..." + export RETRACKER_REAL_IP_S="" +elif [ "${RETRACKER_REAL_IP}" == "false" ]; then + echo "[retracker] RemoteAddr from X-Real-IP header env RETRACKER_REAL_IP is set to false. Skipping..." + export RETRACKER_REAL_IP_S="" +elif [ "${RETRACKER_REAL_IP}" == "true" ]; then + echo "[retracker] RemoteAddr from X-Real-IP header env RETRACKER_REAL_IP is set to true. Enabling it." + export RETRACKER_REAL_IP_S="-x" +else + echo "[retracker] RemoteAddr from X-Real-IP header env RETRACKER_REAL_IP is set to strange value. Skipping..." + export RETRACKER_REAL_IP_S="" +fi + + +if [[ -z "${RETRACKER_DEBUG}" ]]; then + echo "[retracker] Debug env RETRACKER_DEBUG is not set. Skipping..." + export RETRACKER_DEBUG_S="" +elif [ "${RETRACKER_DEBUG}" == "false" ]; then + echo "[retracker] Debug env RETRACKER_DEBUG is set to false. Skipping..." + export RETRACKER_DEBUG_S="" +elif [ "${RETRACKER_DEBUG}" == "true" ]; then + echo "[retracker] Debug env RETRACKER_DEBUG is set to true. Enabling it." + export RETRACKER_DEBUG_S="-d" +else + echo "[retracker] Debug env RETRACKER_DEBUG is set to strange value. Skipping..." + export RETRACKER_DEBUG_S="" +fi + + +if ! [[ $RETRACKER_PORT =~ $re ]] ; then + echo "[retracker] error: Port env RETRACKER_PORT not a number." + export RETRACKER_PORT_S="" + exit 1 +fi +export RETRACKER_PORT_S="-l :${RETRACKER_PORT}" + + +if ! [[ $RETRACKER_MINUTS =~ $re ]] ; then + echo "[retracker] error: Port env RETRACKER_MINUTS not a number." + export RETRACKER_MINUTS_S="" + exit 1 +fi +export RETRACKER_MINUTS_S="-a ${RETRACKER_MINUTS}" + +#Building final options string +export RETRACKER_OPTS="${RETRACKER_REAL_IP_S} ${RETRACKER_DEBUG_S} ${RETRACKER_MINUTS_S} ${RETRACKER_PORT_S}" + +echo "[retracker] Starting up" +retracker -v +retracker ${RETRACKER_OPTS}