Skip to content

Commit

Permalink
add legacy tun support for docker swarm
Browse files Browse the repository at this point in the history
  • Loading branch information
cmj2002 committed Dec 9, 2024
1 parent 1dab548 commit 1f75fb6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ set -e

# check if /dev/net/tun is available
if [ ! -e /dev/net/tun ]; then
echo "CRITIC: /dev/net/tun not pass, check https://github.com/cmj2002/warp-docker/blob/main/docs/tun-not-permitted.md for more information"
exit 1
if [ -n "$LEGACY_TUN_SUPPORT" ]; then
echo "WARN: LEGACY_TUN_SUPPORT enabled, creating /dev/net/tun..."
sudo mkdir -p /dev/net
sudo mknod /dev/net/tun c 10 200
sudo chmod 600 /dev/net/tun
else
echo "CRITIC: /dev/net/tun not pass, check https://github.com/cmj2002/warp-docker/blob/main/docs/tun-not-permitted.md for more information"
exit 1
fi
fi

# start dbus
Expand Down

0 comments on commit 1f75fb6

Please sign in to comment.