@@ -24,7 +24,7 @@ msg_ok "Installed Dependencies"
2424setup_mongodb
2525NODE_VERSION=" 22" setup_nodejs
2626
27- msg_info " Configure MongoDB"
27+ msg_info " Configuring MongoDB"
2828MONGO_ADMIN_USER=" admin"
2929MONGO_ADMIN_PWD=" $( openssl rand -base64 18 | cut -c1-13) "
3030NODEBB_USER=" nodebb"
@@ -63,14 +63,11 @@ sed -i 's/bindIp: 127.0.0.1/bindIp: 0.0.0.0/' /etc/mongod.conf
6363sed -i ' /security:/d' /etc/mongod.conf
6464bash -c ' echo -e "\nsecurity:\n authorization: enabled" >> /etc/mongod.conf'
6565systemctl restart mongod
66- msg_ok " MongoDB successfully configurated"
67-
68- msg_info " Install NodeBB"
69- cd /opt
70- RELEASE=$( curl -fsSL https://api.github.com/repos/NodeBB/NodeBB/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
71- curl -fsSL " https://github.com/NodeBB/NodeBB/archive/refs/tags/v${RELEASE} .zip" -o " /opt/v${RELEASE} .zip"
72- $STD unzip v${RELEASE} .zip
73- mv NodeBB-${RELEASE} /opt/nodebb
66+ msg_ok " MongoDB configured"
67+
68+ fetch_and_deploy_gh_release " nodebb" " NodeBB/NodeBB" " tarball"
69+
70+ msg_info " Configuring NodeBB"
7471cd /opt/nodebb
7572touch pidfile
7673expect << EOF >/dev/null 2>&1
@@ -107,8 +104,7 @@ expect "Confirm Password" {
107104}
108105expect eof
109106EOF
110- echo " ${RELEASE} " > " /opt/${APPLICATION} _version.txt"
111- msg_ok " Installed NodeBB"
107+ msg_ok " Configured NodeBB"
112108
113109msg_info " Creating Services"
114110cat << EOF >/etc/systemd/system/nodebb.service
@@ -136,7 +132,6 @@ motd_ssh
136132customize
137133
138134msg_info " Cleaning up"
139- rm -R /opt/v${RELEASE} .zip
140135$STD apt-get -y autoremove
141136$STD apt-get -y autoclean
142137msg_ok " Cleaned"
0 commit comments