/lxdhub

Display, search and copy LXD images using a web interface.

Primary LanguageTypeScriptApache License 2.0Apache-2.0

LXD Hub Logo

Display, search and copy LXC images using a web interface.

Gitter Circle CI Status

Purpose

LXDHub is a management system for linux containers (LXC). With LXDHub you can visualize LXC images of multiple (private & public) remotes. One of the key features of LXDHub is to clone LXC images from one remote to another. Therefor you can mirror public remotes to your private remote.

Installation

Prerequisites

The fastest way to run LXDHub on your computer is by pulling the LXDHub LXC image from our public remote.

lxc remote add lxdhub https://lxdhub.xyz:8443 --accept-certificate --public
lxc launch lxdhub:lxdhub mylxdhub
lxc info mylxdhub | grep "eth0:.*inet" | head -n1 | awk '{print "Open http://"$3":3000 in your browser"}'

Adding your remotes:

lxc exec mylxdhub -- su -l lxdhub -c "cat << EOF >> ~/lxdhub/lxdhub.yml
  - name: efiks
    url: https://images.efiks.ovh:8443
    protocol: lxd
    public: true
    readonly: true
EOF"

# restart the services
lxc exec mylxdhub -- systemctl restart lxdhub-dbsync.service
lxc exec mylxdhub -- systemctl restart lxdhub.service

LXDHub can also be installed with other technologies:

Configuration Management

Ansible

Important Note: these playbooks were tested in the following environment:

  • ansible >= 2.5.1
  • Ubuntu
  • lxc (snap/native)

one can use the roles in the ansible folder to deploy lxdhub on their own server.

cd ansible
ansible-playbook deploy.yml -D -vv

one can also parametrize the container_name and lxdhub_version to be checked out as extra-vars.

ansible-playbook deploy.yml -D -vv -e "container_name=next-lxdhub" -e "lxdhub_version=v1.8.0"

This call will:

  1. create you a local lxdhub container (default)
  2. clone, build lxdhub inside of this container
  3. setup systemctl services
  4. publish an image in your local: remote

Packages

Under the hood, LXDHub is split in five packages. The following graph visualizes the dependencies of each package.

Package Dependency

Name Version Description
@lxdhub/web npm version The LXDHub webinterface
@lxdhub/api npm version The REST API for the LXDHub webinterface
@lxdhub/dbsync npm version The script to synchronize multiple LXD remotes with the LXDHub database
@lxdhub/db npm version The package, which provides database functions for the @lxdhub/api and @lxdhub/dbsync packages
@lxdhub/common npm version The package, which provides common functions for all LXDHub-packages.

The packages @lxdhub/db and @lxdhub/common are solely libraries, which can not be run seperatly. Whereas the packages @lxdhub/web, @lxdhub/api and @lxdhub/dbsync can be run seperatly via Docker or NodeJS.

Tests

Prerequisites

Unit / Integration Tests

Run the automated test cases with NodeJS.

docker build -t $USER/lxdhub .
docker run -it brunnel6/lxdhub test
docker run -it brunnel6/lxdhub lint

Related

  • @lxdhub/web: The LXDHub webinterface
  • @lxdhub/api: The REST API for the LXDHub webinterface
  • @lxdhub/dbsync: The script to synchronize multiple LXD remotes with the LXDHub database
  • @lxdhub/db: The package, which provides database functions for the @lxdhub/api and @lxdhub/dbsync packages
  • @lxdhub/common: The package, which provides common functions for all LXDHub-packages
  • CONTRIBUTING.md: The contributing guidelines
  • COPYRIGHT: Copyright informations
  • publish.md: Documentation on how LXDHub is being published
  • LXC: The underlying technology behind LXDHub

People