Includes: - Backend services: ingestion (:8001), weather API (:8002), gateway (:8003), billing (:8004) with BTCPay integration - Shared asyncpg pool, TimescaleDB hypertable, Redis, Mosquitto MQTT - React frontend: Dashboard (MapLibre) and Messaging (chat UI) - Bridge daemon for Pi + Meshtastic (Serial/TCP T-Deck support) - Production Docker Compose, Nginx reverse proxy, ops scripts - DEPLOY.md with step-by-step deployment guide
45 lines
1.3 KiB
Bash
Executable File
45 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# One-command deploy of the KosmoConnect Bridge Daemon to a Raspberry Pi
|
|
# Run this script from your dev machine. Requires ssh access to the Pi.
|
|
|
|
PI_HOST="${1:-}"
|
|
PI_USER="${2:-pi}"
|
|
INSTALL_DIR="/opt/kosmo-bridge"
|
|
|
|
if [ -z "$PI_HOST" ]; then
|
|
echo "Usage: ./deploy-pi.sh <pi-hostname-or-ip> [pi-user]"
|
|
echo "Example: ./deploy-pi.sh 192.168.1.50 pi"
|
|
exit 1
|
|
fi
|
|
|
|
echo "=== Deploying KosmoConnect Bridge Daemon to $PI_USER@$PI_HOST ==="
|
|
|
|
# 1. Ensure target directory exists
|
|
ssh "$PI_USER@$PI_HOST" "sudo mkdir -p $INSTALL_DIR && sudo chown $PI_USER:$PI_USER $INSTALL_DIR"
|
|
|
|
# 2. Sync source files
|
|
rsync -avz --delete \
|
|
src/ \
|
|
requirements.txt \
|
|
kosmo-bridge.service \
|
|
install.sh \
|
|
"$PI_USER@$PI_HOST:$INSTALL_DIR/"
|
|
|
|
# 3. Run installer remotely
|
|
ssh "$PI_USER@$PI_HOST" "cd $INSTALL_DIR && sudo ./install.sh"
|
|
|
|
echo ""
|
|
echo "==========================================="
|
|
echo "Deployment complete."
|
|
echo ""
|
|
echo "Next steps on the Pi:"
|
|
echo " ssh $PI_USER@$PI_HOST"
|
|
echo " sudo systemctl edit --full kosmo-bridge"
|
|
echo " # Set MQTT_HOST, MESHTASTIC_HOST, etc."
|
|
echo " sudo systemctl daemon-reload"
|
|
echo " sudo systemctl restart kosmo-bridge"
|
|
echo " sudo journalctl -u kosmo-bridge -f"
|
|
echo "==========================================="
|