initial commit
This commit is contained in:
8
root/etc/hotplug.d/iface/40-tailscale
Executable file
8
root/etc/hotplug.d/iface/40-tailscale
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
tailscale_enable="$(uci get tailscale.settings.enabled)"
|
||||
|
||||
[ "$ACTION" = ifup -o "$ACTION" = ifupdate ] || exit 0
|
||||
[ "$ACTION" = ifupdate -a -z "$IFUPDATE_ADDRESSES" -a -z "$IFUPDATE_DATA" ] && exit 0
|
||||
[ "$tailscale_enable" -eq "1" ] || exit 0
|
||||
/etc/init.d/tailscale start > /tmp/tailscale.log 2>&1 &
|
||||
9
root/etc/uci-defaults/40_luci-tailscale
Executable file
9
root/etc/uci-defaults/40_luci-tailscale
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@tailscale[-1]
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
29
root/usr/share/luci/menu.d/luci-app-tailscale.json
Normal file
29
root/usr/share/luci/menu.d/luci-app-tailscale.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"admin/services/tailscale": {
|
||||
"title": "Tailscale",
|
||||
"order": 90,
|
||||
"action": {
|
||||
"type": "firstchild"
|
||||
},
|
||||
"depends": {
|
||||
"acl": [ "luci-app-tailscale" ],
|
||||
"uci": { "tailscale": true }
|
||||
}
|
||||
},
|
||||
"admin/services/tailscale/base": {
|
||||
"title": "Base settings",
|
||||
"order": 10,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "tailscale/base"
|
||||
}
|
||||
},
|
||||
"admin/services/tailscale/interface": {
|
||||
"title": "Interface info",
|
||||
"order": 20,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "tailscale/interface"
|
||||
}
|
||||
}
|
||||
}
|
||||
17
root/usr/share/rpcd/acl.d/luci-app-tailscale.json
Normal file
17
root/usr/share/rpcd/acl.d/luci-app-tailscale.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"luci-app-tailscale": {
|
||||
"description": "Grant access to Tailscale configuration",
|
||||
"read": {
|
||||
"file": {
|
||||
"/sbin/ifconfig": [ "exec" ]
|
||||
},
|
||||
"ubus": {
|
||||
"service": [ "list" ]
|
||||
},
|
||||
"uci": [ "tailscale" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "tailscale" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user