moriturus / ktra

Your Little Cargo Registry
https://book.ktra.dev
Apache License 2.0
404 stars 37 forks source link

Changing dl /API url #19

Closed tomus85 closed 3 years ago

tomus85 commented 3 years ago

In the example from Ktra book under bullet point 3 Create config.json file then commit and push it to remote repository. I did the following:

cd YOUR_INDEX
echo '{"dl":"http://localhost:8000/dl","api":"http://localhost:8000"}' > config.json
git add config.json
git commit -am "initial commit"
git push origin main

This all works on the same machine as I am running Ktra. However, I want to access my private cargo from another machine. So I edited the config.json file:

# from
{"dl":"http://localhost:8000/dl","api":"http://localhost:8000"}
# to
{"dl":"http://192.168.1.100:8000/dl","api":"http://192.168.1.100:8000"}

Ktra is currently on 192.168.1.100. When I do cargo build on another machine (I have set up my registry in .cargo/config.json) I get an error message:

failed to get 200 response from `http://192.168.1.100:8000/dl/dns_qprb/0.2.6/download`, got 404

How do i fix this? How I get other machines to pull private cargo from my own repo

Thanks

tomus85 commented 3 years ago

If it help, I've got a private GitLab server on 192.168.1.10, so all the cargo repos are on here. Ktra server is on 192.168.1.100

tomus85 commented 3 years ago

Solved, had to re-publish my projects to Ktra again.

Tip: if you are still having issues pulling during cargo build then try deleting cargo.lock file. Might help if you remove the registry directory in ~/.cargo/