Skip to content

Private self-hosted alternative to Vagrant Cloud

License

Notifications You must be signed in to change notification settings

polart/vagrant-registry

Repository files navigation

Vagrant Registry

Vagrant Registry is a private self-hosted alternative to Vagrant Cloud.

Features:

  • user management
  • private/public boxes
  • upload/download boxes via web app
  • boxes are stored on a local drive

My Boxes

Box Details

Box Versions

Usage

Public boxes

To use public boxes from Vagrant Registry specify box name and URL, for example

$ vagrant init polart/jessie64 http://localhost:3000/polart/jessie64
$ vagrant up

Private boxes

Log in into Vagrant Registry using Vagrant Registry plugin

$ vagrant registry login http://localhost:3000

Init and launch a box

$ vagrant init polart/jessie64 http://localhost:3000/polart/jessie64
$ vagrant up

Production deploy

Vagrant Registry is distributed as a single docker file and available on Docker registry polart/vagrant-registry

Generate a secret key

$ export SECRET_KEY=$(LC_ALL=C tr -dc 'A-Za-z0-9!#$%&' </dev/urandom | head -c 50 ; echo)

Create directories for logs and boxes files

$ mkdir -p \
    /var/vr/logs/nginx \
    /var/vr/logs/supervisord \
    /var/vr/logs/gunicorn \
    /var/vr/logs/django \
    /var/vr/protected_media

Create superuser

$ docker exec -it vagrant-registry python3 /code/api/manage.py createsuperuser

Start Vagrant Registry

$ docker run \
    --rm -d\
    -e SECRET_KEY \
    -v /var/vr/logs/:/logs/ \
    -v /var/vr/protected_media/:/code/api/protected_media/ \
    -v vr-db:/var/lib/postgresql \
    -p 8080:80 \
    --name vagrant-registry \
    polart/vagrant-registry:0.1.2

Make sure to run Vagrant Registry behind reverse proxy

Development

Vagrant Registry is written with Python/Django and ReactJS.

Make sure you have installed Docker and Docker Compose.

Apply DB migrations

$ make migrate

Create superuser

$ make create_superuser

Install Yarn packages

$ make install_client

Start React app and Django server

$ make start

Open

Run tests

$ make test