Giter VIP home page Giter VIP logo

lxd-webgui's Introduction

Description

A lightweight web management web interface for LXD.

Written completely in AngularJS. Does not need an application server, database or other backend services. Just serve the static HTML and JS files and go!

Status

This software is beta.

Screenshot

Screenshot

installation

The installation procedure is as follows:

  • Install LXD (if not already happened)
  • Install lxd-gui
  • Create a certificate and install it into lxd
  • Configure lxd

Install LXD itself

install lxd as described here:

My lxd init looks like this:

$ sudo lxd init
Name of the storage backend to use (dir or zfs): zfs
Create a new ZFS pool (yes/no)? yes
Name of the new ZFS pool: lxdpool
Would you like to use an existing block device (yes/no)? no
Size in GB of the new loop device (1GB minimum): 16
Would you like LXD to be available over the network (yes/no)? no
LXD has been successfully configured.

Install lxd-gui

Prerequisites

Install npm, bower and a simple http server:

$ sudo apt-get install npm
$ sudo npm install -g bower
$ sudo npm install -g http-server

checkout lxd-gui

$ git clone https://github.com/dobin/lxd-webgui.git
$ cd lxd-webgui

Dependencies

install web dependencies for lxc-gui:

lxd-webgui$ bower install

HTTP server

create certs for the http server:

lxd-webgui$ openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes

start http server to serve lxd-webgui:

lxd-webgui$ http-server -S -a localhost -p 8000

lxd configuration

certs

Create a self-signed cert to authenticate to LXD:

$ cd ~/
$ mkdir lxc-cert
$ cd lxc-cert
$ openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes

Content of certificate (CN, AU etc.) does not matter.

Convert cert to pkcs12:

$ openssl pkcs12 -export -out cert.p12 -inkey key.pem -in cert.pem

Now, add the PKCS12 cert.p12 to your browser:

 Chrome: "Settings" -> "Manage Certificates" ->  "import" -> select the .p12 from above

lxd configuration

Configure LXD to listen to localhost on port 9000, and allow access from localhost port 8000. Also add cert to the trusted certs for lxd. We also have to configure LXD to accept the PUT, DELETE and OPTIONS HTTP headers, and fix allowed headers to include "Content-Type". Afterwards, we NEED to restart it atm.

$ sudo lxc config trust add cert.pem
$ sudo lxc config set core.https_address 127.0.0.1:9000
$ sudo lxc config set core.https_allowed_origin https://localhost:8000
$ sudo lxc config set core.https_allowed_methods "GET, POST, PUT, DELETE, OPTIONS"
$ sudo lxc config set core.https_allowed_headers "Origin, X-Requested-With, Content-Type, Accept"
$ sudo lxd restart

start

important: try to access lxd: https://localhost:9000 (and accept the certificate warning)

access lxd-gui: https://localhost:8000

security considerations

Do not let any other application run on the same domain+port as lxd-gui.

There is no CSRF protection for the LXD REST service.

lxd-webgui's People

Contributors

dobin avatar

Watchers

Valentin Duteil avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.