panamax-rs / panamax

Mirror rustup and crates.io repositories, for offline Rust and cargo usage.
Apache License 2.0
427 stars 45 forks source link

No config.json #128

Open hpenne opened 4 months ago

hpenne commented 4 months ago

We have a Panamax mirror at work, but it does not seem to serve up the expected config.json file at the root. I've tried to fetch it with curl, but get nothing. I need this for some automated tools that need to find the API URL through the config.json. We have another Artifactory-based mirror, and that returns the config.json as expected. Any idea what could be wrong?

k3d3 commented 4 months ago

This might be an inconsistency in the mirror. Whereabouts is the config.json supposed to be located - in the root of the git repo, or as part of what HTTP serves? The former I have accounted for, but if the latter, I might not actually know about its existence.

hpenne commented 4 months ago

It is supposed to be located at the root of the index, when downloading using http/https, as described here: https://doc.rust-lang.org/cargo/reference/registry-index.html

Basically I expect a similar type of reply from Panamax as I get from crates.io when I do:

hpenne$ curl https://index.crates.io/config.json { "dl": "https://static.crates.io/crates", "api": "https://crates.io" }

I'm scripting something that needs to resolve the URL of the API, and that is specified by the contents of this json file.

Best regards, Helge Penne

On Thu, 21 Mar 2024 at 18:09, Keith @.***> wrote:

This might be an inconsistency in the mirror. Whereabouts is the config.json supposed to be located - in the root of the git repo, or as part of what HTTP serves? The former I have accounted for, but if the latter, I might not actually know about its existence.

— Reply to this email directly, view it on GitHub https://github.com/panamax-rs/panamax/issues/128#issuecomment-2013064261, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECO7YUOMCQ25YTGBJNI3NLYZMH5TAVCNFSM6AAAAABE7KZZLCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJTGA3DIMRWGE . You are receiving this because you authored the thread.Message ID: @.***>

k3d3 commented 1 month ago

So I tested this out, and it seems to work as expected:

image

Are you looking for config.json at this path?

dacechavez commented 1 month ago

I did something similar to #120 on my local network.

Out of the box, without configuring cargo for panamax, cargo fails to fetch https://index.crates.io/config.json

It seems to work with "index" in the url but thats not what cargo is fetching by default.

I think that if panamax returns config.json in the url above, then no client configuration is required, as in no need to edit .cargo/config.