Giter Site home page Giter Site logo

hutchison-technologies / alexandrie Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hirevo/alexandrie

0.0 1.0 0.0 694 KB

An alternative crate registry, implemented in Rust.

Home Page: https://crates.polomack.eu

License: Apache License 2.0

Rust 64.44% CSS 0.37% HTML 29.55% TSQL 3.69% JavaScript 1.95%

alexandrie's Introduction

Alexandrie

Modular alternative crate registry for Rust

About

This is an alternative crate registry for use with Cargo, written in Rust.

This repository implements the Cargo APIs and interacts with a crate index as specified in the Cargo's Alternative Registries RFC.
This allows to have a private registry to host crates that are specific to what your doing and not suitable for publication on crates.io while maintaining the same build experience as with crates from crates.io.

Goals

  • Offer customizable crate storage strategies (local on-disk, S3, Git Repo, etc...).
  • Offer multiple backing database options (MySQL, PostgreSQL or SQLite).
  • An optional integrated (server-side rendered) front-end.

Current state

  • The core Cargo APIs are all functional.
  • The optional front-end is very usable, although still in active development.

Things yet to do

  • Complete the front-end: in-progress
  • Keywords: done
  • Categories: done
  • Crate (un)yanking: done
  • User management: done
  • Crate version tracking in DB (download counts per version, etc...): planned
  • Ability to re-render READMEs (to migrate themes): planned
  • Search by keywords or categories: planned
  • More Store implementors: planned
  • More Indexer implementors: planned

How to build

Alexandrie is built using [Tide][Tide] and offers multiple options to be used as its database.
To build, you can run cargo build [--release].

Before running it, you need to configure your instance in the alexandrie.toml file.

The database is configured through the [database] table:

[database]
# Replace the '<...>' placeholders by the real values.

# For MySQL
url = "mysql://<user>:<password>@<hostname>:<port>/<database>"

# For PostgreSQL
url = "postgresql://<user>:<password>@<hostname>:<port>/<database>"

# For SQLite
url = "<path-to-sqlite-file>"
# or:
url = ":memory:" # ephemeral in-memory database, doesn't persists between restarts

Then, you can configure the crates' tarballs storage strategy and the crate index management strategy that you want to use.
Here is how to do it (these are also the defaults, you can leave them out if you want):

[index]
type = "command-line"
path = "crate-index"

[storage]
type = "disk"
path = "crate-storage"

You can also configure things like the address and port of the server:

[general]
addr = "127.0.0.1"
port = 3000

To run the registry, be sure to clone your crate index at the location designated by the path key in [index].
The default for it is ./crate-index.
To clone an existing crate index, you can run:

# Replace the '<...>' placeholders by the real ones.
git clone <url-of-the-crate-index> <path-from-config>

If you want to create one, you can refer to the Cargo's Alternative Registries RFC to learn about the layout of such an index.
You can also visit the crates.io index or the crates.polomack.eu index as deployed examples.

Once everything is configured, you can run with: cargo run [--release].

Then, if you want to use this index with Cargo, you can follow these steps:

  • Edit or create the ~/.cargo/config file, and add the following code:
    # Replace the '<...>' placeholders by the real ones.
    [registries.<name-of-your-registry>]
    index = "<url-of-the-crate-index>"
  • Then, run cargo login --registry <name-of-your-registry> and enter your author token.
    To generate a token, you need to register as an author first. You can do this using the frontend by:
    • Registering at /account/register.
    • Generating a token at /account/manage.
  • You can now use the registry using cargo [search|publish] --registry <name-of-your-registry>

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

alexandrie's People

Contributors

hirevo avatar

Watchers

James Cloos avatar

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.