-
-
Notifications
You must be signed in to change notification settings - Fork 952
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
Add "Run on InfiniEmu" link to pull requests, update actions/upload-artifact #2150
base: main
Are you sure you want to change the base?
Conversation
Build size and comparison to main:
|
Would really like to see this merged, this makes testing PRs much easier! |
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.
Love it!
Is using an open CORS proxy wise? It feels dangerous to trust it with user traffic - if it started acting maliciously (got hacked, owner decided to cash in etc) it could return whatever it wanted to user's browsers |
Maybe not, but the worst that could happen is that they serve either an invalid ZIP file which would fail to load, or they could serve a different firmware file which would just be annoying. |
I'm trying to think if there's another way to load it, could InfiniEmu itself fetch the firmware somehow? |
If you mean fetching from GitHub directly it's not really possible because there's no official way to download artifacts without being logged in or using an API key, both of which aren't really feasible in this case. That's what nightly.link solves, however it unfortunately doesn't allow CORS. |
Hmm, could the InfiniEmu server fetch it and serve the artefact to the user? |
There's no server per se right now, it's hosted on GitHub pages. I've made a slight improvement by not hardcoding the CORS proxy into the URL in the comment and instead letting InfiniEmu handle that so that it's easier to change in the future if needed. |
👍 makes sense |
(Un)fortunately you can't do that because that would mean that you could send any requests on behalf of the logged in user from a different webpage, which is obviously not great. |
Ah, I thought the github cookies for that might be allowed to be samesite, but I guess it makes sense that they're not and there'd have to be a full Oauth flow (which isn't possible on GH pages I guess) |
Using nightly.link and corsproxy.io we can generate a link that, when clicked, will direct users to a build of the latest commit of a pull request running on InfiniEmu.
It's also worth noting that GitHub actions artifacts expire after 90 days.