diff --git a/Dockerfile b/Dockerfile index 55b25a2..9c4bddc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,10 @@ ARG DEBIAN_RELEASE=bullseye +ARG LICENSE='' FROM docker.io/debian:$DEBIAN_RELEASE-slim ARG DEBIAN_RELEASE COPY entrypoint.sh / ENV DEBIAN_FRONTEND noninteractive +ENV LICENSE=${LICENSE} RUN true && \ apt update && \ apt install -y gnupg ca-certificates curl socat && \ diff --git a/docker-compose.yml b/docker-compose.yml index f150f2d..f429eaf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,8 @@ services: ports: - 40000:40000 restart: unless-stopped + environment: + - LICENSE= logging: driver: json-file options: diff --git a/entrypoint.sh b/entrypoint.sh index 28fdf11..435583c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,9 +7,15 @@ while ! warp-cli --accept-tos register; do done warp-cli --accept-tos set-mode proxy warp-cli --accept-tos set-proxy-port 40001 + +if [ "$LICENSE" == "" ]; then + warp-cli --accept-tos set-license $LICENSE +fi + warp-cli --accept-tos connect socat TCP-LISTEN:40000,fork TCP:localhost:40001 # socat is used to redirect traffic from 40000 to 40001 ) & exec warp-svc warp-cli enable-always-on +