Webapp
Web application for the Runhyve platform. Uses PostgreSQL for data storage, written in Elixir. Mirror of https://gitlab.com/runhyve/webapp
Install / Use
/learn @runhyve/WebappREADME
Webapp
This repository contains web application to manage Runhyve hypervisors. It's written in Elixir with Phoenix and uses PosgreSQL to keep the state. HTTP API is used to communicate with hypervisors.
Virtual machines view
Community & contact
- IRC: #runhyve @ libera.chat
- E-mail: contact (AT) runhyve.app
Development
Using Docker
- Run
docker-compose up -dto start containers - Setup the database:
docker-compose run webapp mix ecto.setup - Visit http://localhost:4000 to see the webapp running.
You can also run docker-compose logs -f webapp to see server logs.<br>
To open Interactive Elixir Shell run docker-compose run webapp iex -S mix<br>
To open PostgreSQL interactive terminal run docker-compose exec -u postgres postgres psql -U postgres webapp_dev
Using local environment
Dependencies
- Elixir 1.5 or later
- PostgreSQL
- Node.js
- Install dependencies with
mix deps.get - Setup database with
mix ecto.setup - Install Node.js dependencies with
cd assets && npm install && cd .. - Start Phoenix server
mix phx.server
Basic operations
Default credentials
Default credentials are imported from priv/repo/seeds.exs file during setup of database (mix ecto.setup).
Setting up the hypervisor
Setting up the hypervisor is fully automated. chef-hypervisor repository contains all you need to proceed. It's basically a Chef cookbook so you can re-use it with Chef server if needed.
First, clone the repository on on your hypervisor:
git clone https://gitlab.com/runhyve/chef-hypervisor
Then, inside the chef-hypervisor directory issue ./install.sh command as a superuser:
sudo ./install.sh
Note: at this moment only clean installations of FreeBSD 12.0 are supported.
Connecting the hypervisor to webapp
At this point you should have both hypervisor and webapp up and running. To connect the hypervisor with webapp browse to Admin->Hypervisors page and click New hypervisor. You need a FQDN to connect to the hypervisor. If you're hypervisor is in internal network or don't want to mess with DNS then you can use xip.io.
Example: If your hypervisor has ip 192.168.0.11 then use 192.168.0.11.xip.io as a FQDN.
TLS certificate isn't generated during the setup so you need to either do it manually or uncheck the Enable tls checkbox if developing in trusted network.
Token is a random string generated during setup of the hypervisor. It's saved in /usr/local/etc/nginx/.runhyvetoken file on the hypervisor and it's used to authorize connections from the webapp:
$ sudo cat /usr/local/etc/nginx/.runhyvetoken
c81f578d-c558-4623-a2d4-10ada9dcb431
After succesfuly connecting to hypervisor you should be able to see its details:
Hypervisor view
Downloading images to hypervisors
We included few popular Distributions in development database. At this moment they are not
downloaded automatically on hypervisors so you need to do it manually.
For each image in priv/repo/seeds.exs you need issue this command on the hypervisor:
vm img <image url>
After importing images you can list them:
vm img
DATASTORE FILENAME
default Fedora-Cloud-Base-29-1.2.x86_64.raw
default FreeBSD-12.0-RELEASE-amd64.raw
default bionic-server-cloudimg-amd64.img
default debian-9-openstack-amd64.qcow2
default ubuntu-18.04-server-cloudimg-amd64.img
Networking
By default Webapp has configured a network named public. It's a bridged network so it'll give you access to your internal network by default.
It's not being created on the hyperisor by default. To setup it please run:
vm switch create public
vm switch add public igb0
Where igb0 is name of the main interface.
Learn more
- Phoenix website: http://www.phoenixframework.org/
- Phoenix Docs: https://hexdocs.pm/phoenix
- FreeBSD website: https://freebsd.org
Related Skills
feishu-drive
343.1k|
things-mac
343.1kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
343.1kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
codebase-memory-mcp
1.1kHigh-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 66 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.
