-
Notifications
You must be signed in to change notification settings - Fork 187
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
Support alternative Thunderstore CDN #1130
Conversation
Known issues:
Related TS PR: thunderstore-io/Thunderstore#960 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than a boolean toggle state, are you able to structure this so it has N potential options, and the exact one which should be used is passed to the code which needs to consume it?
846b7d3
to
21f8c72
Compare
Made it so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The startup time blocking is a real concern, but in general this looks good to me.
Pre-approving
The implementation is "backported" from Thunderstore Mod Manager since it's now needed in r2mm too. Refs TS-2003
Refs TS-2003
A class containing static methods intended to provide support for multiple Thunderstore CDNs: - Check connection to CDNs and remember which one works - Provide a method for replacing the CDN host from URLs. This can be used when the mod manager uses the URL directly. - Provide a method for augmenting an URL with a query parameter denoting the preferred CDN. This can be used when download happens via a redirect from Thunderstore API, although it requires that the API endpoint has been set up to deal with the query parameter. Refs TS-2003
This is required so that also the UtilityMixin can show the error modal in the future. Refs TS-2003
A list of predefined CDNs are tested, and the first one that is reached will be stored internally by CdnProvider as the preferred one. Other parts of the code that deal with CDNs can use the static helper methods provided by the class. If no CDN can be reached, an error modal is shown to the user about the issue. Hopefully the provided suggestion will help some users. Refs TS-2003
Since the icon URLs for non-installed packages are read from the PackageVersion metadata and downloaded by the browser, brute force replacement of the domain is required. Refs TS-2003
Since the actual download URL is returned by the Thunderstore API as a redirect, signal the API with a query parameter that an alternative CDN is preferred. Refs TS-2003
Since the actual download URL is returned by the Thunderstore API as a redirect, signal the API with a query parameter that an alternative CDN is preferred. Refs TS-2003
21f8c72
to
0555b38
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
No description provided.