Enhance run-aspire.cmd to support Tailscale integration for remote access. The script now checks for Tailscale availability and connection status, providing warnings if not found or connected. Updated documentation in AGENTS.md and README.md to reflect changes, including instructions for using Tailscale with the Vite client. Fixed Vite configuration to pin the client port to 5173 and support HMR over Tailscale. Adjusted AppHost.cs to ensure proper endpoint targeting for Tailscale.
ci / server (push) Failing after 3m45s
ci / client (push) Successful in 17s

This commit is contained in:
Leonid Pershin
2026-08-20 10:02:42 +03:00
parent 51b4c22b69
commit cb869e4977
5 changed files with 68 additions and 6 deletions
+21 -2
View File
@@ -36,8 +36,27 @@ and Node are on PATH first and passes any arguments through
`run-aspire.cmd --rebuild` forces a build.
The Aspire dashboard opens with two resources: `server` (ASP.NET Core) and `client` (Vite dev
server). Aspire assigns the client a random port on every run, so take its URL from the dashboard
rather than guessing.
server on port **5173**).
## Share with friends on Tailscale
For a dev session over your tailnet, expose only the Vite client — not the game server (5180),
Aspire dashboard (15180), or SwarmUI.
`run-aspire.cmd` runs `tailscale serve --bg 5173` before the AppHost when `tailscale` is on
PATH and connected. If Tailscale is missing, offline, or `serve` fails, the script prints a
warning and continues with local access only (`http://localhost:5173`). Pass `--no-tailscale`
to skip Serve entirely. You can also run the command yourself once per boot if you start with
`dotnet run --project src/HSchool.AppHost` instead.
Friends on the same tailnet open `https://<your-machine>.<tailnet>.ts.net`. The page, REST API
and game WebSocket all go through Vites proxy on one origin; Kestrel stays on localhost.
Change `HSchool:AlphaPassword` from the repo default before sharing the link. Optional: set
`HSCHOOL_TAILSCALE_SERVE=1` in the client process environment if you want Vite HMR through Serve
(`wss` on port 443); gameplay works without it.
Do **not** add port 5180 or the Aspire dashboard to `tailscale serve`.
## What you can do