154 lines
2.8 KiB
Markdown
154 lines
2.8 KiB
Markdown
# PVE HA Web Panel — Deployment Guide
|
|
|
|
This guide explains how to deploy **PVE HA Web Panel** on a Proxmox host or any Debian/Ubuntu-like system.
|
|
|
|
---
|
|
|
|
## 1) Create directory
|
|
|
|
```bash
|
|
mkdir -p /opt/pve-ha-web
|
|
cd /opt/pve-ha-web
|
|
```
|
|
|
|
## 2) Get the application
|
|
|
|
Clone the repository (includes `app.py`, `templates/`, `static/`, `requirements.txt`).
|
|
|
|
```bash
|
|
git clone https://gitea.linuxiarz.pl/gru/pve-ha-web.git .
|
|
```
|
|
|
|
> **Note:** The trailing `.` clones directly into `/opt/pve-ha-web` instead of a nested subfolder.
|
|
|
|
## 3) Python virtualenv & dependencies
|
|
|
|
```bash
|
|
python3 -m venv venv
|
|
source venv/bin/activate
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
deactivate
|
|
```
|
|
|
|
## 4) systemd unit
|
|
|
|
Create a service unit file for Gunicorn:
|
|
|
|
```bash
|
|
tee /etc/systemd/system/pve-ha-web.service >/dev/null <<'UNIT'
|
|
[Unit]
|
|
Description=PVE HA Web Panel
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
WorkingDirectory=/opt/pve-ha-web
|
|
Environment="PYTHONUNBUFFERED=1"
|
|
ExecStart=/opt/pve-ha-web/venv/bin/gunicorn -w 2 -b 0.0.0.0:8007 app:app
|
|
Restart=on-failure
|
|
RestartSec=3
|
|
User=root
|
|
Group=root
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
UNIT
|
|
```
|
|
|
|
> **Port:** The app listens on `8007` by default. Adjust as needed.
|
|
|
|
## 5) Enable & start
|
|
|
|
```bash
|
|
systemctl daemon-reload
|
|
systemctl enable --now pve-ha-web
|
|
```
|
|
|
|
## 6) Verify
|
|
|
|
```bash
|
|
systemctl status pve-ha-web
|
|
ss -ltnp | grep :8007
|
|
```
|
|
|
|
Open the app in the browser: `http://<server-ip>:8007`
|
|
|
|
---
|
|
|
|
## Optional: Reverse proxy (Nginx)
|
|
|
|
If you want to expose it under standard HTTPS with a domain:
|
|
|
|
```nginx
|
|
server {
|
|
listen 80;
|
|
server_name ha.example.com;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name ha.example.com;
|
|
|
|
# TLS certs (replace with your paths / cert manager)
|
|
ssl_certificate /etc/letsencrypt/live/ha.example.com/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/ha.example.com/privkey.pem;
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:8007;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
}
|
|
```
|
|
|
|
Reload Nginx: `sudo systemctl reload nginx`
|
|
|
|
---
|
|
|
|
## Management
|
|
|
|
### Logs
|
|
|
|
```bash
|
|
journalctl -u pve-ha-web -e -f
|
|
```
|
|
|
|
### Restart / stop
|
|
|
|
```bash
|
|
sudo systemctl restart pve-ha-web
|
|
sudo systemctl stop pve-ha-web
|
|
```
|
|
|
|
### Update to latest version
|
|
|
|
```bash
|
|
cd /opt/pve-ha-web
|
|
git pull --rebase
|
|
source venv/bin/activate
|
|
pip install -r requirements.txt
|
|
deactivate
|
|
systemctl restart pve-ha-web
|
|
```
|
|
|
|
---
|
|
|
|
## Uninstall
|
|
|
|
```bash
|
|
systemctl disable --now pve-ha-web
|
|
rm -f /etc/systemd/system/pve-ha-web.service
|
|
systemctl daemon-reload
|
|
rm -rf /opt/pve-ha-web
|
|
```
|
|
|
|
---
|
|
|
|
## Project
|
|
|
|
- Author: **linuxiarz.pl**
|
|
- Source: <https://gitea.linuxiarz.pl/gru/pve-ha-web> |