mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-03-02 17:05:55 +01:00
* feat: add Docker-based tool addons for dockge, komodo, dokploy, npmplus Create addon scripts following the arcane.sh pattern for Docker-based tools that can be installed on any existing Docker LXC: - dockge: Docker Compose stack manager (port 5001) - komodo: Build/deployment system with MongoDB/FerretDB (port 9120) - dokploy: PaaS via external installer with Redis (port 3000) - npmplus: Nginx Proxy Manager Plus via Compose (port 81) Each addon includes: - Docker availability check - Install with full configuration - Update via docker compose pull - Uninstall with container cleanup - ASCII header files Original ct/ and install/ scripts are preserved for now. * refactor: convert Docker tools to addons, remove old scripts Convert dockge, komodo, dokploy, coolify from standalone ct/install scripts to addon pattern (like arcane.sh). Added: - tools/addon/dockge.sh (port 5001) - tools/addon/komodo.sh (port 9120, MongoDB/FerretDB choice) - tools/addon/dokploy.sh (port 3000, external installer) - tools/addon/coolify.sh (port 8000, external installer) - tools/headers/ for all 4 Removed: - ct/dockge.sh, ct/komodo.sh, ct/alpine-komodo.sh, ct/dokploy.sh, ct/coolify.sh - install/dockge-install.sh, install/komodo-install.sh, install/alpine-komodo-install.sh - install/dokploy-install.sh, install/coolify-install.sh - frontend/public/json/ for dockge, komodo, dokploy, coolify - tools/addon/npmplus.sh (not an addon candidate) These tools are Docker-only and fit the addon pattern: they require an existing Docker LXC and manage containers via docker compose. * feat: add addon JSON configs for dockge, komodo, dokploy, coolify Recreate JSON configs with type=addon, script paths pointing to tools/addon/*.sh, null resources (addon runs on existing Docker LXC), and update instructions in notes. * feat: add Runtipi addon + upgrade all addons with Proxmox host check, optional Docker install, Alpine support - New: tools/addon/runtipi.sh with full Alpine support (gcompat for musl) - New: tools/headers/runtipi ASCII header - Updated: runtipi.json to addon type with null resources - Removed: ct/runtipi.sh, install/runtipi-install.sh (migrated to addon) - All addons (dockge, komodo, dokploy, coolify, runtipi) now have: - check_proxmox_host(): warns when running on PVE host, default N - check_or_install_docker(): optional Docker install (Debian+Alpine) - Alpine-aware curl bootstrap and dependency installation * readd ct, update information * Create runtipi.sh * refactor: remove inline header_info from addons, use core.func get_header() - get_header() in core.func now maps APP_TYPE=addon to tools/headers/ path - Removed 5 duplicate ASCII art header_info functions from addon scripts - Addons now use the shared header_info() from core.func + tools/headers/ files * chore(tools): add Github source links to dockge, komodo, dokploy, coolify, runtipi addons * fix(runtipi): drop Alpine support; add OS compat notes to docker addon JSONs
210 lines
6.4 KiB
Bash
210 lines
6.4 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) 2021-2026 community-scripts ORG
|
|
# Author: tteck (tteckster) | Addon: MickLesk (CanbiZ)
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
# Source: https://dockge.kuma.pet/ | Github: https://github.com/louislam/dockge
|
|
if ! command -v curl &>/dev/null; then
|
|
printf "\r\e[2K%b" '\033[93m Setup Source \033[m' >&2
|
|
if [[ -f /etc/alpine-release ]]; then
|
|
apk update >/dev/null 2>&1
|
|
apk add --no-cache curl >/dev/null 2>&1
|
|
else
|
|
apt-get update >/dev/null 2>&1
|
|
apt-get install -y curl >/dev/null 2>&1
|
|
fi
|
|
fi
|
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
|
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
|
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
|
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
|
|
|
# Enable error handling
|
|
set -Eeuo pipefail
|
|
trap 'error_handler' ERR
|
|
|
|
# ==============================================================================
|
|
# CONFIGURATION
|
|
# ==============================================================================
|
|
APP="Dockge"
|
|
APP_TYPE="addon"
|
|
INSTALL_PATH="/opt/dockge"
|
|
STACKS_PATH="/opt/stacks"
|
|
COMPOSE_FILE="${INSTALL_PATH}/compose.yaml"
|
|
DEFAULT_PORT=5001
|
|
|
|
# Initialize all core functions (colors, formatting, icons, STD mode)
|
|
load_functions
|
|
|
|
# ==============================================================================
|
|
# UNINSTALL
|
|
# ==============================================================================
|
|
function uninstall() {
|
|
msg_info "Uninstalling ${APP}"
|
|
|
|
if [[ -f "$COMPOSE_FILE" ]]; then
|
|
msg_info "Stopping and removing Docker containers"
|
|
cd "$INSTALL_PATH"
|
|
$STD docker compose down --remove-orphans
|
|
msg_ok "Stopped and removed Docker containers"
|
|
fi
|
|
|
|
rm -rf "$INSTALL_PATH"
|
|
msg_ok "${APP} has been uninstalled"
|
|
msg_warn "Stacks directory ${STACKS_PATH} was NOT removed. Delete manually if no longer needed."
|
|
}
|
|
|
|
# ==============================================================================
|
|
# UPDATE
|
|
# ==============================================================================
|
|
function update() {
|
|
msg_info "Pulling latest ${APP} image"
|
|
cd "$INSTALL_PATH"
|
|
$STD docker compose pull
|
|
msg_ok "Pulled latest image"
|
|
|
|
msg_info "Restarting ${APP}"
|
|
$STD docker compose up -d --remove-orphans
|
|
msg_ok "Restarted ${APP}"
|
|
|
|
msg_ok "Updated successfully"
|
|
exit
|
|
}
|
|
|
|
# ==============================================================================
|
|
# PROXMOX HOST CHECK
|
|
# ==============================================================================
|
|
function check_proxmox_host() {
|
|
if command -v pveversion &>/dev/null; then
|
|
msg_error "Running on the Proxmox host is NOT recommended!"
|
|
msg_error "This should be executed inside an LXC container."
|
|
echo ""
|
|
echo -n "${TAB}Continue anyway? (y/N): "
|
|
read -r confirm
|
|
if [[ ! "${confirm,,}" =~ ^(y|yes)$ ]]; then
|
|
msg_warn "Aborted. Please run this inside an LXC container."
|
|
exit 0
|
|
fi
|
|
msg_warn "Proceeding on Proxmox host at your own risk!"
|
|
fi
|
|
}
|
|
|
|
# ==============================================================================
|
|
# CHECK / INSTALL DOCKER
|
|
# ==============================================================================
|
|
function check_or_install_docker() {
|
|
if command -v docker &>/dev/null; then
|
|
msg_ok "Docker $(docker --version | cut -d' ' -f3 | tr -d ',') is available"
|
|
if docker compose version &>/dev/null; then
|
|
msg_ok "Docker Compose is available"
|
|
else
|
|
msg_error "Docker Compose plugin is not available. Please install it."
|
|
exit 1
|
|
fi
|
|
return
|
|
fi
|
|
|
|
msg_warn "Docker is not installed."
|
|
echo -n "${TAB}Install Docker now? (y/N): "
|
|
read -r install_docker_prompt
|
|
if [[ ! "${install_docker_prompt,,}" =~ ^(y|yes)$ ]]; then
|
|
msg_error "Docker is required for ${APP}. Exiting."
|
|
exit 1
|
|
fi
|
|
|
|
msg_info "Installing Docker"
|
|
if [[ -f /etc/alpine-release ]]; then
|
|
$STD apk add docker docker-cli-compose
|
|
$STD rc-service docker start
|
|
$STD rc-update add docker default
|
|
else
|
|
DOCKER_CONFIG_PATH='/etc/docker/daemon.json'
|
|
mkdir -p "$(dirname "$DOCKER_CONFIG_PATH")"
|
|
echo -e '{\n "log-driver": "journald"\n}' >"$DOCKER_CONFIG_PATH"
|
|
$STD sh <(curl -fsSL https://get.docker.com)
|
|
fi
|
|
msg_ok "Installed Docker"
|
|
}
|
|
|
|
# ==============================================================================
|
|
# INSTALL
|
|
# ==============================================================================
|
|
function install() {
|
|
check_or_install_docker
|
|
|
|
msg_info "Creating install directories"
|
|
mkdir -p "$INSTALL_PATH" "$STACKS_PATH"
|
|
msg_ok "Created ${INSTALL_PATH} and ${STACKS_PATH}"
|
|
|
|
msg_info "Downloading Docker Compose file"
|
|
curl -fsSL "https://raw.githubusercontent.com/louislam/dockge/master/compose.yaml" -o "$COMPOSE_FILE"
|
|
msg_ok "Downloaded Docker Compose file"
|
|
|
|
msg_info "Starting ${APP}"
|
|
cd "$INSTALL_PATH"
|
|
$STD docker compose up -d
|
|
msg_ok "Started ${APP}"
|
|
|
|
echo ""
|
|
msg_ok "${APP} is reachable at: ${BL}http://${LOCAL_IP}:${DEFAULT_PORT}${CL}"
|
|
}
|
|
|
|
# ==============================================================================
|
|
# MAIN
|
|
# ==============================================================================
|
|
|
|
# Handle type=update (called from update script)
|
|
if [[ "${type:-}" == "update" ]]; then
|
|
header_info
|
|
if [[ -f "$COMPOSE_FILE" ]]; then
|
|
update
|
|
else
|
|
msg_error "${APP} is not installed. Nothing to update."
|
|
exit 1
|
|
fi
|
|
exit 0
|
|
fi
|
|
|
|
header_info
|
|
check_proxmox_host
|
|
get_lxc_ip
|
|
|
|
# Check if already installed
|
|
if [[ -f "$COMPOSE_FILE" ]]; then
|
|
msg_warn "${APP} is already installed."
|
|
echo ""
|
|
|
|
echo -n "${TAB}Uninstall ${APP}? (y/N): "
|
|
read -r uninstall_prompt
|
|
if [[ "${uninstall_prompt,,}" =~ ^(y|yes)$ ]]; then
|
|
uninstall
|
|
exit 0
|
|
fi
|
|
|
|
echo -n "${TAB}Update ${APP}? (y/N): "
|
|
read -r update_prompt
|
|
if [[ "${update_prompt,,}" =~ ^(y|yes)$ ]]; then
|
|
update
|
|
exit 0
|
|
fi
|
|
|
|
msg_warn "No action selected. Exiting."
|
|
exit 0
|
|
fi
|
|
|
|
# Fresh installation
|
|
msg_warn "${APP} is not installed."
|
|
echo ""
|
|
echo -e "${TAB}${INFO} This will install:"
|
|
echo -e "${TAB} - Dockge (via Docker Compose)"
|
|
echo ""
|
|
|
|
echo -n "${TAB}Install ${APP}? (y/N): "
|
|
read -r install_prompt
|
|
if [[ "${install_prompt,,}" =~ ^(y|yes)$ ]]; then
|
|
install
|
|
else
|
|
msg_warn "Installation cancelled. Exiting."
|
|
exit 0
|
|
fi
|