Giter Club home page Giter Club logo

Comments (6)

gitartpiano avatar gitartpiano commented on May 18, 2024

This issue #44 offers some solution, but I don't want
Index hosted on private GitLab repo, I prefer index to be hosted by Alexandrie itself.

from alexandrie.

Hirevo avatar Hirevo commented on May 18, 2024

Hello !

I'm sorry about the struggle you encountered.
I tried to write sufficient amounts of docs to make the installation process as clear and painless as I could, but, as someone who always knew the project, it can be hard to properly put myself in the shoes of newcomers and not missing anything (because of a subtle assumption we happened to inadvertently make).
This kind of feedback is super valuable to improve these docs against these mistakes, so thank you for filing the issue.

I'll be pushing a PR to try to address this and explain the placeholders in more details.

In the meantime, to come back to your specific issue, the main question can be:
Is your index accessible through HTTP/HTTPS or SSH ?

The HTTP/HTTPS case is the one that should just work by following the README.
The SSH case can require the solution found in #44, which isn't really specific to GitLab, it should apply to any private index located behind an SSH-authenticated endpoint.
(But we have yet to document that part in the README and the book, that is definitely on me, sorry again about that)
As an example, we're using the SSH method in exactly this way in our automated end-to-end testing setup, you can try to take a look at how it configures things here and see if it matches your situation:
https://github.com/Hirevo/alexandrie/blob/master/e2e/images/runner/runner.sh#L72

from alexandrie.

gitartpiano avatar gitartpiano commented on May 18, 2024

Is your index accessible through HTTP/HTTPS or SSH ?

Your question assumes that I already have an index, but as a newbie I don't.

But the tests (you pointed out with the link) contain valuable information, especially this file will help me set one up:
https://github.com/Hirevo/alexandrie/blob/master/e2e/images/index/init-repo.sh

What I was asking in bold, is all here in the tests now I think.

from alexandrie.

gitartpiano avatar gitartpiano commented on May 18, 2024

The install/configure procedure I followed is documented as a script.
Before running it a git repo needs to be created for the crate-index. (I used gitlab).
The script will prompt for the URL of this repo, or optionally the URL can be specified as the argument for the script.

#!/bin/bash

alex_dir=~/alexandrie
crate_index_git_url=$1

while ! git ls-remote -h $crate_index_git_url
do
  read -p 'crate_index_git_url: ' crate_index_git_url
done

if ! curl --version
then
  sudo apt update
  sudo apt install -y curl
fi

if ! ~/.cargo/bin/rustup --version
then
  curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path
else
  rustup update
fi

if [ -d "$alex_dir" ]
then
  cd "$alex_dir"
  git pull
else
  git clone https://github.com/Hirevo/alexandrie.git "$alex_dir"
  cd "$alex_dir"
fi

cargo build

mkdir -p crate-storage

if [ -d crate-index ]
then
  cd crate-index
  git pull
else
  git clone $crate_index_git_url crate-index
  cd crate-index
fi

if [ ! -f config.json ]
then
  cat >config.json <<EOF
{
    "dl": "http://$(hostname):3000/api/v1/crates/{crate}/{version}/download",
    "api": "http://$(hostname):3000",
    "allowed-registries": ["https://github.com/rust-lang/crates.io-index"]
}
EOF
  git add config.json
  git commit -m "add config.json"
  git push
fi

The myhello project's .cargo/config file:

[registries.my-registry]
index = "ssh://[email protected]/gitusername/crate-index.git"

After logging in publish worked

cargo login --registry my-registry
cargo publish --registry my-registry

from alexandrie.

Hirevo avatar Hirevo commented on May 18, 2024

(Sorry for the delayed response)

Happy to hear that you were able to make progress, I've opened #70 to improve documentation around setting up the crate index, which, I have to agree, was notably overlooked.

As part of that PR, I have also integrated a slightly modified version of your script in the user guide, with a link to it from the project's README.
(link to the modified script in docs)
Such a script can indeed be useful and can make the process of getting started faster for newcomers.
Thank you very much for writing and sharing the script, it is a valuable thing to have available.

This issue is set to close automatically once #70 gets merged.
If you consider that the issue remains unaddressed by #70, feel free to say so (or re-open the issue if it got closed in-between).

from alexandrie.

gitartpiano avatar gitartpiano commented on May 18, 2024

I have looked at the documentation updates, and agree to close this.

from alexandrie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.