diff --git a/ct/zipline.sh b/ct/zipline.sh index 63c1c8479..4f5905847 100644 --- a/ct/zipline.sh +++ b/ct/zipline.sh @@ -26,6 +26,12 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi + if ! command -v pnpm &>/dev/null; then + msg_info "Installing pnpm" + #export NODE_OPTIONS=--openssl-legacy-provider + npm install -g pnpm@latest &>/dev/null + msg_ok "Installed pnpm" + fi RELEASE=$(curl -s https://api.github.com/repos/diced/zipline/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then msg_info "Stopping ${APP}" @@ -40,8 +46,8 @@ function update_script() { mv zipline-${RELEASE} /opt/zipline cd /opt/zipline mv /opt/.env /opt/zipline/.env - yarn install &>/dev/null - yarn build &>/dev/null + pnpm install &>/dev/null + pnpm build &>/dev/null echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Updated ${APP}" @@ -66,4 +72,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" diff --git a/install/zipline-install.sh b/install/zipline-install.sh index 3584aea7b..1380da9c7 100644 --- a/install/zipline-install.sh +++ b/install/zipline-install.sh @@ -33,7 +33,7 @@ msg_ok "Set up Node.js Repository" msg_info "Installing Node.js" $STD apt-get update $STD apt-get install -y nodejs -$STD npm install -g yarn +$STD npm install -g pnpm msg_ok "Installed Node.js" msg_info "Setting up PostgreSQL" @@ -60,13 +60,15 @@ wget -q "https://github.com/diced/zipline/archive/refs/tags/v${RELEASE}.zip" unzip -q v${RELEASE}.zip mv zipline-${RELEASE} /opt/zipline cd /opt/zipline -mv .env.local.example .env -sudo sed -i "s|CORE_SECRET=.*|CORE_SECRET=\"$SECRET_KEY\"|" /opt/zipline/.env -sudo sed -i "s|CORE_RETURN_HTTPS=.*|CORE_RETURN_HTTPS=false|" /opt/zipline/.env -sudo sed -i "s|CORE_DATABASE_URL=.*|CORE_DATABASE_URL=\"postgres://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME\"|" /opt/zipline/.env +cat </opt/zipline/.env +DATABASE_URL=postgres://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME +CORE_SECRET=$SECRET_KEY +CORE_HOSTNAME=0.0.0.0 +CORE_PORT=3000 CORE_RETURN_HTTPS=false -$STD yarn install -$STD yarn build +EOF +$STD pnpm install +$STD pnpm build echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" msg_ok "Installed Zipline" @@ -78,18 +80,17 @@ After=network.target [Service] WorkingDirectory=/opt/zipline -ExecStart=/usr/bin/yarn start +ExecStart=/usr/bin/pnpm start Restart=on-failure [Install] WantedBy=multi-user.target EOF -systemctl enable -q --now zipline.service +systemctl enable -q --now zipline msg_ok "Created Service" motd_ssh customize - msg_info "Cleaning up" $STD apt-get -y autoremove $STD apt-get -y autoclean