Compare commits

...

5 Commits

Author SHA1 Message Date
54929e4b0d Update zipline-install.sh
Some checks are pending
Auto Update .app-files / update-app-files (push) Waiting to run
Shellcheck / Shellcheck (push) Waiting to run
Create Changelog Pull Request / update-changelog-pull-request (push) Waiting to run
2025-02-17 22:08:30 +01:00
ca20d52ac1 Update CHANGELOG.md (#2456)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-17 20:28:19 +01:00
e22a6dad6f Zipline: Prepare for Version 4.0.0 (#2455)
* Fix: Zipline Installation for V4

* Fix Zipline
2025-02-17 20:22:34 +01:00
ee84468498 Update CHANGELOG.md (#2445)
Some checks are pending
Shellcheck / Shellcheck (push) Waiting to run
Create Changelog Pull Request / update-changelog-pull-request (push) Waiting to run
2025-02-17 09:44:45 +01:00
746f19b0b8 Update zipline-install.sh (#2444)
Updated secret generation inline with official docs
2025-02-17 08:30:34 +01:00
3 changed files with 34 additions and 15 deletions

View File

@ -17,6 +17,18 @@ All LXC instances created using this repository come pre-installed with Midnight
Do not break established syntax in this file, as it is automatically updated by a Github Workflow
## 2025-02-17
### Changes
### 💥 Breaking Changes
- Zipline: Prepare for Version 4.0.0 [@MickLesk](https://github.com/MickLesk) ([#2455](https://github.com/community-scripts/ProxmoxVE/pull/2455))
### 🚀 Updated Scripts
- Fix: Zipline increase SECRET to 42 chars [@V1d1o7](https://github.com/V1d1o7) ([#2444](https://github.com/community-scripts/ProxmoxVE/pull/2444))
## 2025-02-16
### Changes

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,14 +33,14 @@ 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"
DB_NAME=ziplinedb
DB_USER=zipline
DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
SECRET_KEY="$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
SECRET_KEY="$(openssl rand -base64 42 | tr -dc 'a-zA-Z0-9')"
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
@ -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,19 +80,18 @@ 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
msg_ok "Cleaned"
msg_ok "Cleaned"