From fa6cded1daeaee40c3a405e5b4f8cb5e038be7b3 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Fri, 27 Nov 2026 13:07:05 +0800 Subject: [PATCH] feat(just): let dsh-web listen on tailnet --- Justfile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Justfile b/Justfile index b6317619..cb549577 100644 --- a/Justfile +++ b/Justfile @@ -287,14 +287,19 @@ k3s-test mode="switch": # ================================================= # Start the dsh web UI without opening a browser, proxied via mihomo's mixed port. -# `just dsh-web lan` listens on this host's static IP from vars/networking.nix (plain HTTP). +# `just dsh-web lan` listens on this host's static IP from vars/networking.nix (plain HTTP); +# `just dsh-web tailnet` listens on its Tailscale IPv4 address instead. [group('agents')] dsh-web listen="local": #!/usr/bin/env nu - let host_args = if "{{listen}}" == "lan" { - let ip = (^nix eval --raw --impure --expr $"\(import ./vars/networking.nix { lib = \(builtins.getFlake \(toString ./.\)\).inputs.nixpkgs.lib; }\).hostsAddr.(hostname).ipv4") - [--host $ip] - } else { [] } + let host_args = match "{{listen}}" { + "lan" => { + let ip = (^nix eval --raw --impure --expr $"\(import ./vars/networking.nix { lib = \(builtins.getFlake \(toString ./.\)\).inputs.nixpkgs.lib; }\).hostsAddr.(hostname).ipv4") + [--host $ip] + } + "tailnet" => [--host (^tailscale ip -4 | lines | first)] + _ => [] + } # no_proxy keeps local endpoints out of the proxy; the proxy is here for fake-ip. # dsh's web fetch refuses a DNS answer it does not call public and fake-ip answers # with 198.18.0.0/15, so a proxied hop makes mihomo resolve the origin instead.