-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-GitHub Updates #1535
Merged
Merged
Non-GitHub Updates #1535
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Use generic `Stream`s where possible instead of `FileStream`s. - Split stream provider logic from `IFileUploadTicket`. - File upload tickets implement `IAsyncDisposable` instead of `IDisposable`
- Move SetError up to IFileUploadTicket. - Move from Transfer to IO namespace.
- `DelayedFileDownloader` changed into `RequestFileStreamProvider` which provides a direct network stream. - `CachedResponseStream` now only caches the `HttpContent` as opposed to the `HttpResponseMessage`. - `IFileDownloader` now synchronously returns `IFileStreamProvider`s. - `FileDownloader` now returns `RequestFileStreamProviders`. - Added `ISeekableFileStreamProvider`. - BufferedFileStreamProvider now implements `ISeekableFileStreamProvider`.
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.
- 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.
This stops a class coupling warning.
- Move classes to `Http` namespace. - Give it a unique package version. - Comment to make me not rage update Nuget libs to .NET 6.
- New `ServerUpdateRequest` field `uploadZip`. - New Administration permission for this. - `ServerUpdateResponse` will now contain a transfer ticket if set. - Live tests. This is super easy after the work done in 09208ad
f469f59
to
bf170a3
Compare
6a3262b
to
cc6833a
Compare
Codecov Report
@@ Coverage Diff @@
## dev #1535 +/- ##
==========================================
+ Coverage 72.52% 72.55% +0.03%
==========================================
Files 357 364 +7
Lines 21918 22346 +428
==========================================
+ Hits 15896 16214 +318
- Misses 6022 6132 +110 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #1495
🆑
Server update packages can now be provided through the API. Note that if an update package that doesn't match the tgstation-server update protocol is uploaded or if the actual uploaded version doesn't match the version specified in the POST API request, undefined behavior will occur.
Fixed an error that occurred if a static file upload ticket was abandoned.
Fixed potential memory leak in the non-GitHub OAuth login procedures.
Minor performance improvement in the non-GitHub OAuth login procedures.
Fixed double read occurring when downloading log files through the API.
Swarm distributed update downloads are now only performed on the initiating server. Other servers then download the update package from the initiator.
Fixed several edge cases in swarm distributed update process.
/:cl:
🆑 HTTP API
Added Administration right
128
for uploading custom server update packages.POST
/Administration
now accepts a booleanuploadZip
field. If set, and the request succeeds, afileTicket
will be generated in the response. This ticket can be used to upload a.zip
server update package using the/Transfer
route./:cl:
API/Client releases pending #1464