Add managed Gitea updates and server installer

This commit is contained in:
maxim
2026-07-31 22:16:51 +03:00
parent 22f40f3830
commit 3f881a59e5
10 changed files with 274 additions and 2 deletions

34
scripts/install.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/sh
set -eu
if [ "$(id -u)" -ne 0 ]; then
echo "Запустите установщик от root." >&2
exit 1
fi
SOURCE_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
UPDATE_MODE=${UPDATE_MODE:-notify}
GITEA_URL=${GITEA_URL:-https://git.myown.center}
GITEA_REPOSITORY=${GITEA_REPOSITORY:-maxim/ProxmoxDash}
GITEA_TOKEN=${GITEA_TOKEN:-}
install -d -m 0750 /etc/proxmox-dashboard /var/lib/proxmox-dashboard
install -m 0755 "$SOURCE_DIR/dist/proxmox-dashboard-linux-amd64" /usr/local/bin/proxmox-cpu-dashboard
install -m 0755 "$SOURCE_DIR/scripts/proxmox-dashboard-update" /usr/local/sbin/proxmox-dashboard-update
install -m 0644 "$SOURCE_DIR/proxmox-cpu-dashboard.service" /etc/systemd/system/proxmox-cpu-dashboard.service
install -m 0644 "$SOURCE_DIR/proxmox-dashboard-update.service" /etc/systemd/system/proxmox-dashboard-update.service
install -m 0644 "$SOURCE_DIR/proxmox-dashboard-update.timer" /etc/systemd/system/proxmox-dashboard-update.timer
umask 077
{
printf 'GITEA_URL=%s\n' "$GITEA_URL"
printf 'GITEA_REPOSITORY=%s\n' "$GITEA_REPOSITORY"
printf 'GITEA_TOKEN=%s\n' "$GITEA_TOKEN"
printf 'UPDATE_MODE=%s\n' "$UPDATE_MODE"
} > /etc/proxmox-dashboard/update.env
systemctl daemon-reload
systemctl enable --now proxmox-cpu-dashboard.service
systemctl enable --now proxmox-dashboard-update.timer
systemctl start proxmox-dashboard-update.service
echo "Proxmox Dashboard установлен. Откройте http://$(hostname -I | awk '{print $1}'):9105"