-
-
Notifications
You must be signed in to change notification settings - Fork 62
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 other git hosting services #296
Comments
Currently, we use a default template even if @passcod I think this is a security loophole of |
Sorry, I can't see what you mean? Can you demo how we'd visit the wrong repo there's no repository set in the cargo meta? |
Oh I checked the source code of |
I think this can be closed? |
Let me check the source code again. |
I think we might still need some further investigation. The default url template: { repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ archive-format } is designed for github, I'm not sure whether it would work for bitbucket or gitlab. Would have to verify that. |
Oh, that's true, we could definitely switch the default template for other hosting services |
I just created a hello-world project on gitlab and made a release 0.2.0 with the Gitlab supports two sorts of artifacts:
According to gitlab doc, there's a permanent link to release assets as long as there's a But its seems that |
I tried https://gitlab.kitware.com/NobodyXu/hello-world/-/releases/permalink/v0.2.0/downloads/cargo-binstall-x86_64-pc-windows-msvc.zip but doesn't work. Seems like I have to use its API and cannot just use the link title. |
After manually updating the link asset using: curl --request PUT \
--data name="cargo-binstall-x86_64-pc-windows-msvc.zip" \
--data filepath="/binaries/cargo-binstall-x86_64-pc-windows-msvc.zip" \
--header "PRIVATE-TOKEN: *********" \
"https://gitlab.kitware.com/api/v4/projects/9564/releases/v0.2.0/assets/links/160" The permanent asset link finally worked https://gitlab.kitware.com/NobodyXu/hello-world/-/releases/v0.2.0/downloads/binaries/cargo-binstall-x86_64-pc-windows-msvc.zip @passcod I will use the following template for gitlab:
The downsides is that maintainers have to manually specify the Gitlab seems to love exposing functionalities in their apis but not their web UI and Does that look good to you? |
@passcod I just realized the default url template isn't even suitable for github. For github, we have links like: So the template should be:
|
Downloading artifacts with bitbucket is much easier. While BitBucket does not have a release page, it indeeds have a download page. Using the following link, we can download the artifacts I just uploaded: So the template for bitbucket should be:
@passcod Does this LGTY? |
our own template (above) is different from the github default, but the default one should remain the same. it's not uncommon to include the version in the package name, we just don't do it in binstall so that the |
One thought with the gitlab thing is that we can't really tell if something is using gitlab just from the URL. We can make a reasonable guess, but idk if that's good enough. |
bitbucket looks good :) |
That's right. I also realized it is also true for github, it can have enterprise version with custom domain name such as https://github.sydney.edu.au/ . |
Hmm let's make a reasonable guess (for both) and go with the template you proposed, plus an extra section in SUPPORT.md for gitlab support. |
Finally, there's sourceforge, a popular code hosting platform for opensource projects despite its ugly web UI. I think we can use the following template for it:
@passcod Does that look good to you? |
Actually, we can use the hello-world api to discover its hosting services. For github, we use: curl https://api.github.com/zen for github.com and curl https://[hostname]/api/v3/zen for github enterprise server, though it might require access token. For gitlab, we can use the metadata API, but it requires a private token so it might not work. |
Perhaps we should also add a new cmdline option |
@ryankurte What's your thought on this? |
IMO it is possible to support for other git hosting by parsing
Package::repository
, though I think we should straight-up report an error if neitherrepository
norPkgMeta
is specified, since then we cannot find its repository without trusting random people on the internet.The text was updated successfully, but these errors were encountered: