diff --git a/ct/fleetpilot.sh b/ct/fleetpilot.sh new file mode 100644 index 0000000000..baa14fef0c --- /dev/null +++ b/ct/fleetpilot.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash +_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/DevScripts/main" +_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" +source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") +# Copyright (c) 2021-2026 community-scripts ORG +# Author: ChristianHandy +# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE +# Source: https://github.com/ChristianHandy/FleetPilot + +APP="FleetPilot" +var_tags="${var_tags:-monitoring;infrastructure}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-8}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +#var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -d /opt/fleetpilot ]]; then + msg_error "No FleetPilot Installation Found!" + exit + fi + + if check_for_gh_release "fleetpilot" "ChristianHandy/FleetPilot"; then + msg_info "Stopping FleetPilot" + systemctl stop fleetpilot + msg_ok "Stopped FleetPilot" + + create_backup /opt/fleetpilot/.env + + CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="data logs venv" fetch_and_deploy_gh_release "fleetpilot" "ChristianHandy/FleetPilot" "tarball" + + restore_backup + PYTHON_VERSION="3.13" setup_uv + + msg_info "Updating Python Environment" + $STD uv pip install -p /opt/fleetpilot/venv/bin/python -r /opt/fleetpilot/requirements.txt + msg_ok "Updated Python Environment" + + msg_info "Starting FleetPilot" + systemctl start fleetpilot + msg_ok "Started FleetPilot" + msg_ok "Updated successfully!" + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW}Access it using the following URL:${CL}" +echo -e "${GATEWAY}${BGN}https://${IP}${CL}" diff --git a/install/fleetpilot-install.sh b/install/fleetpilot-install.sh new file mode 100644 index 0000000000..a2c8ab4804 --- /dev/null +++ b/install/fleetpilot-install.sh @@ -0,0 +1,114 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: ChristianHandy +# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE +# Source: https://github.com/ChristianHandy/FleetPilot + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt install -y \ + nginx \ + smartmontools +msg_ok "Installed Dependencies" + +fetch_and_deploy_gh_release "fleetpilot" "ChristianHandy/FleetPilot" "tarball" +PYTHON_VERSION="3.13" setup_uv + +msg_info "Setting up Python Environment" +$STD uv venv /opt/fleetpilot/venv +$STD uv pip install -p /opt/fleetpilot/venv/bin/python -r /opt/fleetpilot/requirements.txt +msg_ok "Set up Python Environment" + +msg_info "Configuring FleetPilot" +mkdir -p /opt/fleetpilot/data /opt/fleetpilot/logs /root/.ssh +chmod 700 /opt/fleetpilot/data /root/.ssh +# FleetPilot signs in to the servers it manages with this key. +ssh-keygen -q -t ed25519 -N "" -C "fleetpilot@$(hostname)" -f /root/.ssh/id_ed25519 +cat </opt/fleetpilot/.env +SECRET_KEY=$(openssl rand -hex 32) +FLEETPILOT_DATA_DIR=/opt/fleetpilot/data +DASHBOARD_USERNAME=admin +DASHBOARD_PASSWORD=$(random_password) +GUNICORN_BIND=127.0.0.1:5000 +FLEETPILOT_PRODUCTION=true +FLEETPILOT_TRUST_PROXY=true +FLEETPILOT_COOKIE_SECURE=true +FLEETPILOT_HSTS=false +EOT +chmod 600 /opt/fleetpilot/.env +msg_ok "Configured FleetPilot" + +create_self_signed_cert "fleetpilot" + +msg_info "Configuring Nginx" +cat </etc/nginx/sites-available/fleetpilot +server { + listen 80; + server_name _; + return 301 https://\$host\$request_uri; +} + +server { + listen 443 ssl; + http2 on; + server_name _; + + ssl_certificate /etc/ssl/fleetpilot/fleetpilot.crt; + ssl_certificate_key /etc/ssl/fleetpilot/fleetpilot.key; + ssl_protocols TLSv1.2 TLSv1.3; + client_max_body_size 16m; + + location = /system/backups/restore { + client_max_body_size 512m; + proxy_pass http://127.0.0.1:5000; + proxy_set_header Host \$host; + proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto \$scheme; + } + + location / { + proxy_pass http://127.0.0.1:5000; + proxy_set_header Host \$host; + proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto \$scheme; + proxy_read_timeout 300s; + proxy_buffering off; + } +} +EOT +nginx_enable_site "fleetpilot" +msg_ok "Configured Nginx" + +msg_info "Creating Service" +cat </etc/systemd/system/fleetpilot.service +[Unit] +Description=FleetPilot +Wants=network-online.target +After=network-online.target + +[Service] +Type=exec +User=root +WorkingDirectory=/opt/fleetpilot +EnvironmentFile=/opt/fleetpilot/.env +ExecStart=/opt/fleetpilot/venv/bin/gunicorn --config /opt/fleetpilot/gunicorn.conf.py app:app +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOT +systemctl enable -q --now fleetpilot +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc diff --git a/json/fleetpilot.json b/json/fleetpilot.json new file mode 100644 index 0000000000..59063c5d27 --- /dev/null +++ b/json/fleetpilot.json @@ -0,0 +1,49 @@ +{ + "name": "FleetPilot", + "slug": "fleetpilot", + "categories": [ + 9 + ], + "date_created": "2026-10-12", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 443, + "documentation": "https://github.com/ChristianHandy/FleetPilot/blob/main/docs/user-guide.md", + "website": "https://github.com/ChristianHandy/FleetPilot", + "repository": "https://github.com/ChristianHandy/FleetPilot", + "logo": "https://cdn.jsdelivr.net/gh/ChristianHandy/FleetPilot@main/static/fleetpilot-logo.svg", + "description": "Self-hosted operations dashboard for home labs and small companies: server updates, SMART disk health, routers (FRITZ!Box, OpenWrt, OPNsense, pfSense, MikroTik), Proxmox VMs, TrueNAS/Unraid storage, backup servers and fans, managed over SSH and APIs without agents.", + "install_methods": [ + { + "type": "default", + "script": "ct/fleetpilot.sh", + "config_path": "/opt/fleetpilot/.env", + "resources": { + "cpu": 2, + "ram": 2048, + "hdd": 8, + "os": "Debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": "admin", + "password": null + }, + "notes": [ + { + "text": "Open https:// and accept the self-signed certificate once. Sign in as admin; the password is DASHBOARD_PASSWORD in /opt/fleetpilot/.env. Change it after the first sign-in under My Profile and set up two-factor sign-in.", + "type": "info" + }, + { + "text": "FleetPilot manages other machines over SSH with the key /root/.ssh/id_ed25519.pub inside the container. Add that key to each server's authorized_keys, or use Manage Hosts → Install Key. To manage the Proxmox node itself, add the node as a host the same way.", + "type": "info" + }, + { + "text": "Update FleetPilot with this script's update function. The in-app 'FleetPilot update' page expects a git checkout and does not apply to this container.", + "type": "warning" + } + ] +}