1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-03-08 13:19:05 +00:00

Zipline: Prepare for Version 4.0.0 (#2455)

* Fix: Zipline Installation for V4

* Fix Zipline
This commit is contained in:
CanbiZ 2025-02-17 20:22:34 +01:00 committed by GitHub
parent ee84468498
commit e22a6dad6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 13 deletions

View File

@ -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}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"

View File

@ -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 <<EOF >/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