forked from mirrors/thatmattlove-hyperglass
145 lines
4.3 KiB
Text
145 lines
4.3 KiB
Text
---
|
|
title: Installation
|
|
description: Installing hyperglass
|
|
---
|
|
|
|
import { Callout, Tab, Tabs } from 'nextra-theme-docs';
|
|
|
|
## Docker
|
|
<Callout type="info">
|
|
**Docker is the recommended method for running hyperglass.**
|
|
</Callout>
|
|
|
|
### 1. [Install Docker](https://docs.docker.com/engine/install/)
|
|
|
|
### 2. Download hyperglass
|
|
|
|
```shell copy
|
|
mkdir /etc/hyperglass
|
|
cd /opt
|
|
git clone https://github.com/thatmattlove/hyperglass/tree/v2.0.0 --depth=1
|
|
```
|
|
|
|
### Quickstart (optional)
|
|
|
|
Do this if you just want to see the hyperglass page working with a fake device.
|
|
|
|
```shell copy
|
|
cp /opt/hyperglass/.samples/sample_devices.yaml /etc/hyperglass/devices.yaml
|
|
cd /opt/hyperglass
|
|
docker compose up
|
|
```
|
|
|
|
Navigate to http://localhost:8001
|
|
|
|
### 3. Setup Reverse Proxy
|
|
|
|
[Caddy](https://caddyserver.com) is recommended, but any reverse proxy ([NGINX](https://www.nginx.com), [Apache2](https://httpd.apache.org)) will work.
|
|
|
|
#### Caddy
|
|
|
|
[**Install Caddy**](https://caddyserver.com/docs/install)
|
|
|
|
```shell copy
|
|
cp /opt/hyperglass/.samples/Caddyfile /etc/caddy/Caddyfile
|
|
```
|
|
|
|
Change the `lg.example.com` and `person@example.com` values to match your hyperglass FQDN and email address (the email address is for automatic SSL certificate generation via Let's Encrypt).
|
|
|
|
<Callout type="info">
|
|
If you prefer to use other Let's Encrypt validation methods or your own SSL certificate, modify your `/etc/hyperglass/Caddyfile` in accordance with the [Caddy docs](https://caddyserver.com/docs/caddyfile-tutorial).
|
|
</Callout>
|
|
|
|
Restart the Caddy service: `systemctl restart caddy{:shell}`
|
|
|
|
#### NGINX
|
|
|
|
```shell copy
|
|
cp /opt/hyperglass/.samples/hyperglass.nginx /etc/nginx/sites-available/hyperglass
|
|
ln -s /etc/nginx/sites-available/hyperglass /etc/nginx/sites-enabled/hyperglass
|
|
```
|
|
|
|
Change the `lg.example.com` value to match your hyperglass FQDN.
|
|
|
|
Change the `<path to cert chain>` and `<path to key>` values to match the path to your certificate and private key files.
|
|
|
|
## Automatic installation
|
|
|
|
If your system runs on:
|
|
|
|
- Ubuntu/Debian Linux
|
|
- ~~CentOS/Red Had Linux~~
|
|
|
|
You should be able to proceed with the automatic installation:
|
|
|
|
```bash
|
|
curl https://install.hyperglass.dev | sudo bash
|
|
```
|
|
|
|
<Callout type="warning">
|
|
**Piping to bash**
|
|
<br /> You should be _very_ worried when someone asks you to do what I just did. Downloading a bash
|
|
script from the internet and piping it to `bash` with root privileges is a terrible idea, unless you
|
|
fully trust the source. Please don't trust me - go [look at the code](https://github.com/thatmattlove/hyperglass/blob/v1.0.0/install.sh)
|
|
and determine for your self if it's safe to execute. If you feel it's not, please proceed with the
|
|
manual installation (and [tell me why](https://github.com/thatmattlove/hyperglass/issues), so I can
|
|
fix it).
|
|
</Callout>
|
|
|
|
## Manual Installation
|
|
|
|
### System Dependencies
|
|
|
|
#### Python
|
|
|
|
hyperglass is written in Python 3 and requires Python version **3.9** as a minimum dependency.
|
|
|
|
If you're confident upgrading your system's version of Python won't break your system (many Linux operating systems rely heavily on Python for package management and other system functions), you can install Python 3.9:
|
|
|
|
<Tabs items={["Debian/Ubuntu", "RHEL/CentOS"]}>
|
|
|
|
<Tab>
|
|
|
|
```bash
|
|
sudo apt install -y python3-dev python3-pip
|
|
```
|
|
|
|
</Tab>
|
|
|
|
<Tab>
|
|
|
|
Documentation for CentOS is still in-progress. However, it's been determined that these dependencies _may_ also be required, depending on the version of CentOS:
|
|
|
|
```bash
|
|
sudo yum install libtiff-devel libjpeg-devel openjpeg2-devel zlib-devel \
|
|
freetype-devel lcms2-devel libwebp-devel tcl-devel tk-devel \
|
|
harfbuzz-devel fribidi-devel libraqm-devel libimagequant-devel \
|
|
libxcb-devel ncurses-devel
|
|
```
|
|
|
|
Until further testing with CentOS can be done, you should install the above dependencies _before_ installing Python 3. You may have to uninstall and re-install Python 3 if these dependencies weren't already installed.
|
|
|
|
You can install python from the CentOS 7 repository:
|
|
|
|
```bash
|
|
sudo yum install python3-devel python3-pip
|
|
```
|
|
|
|
But you can also use the [SCL repository](https://www.softwarecollections.org/en/scls/rhscl/rh-python36/)
|
|
|
|
```bash
|
|
sudo yum install centos-release-scl
|
|
sudo yum install rh-python36
|
|
```
|
|
|
|
</Tab>
|
|
|
|
</Tabs>
|
|
|
|
### Install hyperglass
|
|
|
|
Now that system dependencies are installed, you can install hyperglass.
|
|
|
|
```bash
|
|
pip3 install hyperglass
|
|
```
|