Install MongoDB 4.2 for non-AVX CPUs in Unifi LXC (#319)

* Put in check and alternative to install older Mongo for CPUs that can't support AVX

* Update install/unifi-install.sh

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>

* Update install/unifi-install.sh

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>

* Update install/unifi-install.sh

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>

* Update install/unifi-install.sh

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>

* Update install/unifi-install.sh

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>

* Update install/unifi-install.sh

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>

* Update install/unifi-install.sh

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>

* Update install/unifi-install.sh

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>

* Update json/unifi.json

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>

* Update json/unifi.json

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>

* Update json/unifi.json

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>

* Update install/unifi-install.sh

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>

* Update install/unifi-install.sh

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>

* Update install/unifi-install.sh

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>

* Update install/unifi-install.sh

Updated suggested changes

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>

* Update json/unifi.json

Updated Suggested Changes

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>

* Update install/unifi-install.sh

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>

* Update unifi.sh

* Update unifi.json

---------

Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com>
This commit is contained in:
DarmokNoob 2024-11-27 06:53:44 -08:00 committed by GitHub
parent a2ae582992
commit 60b9103a34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 11 deletions

View File

@ -17,10 +17,6 @@ cat <<"EOF"
EOF
}
header_info
if ! grep -q -m1 'avx[^ ]*' /proc/cpuinfo; then
echo "AVX instruction set is not supported on this CPU."
exit
fi
echo -e "Loading..."
APP="Unifi"
var_disk="8"

View File

@ -28,11 +28,25 @@ $STD apt-get update
$STD apt-get install -y temurin-17-jre
msg_ok "Installed Eclipse Temurin JRE"
msg_info "Installing MongoDB"
wget -qO- https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor >/usr/share/keyrings/mongodb-server-7.0.gpg
echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] http://repo.mongodb.org/apt/debian bookworm/mongodb-org/7.0 main" >/etc/apt/sources.list.d/mongodb-org-7.0.list
$STD apt-get update
$STD apt-get install -y mongodb-org
if grep -q 'avx' /proc/cpuinfo; then
msg_ok "No AVX Support Detected"
msg_info "Installing MongoDB 4.2"
if ! dpkg -l | grep -q "libssl1.1"; then
wget -q http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.1n-0+deb10u6_amd64.deb
$STD dpkg -i libssl1.1_1.1.1n-0+deb10u6_amd64.deb
$STD apt-get install -f -y # Fix any broken dependencies
fi
wget -qO- https://www.mongodb.org/static/pgp/server-4.2.asc | gpg --dearmor > /usr/share/keyrings/mongodb-server-4.2.gpg
echo "deb [signed-by=/usr/share/keyrings/mongodb-server-4.2.gpg] https://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" >/etc/apt/sources.list.d/mongodb-org-4.2.list
$STD apt-get update
$STD apt-get install -y mongodb-org=4.2.17
else
msg_info "Installing MongoDB 7.0"
wget -qO- https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor >/usr/share/keyrings/mongodb-server-7.0.gpg
echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] http://repo.mongodb.org/apt/debian bookworm/mongodb-org/7.0 main" >/etc/apt/sources.list.d/mongodb-org-7.0.list
$STD apt-get update
$STD apt-get install -y mongodb-org
fi
msg_ok "Installed MongoDB"
msg_info "Installing UniFi Network Server"

View File

@ -32,8 +32,8 @@
},
"notes": [
{
"text": "CPU with AVX Instruction Set required",
"text": "For non-AVX CPUs, MongoDB 4.2 is installed. Please note this is a legacy solution that may present security risks and could become unsupported in future updates.",
"type": "warning"
}
]
}
}