File tree Expand file tree Collapse file tree 4 files changed +23
-15
lines changed
Expand file tree Collapse file tree 4 files changed +23
-15
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,17 @@ sudo tailscale up --accept-routes
2525You'll only need to run ` tailscale up ` once per Codespace.
2626The Tailscale state will be saved between rebuilds.
2727
28+ ## Details
29+
30+ - A mount is added called ` tailscale-${devcontainerId} ` mapped to
31+ ` /var/lib/tailscale ` to persist taislcaled state across devcontainer rebuilds,
32+ so a single devcontainer will remain logged in for the devcontainer lifetime.
33+ - The feature requires ` CAP_NET_ADMIN ` in order to configure certain network
34+ properties for kernel mode tailscale.
35+ - The feature requires kernel tun support in the runtime and ` CAP_MKNOD ` so that
36+ it can create a tun device node if needed.
37+ - ` CAP_NET_RAW ` enables the feature to send ICMP.
38+
2839## Development
2940
3041A convenient way to develop this feature is to use codespaces, as they start by
Original file line number Diff line number Diff line change 1313 "default" : " latest" ,
1414 "description" : " Version of Tailscale to download"
1515 }
16- }
16+ },
17+ "mounts" : [
18+ {
19+ "source" : " tailscale-${devcontainerId}" ,
20+ "target" : " /var/lib/tailscale" ,
21+ "type" : " volume"
22+ }
23+ ]
1724}
Original file line number Diff line number Diff line change @@ -64,7 +64,8 @@ install -D "$scratch_dir/tailscale" /usr/local/bin/tailscale
6464install -D " $scratch_dir /tailscaled" /usr/local/sbin/tailscaled
6565install -D " $script_dir /tailscaled-entrypoint.sh" /usr/local/sbin/tailscaled-entrypoint
6666
67- mkdir -p /var/lib/tailscale /var/run/tailscale
67+ mkdir -p /var/lib/tailscale /var/run/tailscale /var/log
68+ touch /var/log/tailscaled.log
6869
6970if ! command -v iptables >& /dev/null; then
7071 if command -v apt-get >& /dev/null; then
Original file line number Diff line number Diff line change @@ -30,28 +30,17 @@ if [[ "$(id -u)" -eq 0 ]]; then
3030 mknod /dev/net/tun c 10 200
3131 fi
3232 check_userspace
33- mkdir -p /workspaces/.tailscale /var/log
34- touch $TAILSCALED_LOG
35- > $TAILSCALED_LOG 2>&1 \
36- /usr/local/sbin/tailscaled \
37- --statedir=/workspaces/.tailscale/ \
38- --socket=$TAILSCALED_SOCK \
39- --port=41641 &
33+ > $TAILSCALED_LOG 2>&1 /usr/local/sbin/tailscaled &
4034 TAILSCALED_PID=$!
4135elif command -v sudo > /dev/null; then
4236 if [[ ! -c /dev/net/tun ]]; then
4337 sudo --non-interactive mkdir -p /dev/net
4438 sudo --non-interactive mknod /dev/net/tun c 10 200
4539 fi
4640 check_userspace
47- sudo --non-interactive mkdir -p /workspaces/.tailscale /var/log
48- sudo --non-interactive touch $TAILSCALED_LOG
4941 > $TAILSCALED_LOG 2>&1 \
5042 sudo --non-interactive " TS_DEBUG_FIREWALL_MODE=$TS_DEBUG_FIREWALL_MODE " \
51- /usr/local/sbin/tailscaled \
52- --statedir=/workspaces/.tailscale/ \
53- --socket=$TAILSCALED_SOCK \
54- --port=41641 &
43+ /usr/local/sbin/tailscaled &
5544 TAILSCALED_PID=$!
5645else
5746 >&2 echo " tailscaled could not start as root."
You can’t perform that action at this time.
0 commit comments