From 497d2711f113fa0eacb8ba90808ff5a45e1d0b97 Mon Sep 17 00:00:00 2001 From: "push-app-to-main[bot]" <203845782+push-app-to-main[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 14:07:16 +0100 Subject: [PATCH] Unifi OS Server (#10856) * Add unifi-os-server (ct) * Change updateable status to false in JSON config * Update unifi-os-server.json * Remove unnecessary dependencies from install script Removed ca-certificates and jq from dependency installation. * fix: default buit-in update msg --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com> --- ct/unifi-os-server.sh | 43 ++++++++++++ frontend/public/json/unifi-os-server.json | 35 ++++++++++ install/unifi-os-server-install.sh | 81 +++++++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 ct/unifi-os-server.sh create mode 100644 frontend/public/json/unifi-os-server.json create mode 100644 install/unifi-os-server-install.sh diff --git a/ct/unifi-os-server.sh b/ct/unifi-os-server.sh new file mode 100644 index 000000000..4c759b1d1 --- /dev/null +++ b/ct/unifi-os-server.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://ui.com/ + +APP="UniFi-OS-Server" +var_tags="${var_tags:-network}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-4096}" +var_disk="${var_disk:-20}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-0}" +var_tun="${var_tun:-yes}" +var_nesting="${var_nesting:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -f /usr/local/sbin/unifi-os-server.bin && ! -d /data/unifi ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_custom "🚀" "${GN}" "The app offers a built-in updater. Please use it." + 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 "${TAB}${GATEWAY}${BGN}https://${IP}:11443${CL}" diff --git a/frontend/public/json/unifi-os-server.json b/frontend/public/json/unifi-os-server.json new file mode 100644 index 000000000..01532932c --- /dev/null +++ b/frontend/public/json/unifi-os-server.json @@ -0,0 +1,35 @@ +{ + "name": "Unifi OS Server", + "slug": "unifi-os-server", + "categories": [ + 2 + ], + "date_created": "2026-01-16", + "type": "vm", + "updateable": false, + "privileged": true, + "interface_port": 11443, + "documentation": "https://help.ui.com/hc/en-us", + "website": "https://www.ui.com/", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/ubiquiti-unifi.webp", + "config_path": "", + "description": "Unifi OS Server is the operating system that powers Ubiquiti's UniFi line of network devices. It provides a centralized platform for managing and monitoring UniFi access points, switches, and security gateways, offering features such as network configuration, device provisioning, and performance analytics.", + "install_methods": [ + { + "type": "default", + "script": "ct/unifi-os-server.sh", + "resources": { + "cpu": 2, + "ram": 4096, + "hdd": 20, + "os": "debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] +} diff --git a/install/unifi-os-server-install.sh b/install/unifi-os-server-install.sh new file mode 100644 index 000000000..e636401b7 --- /dev/null +++ b/install/unifi-os-server-install.sh @@ -0,0 +1,81 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://ui.com/ + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +if [[ "${CTTYPE:-1}" != "0" ]]; then + msg_error "UniFi OS Server requires a privileged LXC container." + msg_error "Recreate the container with unprivileged=0." + exit 1 +fi + +if [[ ! -e /dev/net/tun ]]; then + msg_error "Missing /dev/net/tun in container." + msg_error "Enable TUN/TAP (var_tun=yes) or add /dev/net/tun passthrough." + exit 1 +fi + +msg_info "Installing dependencies" +$STD apt install -y \ + podman \ + uidmap \ + slirp4netns +msg_ok "Installed dependencies" + +msg_info "Installing sysctl wrapper (ignore non-critical errors)" +cat <<'EOF' >/usr/local/sbin/sysctl +#!/bin/sh +/usr/sbin/sysctl "$@" || true +exit 0 +EOF +chmod +x /usr/local/sbin/sysctl +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +msg_ok "Sysctl wrapper installed" + +msg_info "Fetching latest UniFi OS Server" +API_URL="https://fw-update.ui.com/api/firmware-latest" +TEMP_JSON="$(mktemp)" +if ! curl -fsSL "$API_URL" -o "$TEMP_JSON"; then + rm -f "$TEMP_JSON" + msg_error "Failed to fetch data from Ubiquiti API" + exit 1 +fi +LATEST=$(jq -r ' + ._embedded.firmware + | map(select(.product == "unifi-os-server")) + | map(select(.platform == "linux-x64")) + | sort_by(.version_major, .version_minor, .version_patch) + | last +' "$TEMP_JSON") +UOS_VERSION=$(echo "$LATEST" | jq -r '.version' | sed 's/^v//') +UOS_URL=$(echo "$LATEST" | jq -r '._links.data.href') +rm -f "$TEMP_JSON" +if [[ -z "$UOS_URL" || -z "$UOS_VERSION" || "$UOS_URL" == "null" ]]; then + msg_error "Failed to parse UniFi OS Server version or download URL" + exit 1 +fi +msg_ok "Found UniFi OS Server ${UOS_VERSION}" + +msg_info "Downloading UniFi OS Server installer" +mkdir -p /usr/local/sbin +curl -fsSL "$UOS_URL" -o /usr/local/sbin/unifi-os-server.bin +chmod +x /usr/local/sbin/unifi-os-server.bin +msg_ok "Downloaded UniFi OS Server installer" + +msg_info "Installing UniFi OS Server (this takes a few minutes)" +$STD /usr/local/sbin/unifi-os-server.bin <<<"y" +msg_ok "UniFi OS Server installed" + +motd_ssh +customize +cleanup_lxc