Comments (4)
You are right. It's enough to move the download URL alone. I just implemented it and it seems to work fine. The change will be in the next Kellnr release. No breaking changes needed :)
from kellnr.
Good catch!
I'll separate the index and the registry api with a unique base path. Crates.io does it with different sub-domains but that solution won't work well for kellnr.
For the "download", "yank" and "unyank" on the private API: That is not an issue as they are "GET", "DELETE" and "PUT" and as such are different enough.
from kellnr.
As the crate registry protocol (https://doc.rust-lang.org/cargo/reference/registry-web-api.html) expects the registry API to be under /api/v1/crates/X
I'll move the index to it's own path. This behavior is more similar to the behavior of crates.io where the index is on another sub-domain.
Unfortunately, this is a breaking change, as all clients of Kellnr now have to update their cargo.toml
files to point to the new index. But I think a more clean solution is worth the break.
TODO: Document the change for a future kellnr 6.0.0 release.
from kellnr.
Hmmm, I would not really be fond of a breaking change in the API. At work we just migrated from the git index to the sparse index hosted with Kellnr also needing a URL change. Getting a breaking change like this would not be happily received in the organization.
Looking at the registry documentation I also get the idea that it usage of "https://crates.io/api/v1/crates" for the downloads is not what you are required to used. And setting the conig.json
dl
value to 'my-kellnr.com/api/v1/cratesio-registry/' or something completely different is valid.
Looking at the documentation there are 3 API's:
Index That specifies that at the configured URL in cargo there should be a config.json at the root and how the URL is build to get the index information for a crate. This is the only URL that needs to remain stable for backwards compatibility. But cargo has no requirements about the base URL. So the /api/v1/cratesio/
that kellnr uses now is fine (as long as its not classing with the web API). But also not required, hosting it at /cratesio
is also fine.
WEB API The config.json 'api' field contains the base URL and the API specifies the extensions to it like: /api/v1/crates/new
. This API is optional, and mainly used for publishing crates.
The download API. The config.json
dl
field contains the URL that is extended with /{crate}/{version}/download
. If the dl
field contains variables like {crate}
the field is used as is.
So to mine understanding, we only need to keep the index URL's stable. All the other URLS can be moved around provided the config.json
is filled with the correct values. My suggestion would be to change the config.json
to for the crates.io proxy:
{
"dl":"https://my-kellnr.nl:443/cratesio/download/",
"auth-required":false
}
Note I removed the api field, as the crates.io proxy function does not support publishing. And currently it points to the local kellnr registry and that seams wrong. (Field is optional according to the documentation). If there are calls that need to be implemented host it under: "api":"https://my-kellnr.nl:443/cratesio/"
.
And the one for the crates index:
{
"dl":"https://my-kellnr.nl:443/crates/download/",
"api":"https://my-kellnr.nl:443/crates/",
"auth-required":true
}
from kellnr.
Related Issues (20)
- Doc build in kellnr docker container fails with: Invalid cross-device link HOT 3
- Kellnr's docker image doubled in size in last release HOT 4
- Public crates registry HOT 3
- Feature Improvement Request: Simplifying Documentation URL Format and Adding Latest Version Link HOT 4
- Cannot upload doc HOT 7
- ldap support HOT 2
- Disabaling the crates.io proxy will not disable the sparse index HOT 1
- private registry hosting cratesio setup HOT 3
- Kellnr calculates wrong checksum [CRITICAL] HOT 19
- Doc build in kellnr docker container fails with: Invalid cross-device link HOT 5
- Can't autogenerate docs when using docker image HOT 2
- Failed to verify checksum HOT 4
- Timezone problem within webui HOT 3
- Click re-build / build button (for document) in web UI return 401 Unauthorized HOT 2
- example config should contains `credential-provider` setting HOT 2
- doc build error HOT 7
- Align version between workspace version and docker image tags
- glibc version HOT 5
- Doc build stucks kellnr HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kellnr.