From 300b4d2a3abe7e812d296c598333539b2871d1c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Wed, 10 Dec 2025 21:33:33 +0100 Subject: [PATCH] Refactor (#9838) --- ct/unifi.sh | 3 +- frontend/public/json/unifi.json | 2 +- install/unifi-install.sh | 57 +++++++-------------------------- 3 files changed, 14 insertions(+), 48 deletions(-) diff --git a/ct/unifi.sh b/ct/unifi.sh index f8bd6d9b5c..c826c0c66c 100644 --- a/ct/unifi.sh +++ b/ct/unifi.sh @@ -6,7 +6,7 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV # Source: https://ui.com/download/unifi APP="Unifi" -var_tags="${var_tags:-network;controller;unifi}" +var_tags="${var_tags:-network;unifi}" var_cpu="${var_cpu:-2}" var_ram="${var_ram:-2048}" var_disk="${var_disk:-8}" @@ -27,6 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi + msg_info "Updating ${APP}" $STD apt update --allow-releaseinfo-change $STD apt install -y unifi diff --git a/frontend/public/json/unifi.json b/frontend/public/json/unifi.json index 7b188f5093..76760c6efc 100644 --- a/frontend/public/json/unifi.json +++ b/frontend/public/json/unifi.json @@ -9,7 +9,7 @@ "updateable": true, "privileged": false, "interface_port": 8443, - "documentation": null, + "documentation": "https://help.ui.com/hc/en-us/articles/360012282453-Self-Hosting-a-UniFi-Network-Server", "website": "https://www.ui.com/", "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/ubiquiti-unifi.webp", "config_path": "", diff --git a/install/unifi-install.sh b/install/unifi-install.sh index 469ca27467..f3b1eb8d66 100644 --- a/install/unifi-install.sh +++ b/install/unifi-install.sh @@ -17,63 +17,28 @@ msg_info "Installing Dependencies" $STD apt install -y apt-transport-https msg_ok "Installed Dependencies" -msg_info "Installing Eclipse Temurin JRE" -curl -fsSL "https://packages.adoptium.net/artifactory/api/gpg/key/public" | gpg --dearmor -o /usr/share/keyrings/adoptium.gpg -cat </dev/null -Types: deb -URIs: https://packages.adoptium.net/artifactory/deb -Suites: bookworm -Components: main -Architectures: amd64 -Signed-By: /usr/share/keyrings/adoptium.gpg -EOF -$STD apt update -$STD apt install -y temurin-17-jre -msg_ok "Installed Eclipse Temurin JRE" +JAVA_VERION="17" setup_java +setup_deb822_repo \ + "unifi" \ + "https://dl.ui.com/unifi/unifi-repo.gpg" \ + "https://www.ui.com/downloads/unifi/debian" \ + "stable" \ + "ubiquiti" \ + "amd64" if ! grep -q -m1 'avx[^ ]*' /proc/cpuinfo; then - msg_ok "No AVX Support Detected" - msg_info "Installing MongoDB 4.4" + msg_warn "No AVX Support Detected. MongoDB v4.4 will be installed" if ! dpkg -l | grep -q "libssl1.1"; then curl -fsSL "https://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.1w-0+deb11u4_amd64.deb" -o "libssl1.1_1.1.1w-0+deb11u4_amd64.deb" $STD dpkg -i libssl1.1_1.1.1w-0+deb11u4_amd64.deb fi - curl -fsSL "https://www.mongodb.org/static/pgp/server-4.4.asc" | gpg --dearmor -o /usr/share/keyrings/mongodb-server-4.4.gpg - cat </dev/null -Types: deb -URIs: https://repo.mongodb.org/apt/debian -Suites: buster/mongodb-org/4.4 -Components: main -Signed-By: /usr/share/keyrings/mongodb-server-4.4.gpg -EOF - $STD apt update - $STD apt install -y mongodb-org + MONGO_VERSION="4.4" setup_mongodb else - msg_info "Installing MongoDB 7.0" - curl -fsSL "https://www.mongodb.org/static/pgp/server-7.0.asc" | gpg --dearmor -o /usr/share/keyrings/mongodb-server-7.0.gpg - cat </dev/null -Types: deb -URIs: http://repo.mongodb.org/apt/debian -Suites: bookworm/mongodb-org/7.0 -Components: main -Signed-By: /usr/share/keyrings/mongodb-server-7.0.gpg -EOF - $STD apt update - $STD apt install -y mongodb-org + MONGO_VERSION="7.0" setup_mongodb fi msg_ok "Installed MongoDB" msg_info "Installing UniFi Network Server" -curl -fsSL "https://dl.ui.com/unifi/unifi-repo.gpg" -o "/usr/share/keyrings/unifi-repo.gpg" -cat </dev/null -Types: deb -URIs: https://www.ui.com/downloads/unifi/debian -Suites: stable -Components: ubiquiti -Architectures: amd64 -Signed-By: /usr/share/keyrings/unifi-repo.gpg -EOF -$STD apt update $STD apt install -y unifi msg_ok "Installed UniFi Network Server"