Files
ProxmoxVE/install/zipline-install.sh

60 lines
1.4 KiB
Bash
Raw Normal View History

2024-09-16 22:04:30 +02:00
#!/usr/bin/env bash
# Copyright (c) 2021-2026 tteck
2024-09-16 22:04:30 +02:00
# Author: tteck
# Co-Author: MickLesk (Canbiz)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
2024-09-16 22:04:30 +02:00
# Source: https://github.com/diced/zipline
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
2024-09-16 22:04:30 +02:00
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
2025-10-07 21:23:56 +02:00
NODE_VERSION="22" NODE_MODULE="pnpm" setup_nodejs
PG_VERSION="17" setup_postgresql
PG_DB_NAME="ziplinedb" PG_DB_USER="zipline" setup_postgresql_db
2025-08-14 21:05:44 +02:00
fetch_and_deploy_gh_release "zipline" "diced/zipline" "tarball"
2025-02-17 22:08:30 +01:00
SECRET_KEY="$(openssl rand -base64 42 | tr -dc 'a-zA-Z0-9')"
echo "Zipline Secret Key: ${SECRET_KEY}" >>~/zipline.creds
2024-09-16 22:04:30 +02:00
msg_info "Installing Zipline (Patience)"
2026-01-06 13:45:03 +01:00
cd /opt/zipline
cat <<EOF >/opt/zipline/.env
DATABASE_URL=postgres://$PG_DB_USER:$PG_DB_PASS@localhost:5432/$PG_DB_NAME
CORE_SECRET=$SECRET_KEY
CORE_HOSTNAME=0.0.0.0
CORE_PORT=3000
2024-09-16 22:04:30 +02:00
CORE_RETURN_HTTPS=false
DATASOURCE_TYPE=local
2025-07-03 12:53:30 +02:00
DATASOURCE_LOCAL_DIRECTORY=/opt/zipline-uploads
EOF
2025-07-03 12:53:30 +02:00
mkdir -p /opt/zipline-uploads
$STD pnpm install
$STD pnpm build
2024-09-16 22:04:30 +02:00
msg_ok "Installed Zipline"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/zipline.service
[Unit]
Description=Zipline Service
After=network.target
[Service]
WorkingDirectory=/opt/zipline
ExecStart=/usr/bin/pnpm start
2024-09-16 22:04:30 +02:00
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now zipline
2024-09-16 22:04:30 +02:00
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc