mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-12-01 02:13:58 +01:00
feat(just): add a LAN listen mode to dsh-web (#539)
Assisted-by: DeepSeek Harness (claude-opus-5-5)
This commit is contained in:
1 parent
1988392493
commit
4b0db015d3
1 file changed
+7
-2
@@ -287,9 +287,14 @@ 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).
|
||||
[group('agents')]
|
||||
dsh-web:
|
||||
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 { [] }
|
||||
# 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.
|
||||
@@ -302,7 +307,7 @@ dsh-web:
|
||||
HTTP_PROXY: "http://127.0.0.1:7897"
|
||||
no_proxy: "localhost,127.0.0.1,::1,[::1],192.168.5.100,192.168.5.101,192.168.5.178,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
|
||||
NO_PROXY: "localhost,127.0.0.1,::1,[::1],192.168.5.100,192.168.5.101,192.168.5.178,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
|
||||
} { ^dsh --profile web --no-open }
|
||||
} { ^dsh --profile web --no-open ...$host_args }
|
||||
|
||||
# Render the mihomo config from this repo and validate it with the live core.
|
||||
[linux]
|
||||
|
||||
Reference in new issue
Block a user