From 3665f7941e79961005a2e6c85a7e15c2e5c70bff Mon Sep 17 00:00:00 2001 From: RallyBlock <50393307+RallyBlock@users.noreply.github.com> Date: Thu, 22 Oct 2026 14:08:14 -0700 Subject: [PATCH] Install the sync server from this repo now that the separate installer is gone. --- .gitattributes | 3 -- sync/ct/pitlog.sh | 8 ---- sync/egg-pitlog.yaml | 6 +-- sync/install/pitlog-install.sh | 57 ----------------------------- sync/pitlog-sync-install.sh | 67 ---------------------------------- sync/pitlog_sync.py | 32 ---------------- sync/proxmox-helper.sh | 8 ---- 7 files changed, 3 insertions(+), 178 deletions(-) delete mode 100644 sync/ct/pitlog.sh delete mode 100644 sync/install/pitlog-install.sh delete mode 100644 sync/pitlog-sync-install.sh delete mode 100644 sync/proxmox-helper.sh diff --git a/.gitattributes b/.gitattributes index 26f3779..a1e4087 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,2 @@ -sync/*.sh text eol=lf sync/*.py text eol=lf sync/*.yaml text eol=lf -sync/**/*.sh text eol=lf -sync/**/*.py text eol=lf diff --git a/sync/ct/pitlog.sh b/sync/ct/pitlog.sh deleted file mode 100644 index 8ad4366..0000000 --- a/sync/ct/pitlog.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -# Pit Log sync runs on the Pelican panel. This script does not create a container. -echo "Pit Log sync uses the Pelican panel you already have." -echo "In the panel, import this egg:" -echo "https://git.ny.daprogs.com/RallyBlock/Pit-Log-App-Server-Installer-Proxmox/raw/branch/main/egg-pitlog.yaml" -echo "Then create a server from Pit Log sync, give it one port, and start it." -echo "The console prints the token. On each phone, open Car and enter http://NODE:PORT plus that token." -exit 0 diff --git a/sync/egg-pitlog.yaml b/sync/egg-pitlog.yaml index d5301aa..8fa4954 100644 --- a/sync/egg-pitlog.yaml +++ b/sync/egg-pitlog.yaml @@ -1,11 +1,11 @@ meta: version: PLCN_v3 - update_url: https://git.ny.daprogs.com/RallyBlock/Pit-Log-App-Server-Installer-Proxmox/raw/branch/main/egg-pitlog.yaml + update_url: https://git.ny.daprogs.com/RallyBlock/Pit-Log-App/raw/branch/main/sync/egg-pitlog.yaml exported_at: '2026-10-22T20:00:00+00:00' name: Pit Log sync author: pitlog@ny.daprogs.com uuid: 4f8c2e91-6b3a-4d17-9e50-a1c7d8b24f06 -description: Sync server for the Pit Log phone app. Create this on the existing Pelican panel. The console prints the address port and the token. +description: Sync server for the Pit Log phone app. Create this on the existing Pelican panel. Phones use this server's address and the token from each car. tags: {} features: {} docker_images: @@ -28,7 +28,7 @@ scripts: apt-get update apt-get install -y curl ca-certificates mkdir -p /mnt/server - curl -fsSL "https://git.ny.daprogs.com/RallyBlock/Pit-Log-App-Server-Installer-Proxmox/raw/branch/main/pitlog_sync.py" -o /mnt/server/pitlog_sync.py + curl -fsSL "https://git.ny.daprogs.com/RallyBlock/Pit-Log-App/raw/branch/main/sync/pitlog_sync.py" -o /mnt/server/pitlog_sync.py test -s /mnt/server/pitlog_sync.py echo "install complete" exit 0 diff --git a/sync/install/pitlog-install.sh b/sync/install/pitlog-install.sh deleted file mode 100644 index 9a49b1f..0000000 --- a/sync/install/pitlog-install.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env bash - -# Pit Log sync. Runs inside the container the helper script just created. - -source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" -color -verb_ip6 -catch_errors -setting_up_container -network_check -update_os - -PITLOG_BASE="https://git.ny.daprogs.com/RallyBlock/Pit-Log-App-Server-Installer-Proxmox/raw/branch/main" - -msg_info "Installing Pit Log sync" -$STD apt-get update -$STD apt-get install -y python3 openssl ca-certificates -install -d -o root -g root -m 755 /opt/pitlog -if ! id pitlog >/dev/null 2>&1; then - useradd --system --home-dir /var/lib/pitlog --shell /usr/sbin/nologin pitlog -fi -install -d -o pitlog -g pitlog -m 750 /var/lib/pitlog /etc/pitlog -curl -fsSL "${PITLOG_BASE}/pitlog_sync.py" -o /opt/pitlog/pitlog_sync.py -chown root:pitlog /opt/pitlog/pitlog_sync.py -chmod 640 /opt/pitlog/pitlog_sync.py -if [[ ! -s /etc/pitlog/token ]]; then - openssl rand -hex 32 >/etc/pitlog/token -fi -chown root:pitlog /etc/pitlog/token -chmod 640 /etc/pitlog/token -cat >/etc/systemd/system/pitlog-sync.service <<'EOF' -[Unit] -Description=Pit Log sync -After=network-online.target -Wants=network-online.target - -[Service] -Type=simple -User=pitlog -Group=pitlog -Environment=PITLOG_TOKEN_FILE=/etc/pitlog/token -Environment=PITLOG_DB=/var/lib/pitlog/sync.db -Environment=PITLOG_PORT=8787 -ExecStart=/usr/bin/python3 /opt/pitlog/pitlog_sync.py -Restart=on-failure -RestartSec=2 - -[Install] -WantedBy=multi-user.target -EOF -systemctl daemon-reload -systemctl enable -q --now pitlog-sync.service -msg_ok "Installed Pit Log sync" - -motd_ssh -customize -cleanup_lxc diff --git a/sync/pitlog-sync-install.sh b/sync/pitlog-sync-install.sh deleted file mode 100644 index adcb698..0000000 --- a/sync/pitlog-sync-install.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env bash -# Install the Pit Log sync service on Debian or Ubuntu. -# The Proxmox helper runs this inside the new container. -set -euo pipefail - -if [[ "$(id -u)" -ne 0 ]]; then - echo "Run this as root inside the container." - exit 1 -fi - -export DEBIAN_FRONTEND=noninteractive -apt-get update -apt-get install -y python3 openssl ca-certificates - -install -d -o root -g root -m 755 /opt/pitlog -if ! id pitlog >/dev/null 2>&1; then - useradd --system --home-dir /var/lib/pitlog --shell /usr/sbin/nologin pitlog -fi -install -d -o pitlog -g pitlog -m 750 /var/lib/pitlog /etc/pitlog - -SOURCE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/pitlog_sync.py" -if [[ ! -f "$SOURCE" && -f /tmp/pitlog_sync.py ]]; then - SOURCE=/tmp/pitlog_sync.py -fi -if [[ ! -f "$SOURCE" ]]; then - echo "pitlog_sync.py was not next to this script." - exit 1 -fi -install -o root -g pitlog -m 640 "$SOURCE" /opt/pitlog/pitlog_sync.py - -if [[ ! -s /etc/pitlog/token ]]; then - openssl rand -hex 32 > /etc/pitlog/token -fi -chown root:pitlog /etc/pitlog/token -chmod 640 /etc/pitlog/token - -PORT="${PITLOG_PORT:-8787}" -cat > /etc/systemd/system/pitlog-sync.service <