Files
ProxmoxVE/install/tracktor-install.sh
T

70 lines
1.9 KiB
Bash
Raw Normal View History

2025-08-26 14:14:52 +02:00
#!/usr/bin/env bash
2026-01-06 22:57:40 +01:00
# Copyright (c) 2021-2026 community-scripts ORG
2025-08-26 14:14:52 +02:00
# Author: CrazyWolf13
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://tracktor.bytedge.in | Github: https://github.com/javedh-dev/tracktor
2025-08-26 14:14:52 +02:00
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
NODE_VERSION="22" NODE_MODULE="pnpm" setup_nodejs
2025-08-26 14:14:52 +02:00
fetch_and_deploy_gh_release "tracktor" "javedh-dev/tracktor" "tarball" "latest" "/opt/tracktor"
msg_info "Configuring Tracktor"
cd /opt/tracktor
$STD pnpm install --frozen-lockfile
$STD pnpm run build
2025-10-29 15:44:10 +01:00
mkdir -p /opt/tracktor-data/{uploads,logs}
cat <<EOF >/opt/tracktor.env
2025-08-26 14:14:52 +02:00
NODE_ENV=production
# Set this to the path of the database file. Default - ./tracktor.db
2025-08-26 14:14:52 +02:00
DB_PATH=/opt/tracktor-data/tracktor.db
# Set this to the path of the uploads directory. Default - ./uploads
2025-10-29 15:44:10 +01:00
UPLOADS_DIR="/opt/tracktor-data/uploads"
# Set this to the path of the logs directory. Default - ./logs
2025-10-29 15:44:10 +01:00
LOG_DIR="/opt/tracktor-data/logs"
# Hostname to bind the server to. Default - 0.0.0.0
#HOST="0.0.0.0"
# Port to bind the server to. Default - 3000
#PORT=3000
# Set this to remove upload size limitations. Default - 512 Kb
BODY_SIZE_LIMIT=Infinity
# Enable request logging. Default - true
#LOG_REQUESTS=true
# Set the logging level. Options - error, warn, info, verbose, debug, silly. Default - info
#LOG_LEVEL="info"
# Enable demo mode. Default - false
#TRACKTOR_DEMO_MODE=false
# Force reseeding of data on every startup. Default - false
#FORCE_DATA_SEED=false
2025-08-26 14:14:52 +02:00
EOF
msg_ok "Configured Tracktor"
msg_info "Creating service"
cat <<EOF >/etc/systemd/system/tracktor.service
[Unit]
Description=Tracktor Service
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/tracktor
EnvironmentFile=/opt/tracktor.env
2025-08-26 14:14:52 +02:00
ExecStart=/usr/bin/npm start
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now tracktor
msg_ok "Created service"
motd_ssh
customize
cleanup_lxc