Skip to content

elba/website

Repository files navigation

website

Build Status

elba's website and registry backend.

https://elba.pub

Install (Development)

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

Architecture

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.

Deploy

A simplest way to deploy the website would be:

  1. Clone this repo into your server.
  2. Install Docker-ce and docker-compose.
  3. Edit docker-compose.yml or .env (suit yourself) to fill in enviroment varibles.
  4. Run 'cd deploy && bash ./docker-build-image.sh', then you will have a local docker image with tag elba/registry:latest.
  5. (Optional) setup a reverse proxy (e.g nginx) to enable https access as well as to serve static files in /public.
  6. Run docker-compose up.
  7. 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.

About

elba's presence on the world wide web

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •