File tree Expand file tree Collapse file tree 4 files changed +24
-12
lines changed
Expand file tree Collapse file tree 4 files changed +24
-12
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,7 @@ install "$scratch_dir/tailscale" /usr/local/bin/tailscale
6464install " $scratch_dir /tailscaled" /usr/local/sbin/tailscaled
6565install " $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
6868
6969if ! command -v iptables >& /dev/null; then
7070 if command -v apt-get >& /dev/null; then
Original file line number Diff line number Diff line change @@ -30,28 +30,22 @@ 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
33+ mkdir -p /var/log /var/run/tailscale
3434 touch $TAILSCALED_LOG
3535 > $TAILSCALED_LOG 2>&1 \
36- /usr/local/sbin/tailscaled \
37- --statedir=/workspaces/.tailscale/ \
38- --socket=$TAILSCALED_SOCK \
39- --port=41641 &
36+ /usr/local/sbin/tailscaled &
4037 TAILSCALED_PID=$!
4138elif command -v sudo > /dev/null; then
4239 if [[ ! -c /dev/net/tun ]]; then
4340 sudo --non-interactive mkdir -p /dev/net
4441 sudo --non-interactive mknod /dev/net/tun c 10 200
4542 fi
4643 check_userspace
47- sudo --non-interactive mkdir -p /workspaces/.tailscale /var/log
44+ sudo --non-interactive mkdir -p /var/log /var/run/tailscale
4845 sudo --non-interactive touch $TAILSCALED_LOG
4946 > $TAILSCALED_LOG 2>&1 \
5047 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 &
48+ /usr/local/sbin/tailscaled &
5549 TAILSCALED_PID=$!
5650else
5751 >&2 echo " tailscaled could not start as root."
You can’t perform that action at this time.
0 commit comments