diff --git a/Dockerfile b/Dockerfile index de419a0..8398b91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,6 +47,7 @@ RUN mkdir -p /home/warp/.local/share/warp && \ ENV GOST_ARGS="-L :1080" ENV WARP_SLEEP=2 +ENV REGISTER_WHEN_MDM_EXISTS= HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=3 \ CMD /healthcheck/index.sh diff --git a/docker-compose.yml b/docker-compose.yml index c7d1772..deccd54 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,7 @@ services: - '1080:1080' environment: - WARP_SLEEP=2 + # - REGISTER_WHEN_MDM_EXISTS=true # - WARP_LICENSE_KEY= # optional cap_add: - NET_ADMIN @@ -16,4 +17,5 @@ services: - net.ipv6.conf.all.disable_ipv6=0 - net.ipv4.conf.all.src_valid_mark=1 volumes: - - ./data:/var/lib/cloudflare-warp \ No newline at end of file + - ./data:/var/lib/cloudflare-warp + # - ./enable_masque_mdm.xml:/var/lib/cloudflare-warp/mdm.xml diff --git a/enable_masque_mdm.xml b/enable_masque_mdm.xml new file mode 100644 index 0000000..290e0f1 --- /dev/null +++ b/enable_masque_mdm.xml @@ -0,0 +1,4 @@ + + warp_tunnel_protocol + masque + \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 3355c63..4918be3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -23,8 +23,8 @@ sleep "$WARP_SLEEP" # if /var/lib/cloudflare-warp/reg.json not exists, setup new warp client if [ ! -f /var/lib/cloudflare-warp/reg.json ]; then - # if /var/lib/cloudflare-warp/mdm.xml not exists, register the warp client - if [ ! -f /var/lib/cloudflare-warp/mdm.xml ]; then + # if /var/lib/cloudflare-warp/mdm.xml not exists or REGISTER_WHEN_MDM_EXISTS not empty, register the warp client + if [ ! -f /var/lib/cloudflare-warp/mdm.xml ] || [ -n "$REGISTER_WHEN_MDM_EXISTS" ]; then warp-cli registration new && echo "Warp client registered!" # if a license key is provided, register the license if [ -n "$WARP_LICENSE_KEY" ]; then