Skip to content

Commit

Permalink
Revert "pass the TUN device instead of creating it in the container, fix
Browse files Browse the repository at this point in the history
 #41."

This reverts commit 06239fc.
  • Loading branch information
cmj2002 committed Dec 18, 2024
1 parent fc0c8c6 commit e80b7f3
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 18 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ services:
image: caomingjun/warp
container_name: warp
restart: always
devices:
- /dev/net/tun:/dev/net/tun
ports:
- "1080:1080"
environment:
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ services:
image: caomingjun/warp
container_name: warp
restart: always
devices:
- /dev/net/tun:/dev/net/tun
ports:
- "1080:1080"
environment:
Expand Down
2 changes: 0 additions & 2 deletions docs/proxy-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ services:
image: caomingjun/warp
container_name: warp
restart: always
devices:
- /dev/net/tun:/dev/net/tun
ports:
- "1080:1080"
environment:
Expand Down
2 changes: 0 additions & 2 deletions docs/warp-connector.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ services:
image: caomingjun/warp
container_name: warp
restart: always
devices:
- /dev/net/tun:/dev/net/tun
ports:
- "1080:1080"
environment:
Expand Down
14 changes: 4 additions & 10 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@
# exit when any command fails
set -e

# check if /dev/net/tun is available
# create a tun device if not exist to ensure compatibility with Podman
if [ ! -e /dev/net/tun ]; then
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
sudo mkdir -p /dev/net
sudo mknod /dev/net/tun c 10 200
sudo chmod 600 /dev/net/tun
fi

# start dbus
Expand Down

0 comments on commit e80b7f3

Please sign in to comment.