Commit Graph
17 Commits
Author SHA1 Message Date
Jordan Dominion 9e8bdde30c Remove HttpClient abstractions
Now implement mocked `HttpMessageHandler`s as recommended: https://stackoverflow.com/a/36427274/3976486
2025-07-27 15:34:33 -04:00
Jordan Dominion 4bdc799950 Fix swarm protocol unit tests 2024-09-13 10:08:25 -04:00
Jordan Dominion 10728657df Move custom controller results to new namespace 2023-10-29 16:22:59 -04:00
Jordan Dominion 8166cd3629 ValueTask conversion for controllers 2023-10-07 15:53:35 -04:00
Dominion 223c017eb5 File transfer code cleanups 2023-06-11 14:34:48 -04:00
Dominion e596110018 Clean up Tgstation.Server.Common
- Move classes to `Http` namespace.
- Give it a unique package version.
- Comment to make me not rage update Nuget libs to .NET 6.
2023-06-10 17:04:04 -04:00
Dominion 41c33684f6 Removes an unused using 2023-06-10 17:04:03 -04:00
Dominion 716fb0c5fd Extract some more constants into SwarmConstants
This stops a class coupling warning.
2023-06-10 17:04:03 -04:00
Dominion 6ae07f404a Massive readibility improvement for swarm updates
- Extract dubiously guarded `SwarmService` variables into `volatile` handler class with `Interlocked` writes.
- `SwarmService.Abort` can no longer be cancelled, but it short circuits more easily.
- Improved `SwarmRpcMapper`'s handling of `CancellationToken`s.
2023-06-10 17:03:59 -04:00
Dominion 09208ade36 Swarm updates single source downloads
When running a distributed swarm server update, only the initiator server will download the update package directly from GitHub. It will then make the package available to the other nodes via a `SwarmController` hosted variant of the `FileTransferService` which they will use to retrieve their copies of the package.

Because of this, it's possible for the update package to be accessed via the regular `TransferController` duing this process. This is acceptable for three reasons:

- We use crytographically secure strings for the transfer service tickets
- If a malicious user steals one or more of the Swarm's update package tickets, the update will simply be aborted.
- An update package is not considered secure data what with this being OSS.
2023-06-10 16:13:29 -04:00
Dominion 22c3f591fe Allow specifying HttpCompletionOption in IHttpClient 2023-06-10 11:18:21 -04:00
Dominion 3768da7bea Fixed rare race condition in swarm protocol tests 2023-04-28 12:37:43 -04:00
Dominion d0ac8f5000 Got rid of that useless swarm registration abstraction AND fixed race condition in SwarmRpcMapper calls 2023-04-22 17:16:34 -04:00
Dominion b797451e2b Add better error handling to SwarmRpcMapper 2023-04-22 10:39:34 -04:00
Dominion 079ab20752 Swarm test framework cleanup 2023-04-22 10:05:53 -04:00
Dominion b83f382f45 Tested swarm controller and fixed some edge cases
- No longer registers for restart unnecessarily
- Fixed infinite wait when committing update
- Fixed unregistering without a registration
- Abort updates if the controller health check fails
2023-04-22 01:02:22 -04:00
Dominion 1c219ebadd Framework for testing Swarm protocol 2023-04-21 15:11:44 -04:00