Refactor (#9838)
This commit is contained in:
parent
0ed1e36d9d
commit
300b4d2a3a
@ -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
|
||||
|
||||
@ -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": "",
|
||||
|
||||
@ -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 <<EOF | sudo tee /etc/apt/sources.list.d/adoptium.sources >/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 <<EOF | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.sources >/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 <<EOF | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.sources >/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 <<EOF | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.sources >/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"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user