From 579012ae3036ad10e0b45fecb93ecd6b94d490d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20B=C3=A9dard-Couture?= Date: Wed, 12 Jun 2024 22:50:55 -0400 Subject: [PATCH] Silence peanut installation and update service configuration --- ct/peanut.sh | 3 ++- install/peanut-install.sh | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ct/peanut.sh b/ct/peanut.sh index 1d63b30b..005c47ba 100644 --- a/ct/peanut.sh +++ b/ct/peanut.sh @@ -82,4 +82,5 @@ pct set $CTID -cores 1 msg_ok "Set Container to Normal Resources" msg_ok "Completed Successfully!\n" echo -e "${APP} should be reachable by going to the following URL. - ${BL}http://${IP}:8080${CL} \n" + ${BL}http://${IP}:3000${CL} \n + ${YW}Don't forget to update the NUT configuration!${CL} \n" diff --git a/install/peanut-install.sh b/install/peanut-install.sh index a60b7047..53414929 100644 --- a/install/peanut-install.sh +++ b/install/peanut-install.sh @@ -23,7 +23,6 @@ $STD apt-get install -y gpg msg_ok "Installed Dependencies" msg_info "Installing Node.js" -#curl -fsSL https://deb.nodesource.com/setup_21.x | bash - && apt-get install -y nodejs mkdir -p /etc/apt/keyrings curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list @@ -31,6 +30,10 @@ $STD apt-get update $STD apt-get install -y nodejs msg_ok "Installed Node.js" +msg_info "Installing NUT" +$STD apt-get install -y nut-client +msg_ok "Installed NUT" + msg_info "Installing Peanut" RELEASE_URL=$(curl -s https://api.github.com/repos/Brandawg93/PeaNUT/releases/latest | grep "tarball_url" | awk '{print substr($2, 2, length($2)-3)}') wget -qO peanut.tar.gz $RELEASE_URL @@ -38,13 +41,10 @@ mkdir -p /opt/peanut tar -xzf peanut.tar.gz -C /opt/peanut --strip-components 1 rm peanut.tar.gz cd /opt/peanut -npm install -g pnpm -pnpm i -#pnpm run build -#pnpm run build:local -npm run build && cp -r .next/static .next/standalone/.next/ -#pnpm run start:local -node .next/standalone/server.js +$STD npm install -g pnpm +$STD pnpm i +$STD npm run build +cp -r .next/static .next/standalone/.next/ msg_ok "Installed Peanut" msg_info "Creating Service" @@ -61,9 +61,9 @@ Environment="NODE_ENV=production" Environment="NUT_HOST=localhost" Environment="NUT_PORT=3493" Environment="WEB_HOST=0.0.0.0" -Environment="WEB_PORT=8080" +Environment="WEB_PORT=3000" WorkingDirectory=/opt/peanut -ExecStart=/opt/peanut/peanut +ExecStart=node /opt/peanut/.next/standalone/server.js TimeoutStopSec=30 [Install] WantedBy=multi-user.target