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
25
25
You'll only need to run ` tailscale up ` once per Codespace.
26
26
The Tailscale state will be saved between rebuilds.
27
27
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
+
28
39
## Development
29
40
30
41
A convenient way to develop this feature is to use codespaces, as they start by
Original file line number Diff line number Diff line change 13
13
"default" : " latest" ,
14
14
"description" : " Version of Tailscale to download"
15
15
}
16
- }
16
+ },
17
+ "mounts" : [
18
+ {
19
+ "source" : " tailscale-${devcontainerId}" ,
20
+ "target" : " /var/lib/tailscale" ,
21
+ "type" : " volume"
22
+ }
23
+ ]
17
24
}
Original file line number Diff line number Diff line change @@ -64,7 +64,8 @@ install -D "$scratch_dir/tailscale" /usr/local/bin/tailscale
64
64
install -D " $scratch_dir /tailscaled" /usr/local/sbin/tailscaled
65
65
install -D " $script_dir /tailscaled-entrypoint.sh" /usr/local/sbin/tailscaled-entrypoint
66
66
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
68
69
69
70
if ! command -v iptables >& /dev/null; then
70
71
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
30
30
mknod /dev/net/tun c 10 200
31
31
fi
32
32
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 &
40
34
TAILSCALED_PID=$!
41
35
elif command -v sudo > /dev/null; then
42
36
if [[ ! -c /dev/net/tun ]]; then
43
37
sudo --non-interactive mkdir -p /dev/net
44
38
sudo --non-interactive mknod /dev/net/tun c 10 200
45
39
fi
46
40
check_userspace
47
- sudo --non-interactive mkdir -p /workspaces/.tailscale /var/log
48
- sudo --non-interactive touch $TAILSCALED_LOG
49
41
> $TAILSCALED_LOG 2>&1 \
50
42
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 &
55
44
TAILSCALED_PID=$!
56
45
else
57
46
>&2 echo " tailscaled could not start as root."
You can’t perform that action at this time.
0 commit comments