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:
parent
ee84468498
commit
e22a6dad6f
@ -26,6 +26,12 @@ function update_script() {
|
|||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
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) }')
|
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
|
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||||
msg_info "Stopping ${APP}"
|
msg_info "Stopping ${APP}"
|
||||||
@ -40,8 +46,8 @@ function update_script() {
|
|||||||
mv zipline-${RELEASE} /opt/zipline
|
mv zipline-${RELEASE} /opt/zipline
|
||||||
cd /opt/zipline
|
cd /opt/zipline
|
||||||
mv /opt/.env /opt/zipline/.env
|
mv /opt/.env /opt/zipline/.env
|
||||||
yarn install &>/dev/null
|
pnpm install &>/dev/null
|
||||||
yarn build &>/dev/null
|
pnpm build &>/dev/null
|
||||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||||
msg_ok "Updated ${APP}"
|
msg_ok "Updated ${APP}"
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ msg_ok "Set up Node.js Repository"
|
|||||||
msg_info "Installing Node.js"
|
msg_info "Installing Node.js"
|
||||||
$STD apt-get update
|
$STD apt-get update
|
||||||
$STD apt-get install -y nodejs
|
$STD apt-get install -y nodejs
|
||||||
$STD npm install -g yarn
|
$STD npm install -g pnpm
|
||||||
msg_ok "Installed Node.js"
|
msg_ok "Installed Node.js"
|
||||||
|
|
||||||
msg_info "Setting up PostgreSQL"
|
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
|
unzip -q v${RELEASE}.zip
|
||||||
mv zipline-${RELEASE} /opt/zipline
|
mv zipline-${RELEASE} /opt/zipline
|
||||||
cd /opt/zipline
|
cd /opt/zipline
|
||||||
mv .env.local.example .env
|
cat <<EOF >/opt/zipline/.env
|
||||||
sudo sed -i "s|CORE_SECRET=.*|CORE_SECRET=\"$SECRET_KEY\"|" /opt/zipline/.env
|
DATABASE_URL=postgres://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME
|
||||||
sudo sed -i "s|CORE_RETURN_HTTPS=.*|CORE_RETURN_HTTPS=false|" /opt/zipline/.env
|
CORE_SECRET=$SECRET_KEY
|
||||||
sudo sed -i "s|CORE_DATABASE_URL=.*|CORE_DATABASE_URL=\"postgres://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME\"|" /opt/zipline/.env
|
CORE_HOSTNAME=0.0.0.0
|
||||||
|
CORE_PORT=3000
|
||||||
CORE_RETURN_HTTPS=false
|
CORE_RETURN_HTTPS=false
|
||||||
$STD yarn install
|
EOF
|
||||||
$STD yarn build
|
$STD pnpm install
|
||||||
|
$STD pnpm build
|
||||||
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
|
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
|
||||||
msg_ok "Installed Zipline"
|
msg_ok "Installed Zipline"
|
||||||
|
|
||||||
@ -78,18 +80,17 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/opt/zipline
|
WorkingDirectory=/opt/zipline
|
||||||
ExecStart=/usr/bin/yarn start
|
ExecStart=/usr/bin/pnpm start
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
systemctl enable -q --now zipline.service
|
systemctl enable -q --now zipline
|
||||||
msg_ok "Created Service"
|
msg_ok "Created Service"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
msg_info "Cleaning up"
|
||||||
$STD apt-get -y autoremove
|
$STD apt-get -y autoremove
|
||||||
$STD apt-get -y autoclean
|
$STD apt-get -y autoclean
|
||||||
|
Loading…
x
Reference in New Issue
Block a user