elba's website and registry backend.
elba's registry backend requires PostgreSQL
to build. You can install it by package manager or an installer provided by the PostgreSQL
project. Read more in Official Guide.
Then so as to setup a remote index repo, locally, you can unpack deploy/index-bare-example.tar
into tmp/
.
Also, since elba's registry backend is written in Rust, you need to install rust nightly toolchain first, and then run the commands below to start the backend.
$ cargo install diesel_cli --no-default-features --features postgres
$ diesel setup
$ cargo run
Note that all of the configruations of registry backend is passed in by environment variables. When it starts it reads .env
file and mash it with the existing environment variables. You would like to change configruations in that file rather than in the shell enviroment when you do development.
You may also want to build frontend project as well, if so, run the following commands, and it will output build results to /public
:
cd frontend
yarn build
The website project consists of a frontend project (lives in /frontend
) and a registry api backend. The registry backend only exposes restful apis that serves package upload/downloading and package searching for elba cli program, and it also provides metadata endpoints for frontend app to show package information.
In current design, the registry backend is not responsible for hosting frontend static files. Instead, the frontend static files is hosted on AWS S3 and is behind CloudFront CDN to improve access quality.
A simplest way to deploy the website would be:
- Clone this repo into your server.
- Install Docker-ce and docker-compose.
- Edit
docker-compose.yml
or.env
(suit yourself) to fill in enviroment varibles. - Run '
cd deploy && bash ./docker-build-image.sh
', then you will have a local docker image with tagelba/registry:latest
. - (Optional) setup a reverse proxy (e.g nginx) to enable
https
access as well as to serve static files in/public
. - Run
docker-compose up
. - Setup a remote index repo. You can start with the example
deploy/index-bare-example.tar
, and remember to change the registry url to your real domain.