Refactor run-aspire scripts for improved cross-platform support. Replace run-aspire.cmd with run-aspire.ps1 for Windows and add run-aspire.sh for Ubuntu. Update documentation to reflect these changes and ensure synchronization between build rules across scripts. Enhance Tailscale integration and clarify usage instructions.
ci / server (push) Failing after 3m38s
ci / client (push) Successful in 18s

This commit is contained in:
Leonid Pershin
2026-08-20 10:48:19 +03:00
parent f45347b335
commit d3396b5b8f
8 changed files with 304 additions and 144 deletions
+10 -9
View File
@@ -30,10 +30,10 @@ school screen with a running game clock. The school itself is still empty.
dotnet run --project src/HSchool.AppHost
```
On Windows `run-aspire.cmd` does the same and can be double-clicked; it checks that the .NET SDK
and Node are on PATH first and passes any arguments through
(`run-aspire.cmd --launch-profile http`). A second launch with no C# changes skips MSBuild;
`run-aspire.cmd --rebuild` forces a build.
On Windows `run-aspire.ps1` does the same (`run-aspire.cmd` forwards to it and can be
double-clicked). On Ubuntu `./run-aspire.sh`. Both check that the .NET SDK and Node are on
PATH first and pass any arguments through (`--launch-profile http`). A second launch with no
C# changes skips MSBuild; `--rebuild` forces a build.
The Aspire dashboard opens with two resources: `server` (ASP.NET Core) and `client` (Vite dev
server on port **5173**).
@@ -43,11 +43,12 @@ server on port **5173**).
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.
`run-aspire.ps1` / `run-aspire.sh` run `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`). When Serve is up, it
prints the HTTPS client URL next to the local one; the Aspire dashboard stays on localhost.
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.