WireGuard overlay persists remote NAT1TO1 at install, opens WebRTC via ShellCrash trusted CIDRs, and reconfigures Neko after wg-quick restarts. Neko proxy probes Google before proxycheap. Console defaults to multi-channel Pro; docs updated. Co-authored-by: Cursor <cursoragent@cursor.com>
4.5 KiB
4.5 KiB
Deploy hardening notes (x86 / ARM)
Lessons from production deploys on Ubuntu (x86_64 and aarch64) behind Soft Router / WireGuard.
Architecture
Install scripts detect CPU once and reuse labels:
uname -m |
ShellCrash cpucore |
Docker Compose asset |
|---|---|---|
x86_64 / amd64 |
amd64 |
x86_64 |
aarch64 / arm64 |
arm64 |
aarch64 |
armv7* / armhf |
armv7 |
armv7 |
harden_shellcrash_runtime refreshes cpucore on every install so a copied image cannot keep the wrong binary label.
ShellCrash dashboard blocked on WireGuard
Symptom: ShellCrash shows online and has YAML, but http://10.66.66.x:9999/ui/ (or 10.88.0.x) fails from WG peers while localhost works — or browser shows ERR_CONNECTION_REFUSED.
Causes:
- ShellCrash nftables WAN firewall accepts only physical LAN (
HOST_IP) then rejects7890/9999. WireGuard overlays are not in that accept set. - CrashCore never binds
:9999because profile validation fails:- removed top-level
global-client-fingerprint(new mihomo/meta) - missing
Country.mmdb/ GeoIP when GitHub downloads time out
- removed top-level
Fix in tree:
SHELLCRASH_WG_CIDR/SHELLCRASH_TRUSTED_CIDRS(seeconfig/system-stack.env.example; defaults include both10.66.66.0/24and10.88.0.0/24)ensure_shellcrash_proxy_ports_for_dockeralso opens dashboarddb_port- systemd drop-in
shellcrash.service.d/allow-trusted.conf+/usr/local/sbin/shellcrash-allow-trusted.shre-applies after every ShellCrash start shellcrash_patch_runtime_yamlstripsglobal-client-fingerprintand forcesexternal-controller: 0.0.0.0:9999ensure_shellcrash_geo_databasespulls GeoSite/GeoIP/MMDB via jsdelivr when GitHub is unreachableshellcrash.service.d/timeout.confraisesTimeoutStartSec=600(bfstart + geo load exceeds 90s)
Install-time proxy
When the host cannot reach Docker Hub / GitHub / PyPI / Ubuntu archives directly (typical behind GFW with a LAN Clash on Windows):
export LIVE_HTTP_PROXY=http://192.168.21.36:7897
export LIVE_HTTPS_PROXY="$LIVE_HTTP_PROXY"
export LIVE_NO_PROXY=localhost,127.0.0.1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,*.lan,*.local
sudo -E bash ./install.sh --local-only --profile all
# optional: clear LIVE_* afterwards so runtime stays direct
What the installer does when LIVE_HTTP_PROXY is set:
- Exports shell
http(s)_proxyfor curl / apt / pip / git helpers. - Writes
/etc/apt/apt.conf.d/99live-proxysoapt-getkeeps working in child processes. - Writes
/etc/systemd/system/docker.service.d/http-proxy.confand reloads Docker before Neko/image pulls (daemon does not inherit shell proxy). - On Neko
compose uptimeout, re-applies the Docker proxy drop-in and retries once.
Installer downloads for ShellCrash also try with proxy and without (--noproxy / unset env).
WireGuard + Neko
- Overlay address for this fleet is typically
10.66.66.0/24(腾讯云) or legacy10.88.0.0/24. sync_neko_wireguard_remote_access(inscripts/linux/lib/common.shandservice_ctl.sh): when awg*/wgeasyinterface is up, the installer andservice_ctl nekopersistNEKO_ACCESS_MODE=remote,NEKO_WIREGUARD_HOST, andNEKO_WEBRTC_NAT1TO1intoconfig/system-stack.envso restarts do not drift back to the physical LAN IP.ensure_neko_webrtc_ports_for_trusted_cidrs: opens ShellCrash trusted accept rules for overlay CIDRs so Neko HTTP:920xand WebRTC UDP/TCP mux ports work over WireGuard, not only on the physical LAN.live-wireguard-watch.service: after restarting a stalewg-quick@*.service, calls Neko reconfigure so WebRTC candidates stay aligned with the overlay IP.resolve_neko_nat1to1auto-pickswg*/ overlay10.xwhen remote mode is set.- Applying a WG conf via the hub also switches Neko to remote when the overlay address is ready, and re-runs the ShellCrash trusted-CIDR hook.
Neko browser proxy (ShellCrash)
- Default:
ENABLE_NEKO_BROWSER_PROXY=0→ Neko uses ShellCrash mixed port 7890 when direct Google/YouTube fails. - Optional proxycheap listener 7894 is enabled only when egress probe through that port succeeds (
shellcrash_proxy_egress_ready/shellcrash_listener_egress_ok); a listening but dead upstream no longer auto-flips the switch on fresh installs.
Ports to remember
| Service | Default |
|---|---|
| Control plane | 8001 |
| Caddy edge | 80 → 8001 |
| Homepage | 3080 (not 80) |
| ShellCrash UI | 9999 |
| ShellCrash mixed | 7890 |
| WebTTY | 7681 |
| File Browser | 8082 |