Skip to content

Commit 300b4d2

Browse files
authored
Refactor (#9838)
1 parent 0ed1e36 commit 300b4d2

File tree

3 files changed

+14
-48
lines changed

3 files changed

+14
-48
lines changed

ct/unifi.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
66
# Source: https://ui.com/download/unifi
77

88
APP="Unifi"
9-
var_tags="${var_tags:-network;controller;unifi}"
9+
var_tags="${var_tags:-network;unifi}"
1010
var_cpu="${var_cpu:-2}"
1111
var_ram="${var_ram:-2048}"
1212
var_disk="${var_disk:-8}"
@@ -27,6 +27,7 @@ function update_script() {
2727
msg_error "No ${APP} Installation Found!"
2828
exit
2929
fi
30+
3031
msg_info "Updating ${APP}"
3132
$STD apt update --allow-releaseinfo-change
3233
$STD apt install -y unifi

frontend/public/json/unifi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"updateable": true,
1010
"privileged": false,
1111
"interface_port": 8443,
12-
"documentation": null,
12+
"documentation": "https://help.ui.com/hc/en-us/articles/360012282453-Self-Hosting-a-UniFi-Network-Server",
1313
"website": "https://www.ui.com/",
1414
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/ubiquiti-unifi.webp",
1515
"config_path": "",

install/unifi-install.sh

Lines changed: 11 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -17,63 +17,28 @@ msg_info "Installing Dependencies"
1717
$STD apt install -y apt-transport-https
1818
msg_ok "Installed Dependencies"
1919

20-
msg_info "Installing Eclipse Temurin JRE"
21-
curl -fsSL "https://packages.adoptium.net/artifactory/api/gpg/key/public" | gpg --dearmor -o /usr/share/keyrings/adoptium.gpg
22-
cat <<EOF | sudo tee /etc/apt/sources.list.d/adoptium.sources >/dev/null
23-
Types: deb
24-
URIs: https://packages.adoptium.net/artifactory/deb
25-
Suites: bookworm
26-
Components: main
27-
Architectures: amd64
28-
Signed-By: /usr/share/keyrings/adoptium.gpg
29-
EOF
30-
$STD apt update
31-
$STD apt install -y temurin-17-jre
32-
msg_ok "Installed Eclipse Temurin JRE"
20+
JAVA_VERION="17" setup_java
21+
setup_deb822_repo \
22+
"unifi" \
23+
"https://dl.ui.com/unifi/unifi-repo.gpg" \
24+
"https://www.ui.com/downloads/unifi/debian" \
25+
"stable" \
26+
"ubiquiti" \
27+
"amd64"
3328

3429
if ! grep -q -m1 'avx[^ ]*' /proc/cpuinfo; then
35-
msg_ok "No AVX Support Detected"
36-
msg_info "Installing MongoDB 4.4"
30+
msg_warn "No AVX Support Detected. MongoDB v4.4 will be installed"
3731
if ! dpkg -l | grep -q "libssl1.1"; then
3832
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"
3933
$STD dpkg -i libssl1.1_1.1.1w-0+deb11u4_amd64.deb
4034
fi
41-
curl -fsSL "https://www.mongodb.org/static/pgp/server-4.4.asc" | gpg --dearmor -o /usr/share/keyrings/mongodb-server-4.4.gpg
42-
cat <<EOF | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.sources >/dev/null
43-
Types: deb
44-
URIs: https://repo.mongodb.org/apt/debian
45-
Suites: buster/mongodb-org/4.4
46-
Components: main
47-
Signed-By: /usr/share/keyrings/mongodb-server-4.4.gpg
48-
EOF
49-
$STD apt update
50-
$STD apt install -y mongodb-org
35+
MONGO_VERSION="4.4" setup_mongodb
5136
else
52-
msg_info "Installing MongoDB 7.0"
53-
curl -fsSL "https://www.mongodb.org/static/pgp/server-7.0.asc" | gpg --dearmor -o /usr/share/keyrings/mongodb-server-7.0.gpg
54-
cat <<EOF | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.sources >/dev/null
55-
Types: deb
56-
URIs: http://repo.mongodb.org/apt/debian
57-
Suites: bookworm/mongodb-org/7.0
58-
Components: main
59-
Signed-By: /usr/share/keyrings/mongodb-server-7.0.gpg
60-
EOF
61-
$STD apt update
62-
$STD apt install -y mongodb-org
37+
MONGO_VERSION="7.0" setup_mongodb
6338
fi
6439
msg_ok "Installed MongoDB"
6540

6641
msg_info "Installing UniFi Network Server"
67-
curl -fsSL "https://dl.ui.com/unifi/unifi-repo.gpg" -o "/usr/share/keyrings/unifi-repo.gpg"
68-
cat <<EOF | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.sources >/dev/null
69-
Types: deb
70-
URIs: https://www.ui.com/downloads/unifi/debian
71-
Suites: stable
72-
Components: ubiquiti
73-
Architectures: amd64
74-
Signed-By: /usr/share/keyrings/unifi-repo.gpg
75-
EOF
76-
$STD apt update
7742
$STD apt install -y unifi
7843
msg_ok "Installed UniFi Network Server"
7944

0 commit comments

Comments
 (0)