@lxdhub/api
Display, search and copy LXD-images using a web interface.
Last updated 4 months ago by brunnerlivio .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @lxdhub/api 
SYNC missed versions from official npm registry.

LXD Hub Logo

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

Prerequisites

Installation

Database

LXDHub API uses a PostgreSQL database to store its data. You must set up a PostgreSQL on your local machine or inside a docker container

Using Docker

docker pull postgres:10.3
docker run -p 5432:5432 \
           -e POSTGRES_USER=lxdhub \
           -e POSTGRES_DB=lxdhub \
           -e POSTGRES_PASSWORD=lxdhub \
           -v db:/var/lib/postgresql/data \
           -d --name db postgres:10.3

NodeJS

CLI

npm install -g @lxdhub/api

# Run locally
lxdhub-api start --cert certificates/client.crt --key certificates/client.key

Programmatically

npm install -s @lxdhub/api

Example usage in NodeJS

const { LXDHubAPI } = require('@lxdhub/api');
const fs = require('fs');
const path = require('path');

const ROOT = path.join(__dirname, '..');

const certPath = path.join(ROOT, 'certificates/client.crt');
const keyPath = path.join(ROOT, 'certificates/client.key');

LXDHubAPI.run({
    hostUrl: '0.0.0.0',
    port: 3000,
    lxd: {
        cert: fs.readFileSync(certPath),
        key: fs.readFileSync(keyPath)
    },
    database: {
        host: 'localhost',
        port: 5432,
        username: 'lxdhub',
        password: 'lxdhub',
        database: 'lxdhub'
    }
});

Docker

LXDHub supports Docker. You can pull the latest version using the brunnel6/lxdhub-api:latest tag or a specific version e.g. brunnel6/lxdhub-api:1.0.0

docker pull brunnel6/lxdhub-api:latest
docker run -v "$(pwd)/certificates:/var/lib/lxdhub/certificates" \
           -p 3000:3000 \
           -e POSTGRES_HOST=postgres \
           --link db:postgres \
           brunnel6/lxdhub-api:latest

Current Tags

  • 1.10.3                                ...           latest (4 months ago)
  • 1.10.6-alpha.4                                ...           unstable (a month ago)

26 Versions

  • 1.10.6-alpha.4                                ...           a month ago
  • 1.10.6-alpha.7                                ...           4 months ago
  • 1.10.6-alpha.1                                ...           4 months ago
  • 1.10.6-alpha.0                                ...           4 months ago
  • 1.10.3                                ...           4 months ago
  • 1.10.3-alpha.1                                ...           4 months ago
  • 1.10.2                                ...           4 months ago
  • 1.10.2-alpha.49                                ...           4 months ago
  • 1.10.2-alpha.41                                ...           7 months ago
  • 1.10.2-alpha.42                                ...           7 months ago
  • 1.10.2-alpha.40                                ...           7 months ago
  • 1.10.1                                ...           9 months ago
  • 1.10.0                                ...           10 months ago
  • 1.9.2-0                                ...           10 months ago
  • 1.9.1                                ...           10 months ago
  • 1.9.0                                ...           a year ago
  • 1.8.2                                ...           2 years ago
  • 1.8.1                                ...           2 years ago
  • 1.8.0                                ...           2 years ago
  • 1.7.3                                ...           2 years ago
  • 1.7.2                                ...           2 years ago
  • 1.7.1                                ...           2 years ago
  • 1.7.0                                ...           2 years ago
  • 1.6.0                                ...           2 years ago
  • 1.4.0                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 19
Dependencies (26)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |