Skip to content

Commit

Permalink
support MASQUE, resolve #29
Browse files Browse the repository at this point in the history
  • Loading branch information
cmj2002 committed Sep 23, 2024
1 parent 7c0a670 commit bea3142
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ services:
- '1080:1080'
environment:
- WARP_SLEEP=2
# - REGISTER_WHEN_MDM_EXISTS=true
# - WARP_LICENSE_KEY= # optional
cap_add:
- NET_ADMIN
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
- net.ipv4.conf.all.src_valid_mark=1
volumes:
- ./data:/var/lib/cloudflare-warp
- ./data:/var/lib/cloudflare-warp
# - ./enable_masque_mdm.xml:/var/lib/cloudflare-warp/mdm.xml
4 changes: 4 additions & 0 deletions enable_masque_mdm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<dict>
<key>warp_tunnel_protocol</key>
<string>masque</string>
</dict>
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bea3142

Please sign in to comment.