initial commit: rclone sync stack with monitoring UI

This commit is contained in:
seekr
2026-08-07 09:36:35 +00:00
commit 11c1a29b60
68 changed files with 4118 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
# Copy to .env and fill in. Values below match JAGAN's test machine —
# adjust PRIMARY/SECONDARY paths for other machines (see their generated
# docker-compose.yml header comments).
# identity shown on the dashboard — must be unique per machine
MACHINE_ID=JAGAN-TEST-01
SITE=TEST
# where the monitoring collector is reachable FROM THIS MACHINE
# (Tailscale IP of the collector's host, port 8000)
COLLECTOR_URL=http://100.x.y.z:8000
# shared secret — must exactly match AGENT_TOKEN on the collector
AGENT_TOKEN=change-me
# paths from this machine's existing docker-compose.yml (rclone-synology-sync volumes)
SYNC_LOGS_DIR=/home/testing/JAGAN/Prerequisites/Sync_logs
IMAGE_DIR=/home/testing/JAGAN/Prerequisites/TAKELEAP/image_root_dir
CSV_DIR=/home/testing/JAGAN/Prerequisites/csv_files

View File

@@ -0,0 +1,30 @@
# =============================================================================
# AGENT-ONLY BUNDLE — for a machine that ALREADY runs the production
# rclone-synology-sync container (e.g. JAGAN's test machine).
# Adds monitoring only; touches nothing in the existing stack.
#
# 1. Copy this folder + the repo's monitor/agent/ folder to the machine:
# agent-deploy/
# ├── docker-compose.yml (this file)
# ├── .env (from .env.example)
# └── agent/ (= monitor/agent/: agent.py + Dockerfile)
# 2. Fill .env
# 3. docker compose up -d --build
# =============================================================================
services:
rclone-agent:
build: ./agent
container_name: rclone-agent
environment:
- MACHINE_ID=${MACHINE_ID}
- SITE=${SITE}
- COLLECTOR_URL=${COLLECTOR_URL}
- AGENT_TOKEN=${AGENT_TOKEN}
- WATCH_DIRS=/sources/image_root_dir,/sources/csv_files
volumes:
# the EXISTING sync container's log folder (read-only)
- ${SYNC_LOGS_DIR}:/logs:ro
# the up-pair source folders (read-only) — enables pending/missing detection
- ${IMAGE_DIR}:/sources/image_root_dir:ro
- ${CSV_DIR}:/sources/csv_files:ro
restart: unless-stopped

View File

@@ -0,0 +1,23 @@
# Copy to .env and fill in. NEVER commit the filled-in version.
# --- identity shown in the dashboard ---
MACHINE_ID=FRIEND-01
SITE=FRIEND
# --- where the algorithm writes its results on this machine ---
OUTPUT_DIR=/home/friend/algorithm/output
# --- Synology / SFTP target (get real values from the team; do not reuse demo ones) ---
SYNOLOGY_HOST=your-nas-hostname
SYNOLOGY_PORT=22
SYNOLOGY_USER=upload-user
SYNOLOGY_PASS=change-me
REMOTE_BASE=ClientSync/Results
# --- monitoring ---
# The collector's address AS REACHABLE FROM THIS MACHINE.
# Same LAN: http://<your-lan-ip>:8000 · over internet: use Tailscale/VPN IP
COLLECTOR_URL=http://100.0.0.0:8000
# Must match AGENT_TOKEN on the collector
AGENT_TOKEN=change-me
RC_PASSWORD=change-me

View File

@@ -0,0 +1,43 @@
# =============================================================================
# REMOTE MACHINE BUNDLE — run on any machine that should appear in the fleet UI
# (e.g. a friend's system running his algorithm and syncing results).
#
# Setup on the remote machine:
# 1. Copy the repo's `sync-container/` and `monitor/agent/` folders next to
# this file (or copy the whole repo and use this file from deploy/remote-machine).
# 2. Fill in .env (see .env.example).
# 3. Put the algorithm's output folder in OUTPUT_DIR — anything written there
# is synced up and monitored.
# 4. docker compose up -d --build
# =============================================================================
services:
rclone-sync:
build: ../../sync-container
container_name: rclone-sync
environment:
- SYNOLOGY_HOST=${SYNOLOGY_HOST}
- SYNOLOGY_PORT=${SYNOLOGY_PORT}
- SYNOLOGY_USER=${SYNOLOGY_USER}
- SYNOLOGY_PASS=${SYNOLOGY_PASS}
- RC_PASSWORD=${RC_PASSWORD}
- SYNC_INTERVAL=120
# results go UP to the server under this machine's own path
- SYNC_1=up:/sources/results:${REMOTE_BASE}/${MACHINE_ID}
volumes:
- ${OUTPUT_DIR}:/sources/results:ro
- ./Sync_logs:/logs
restart: unless-stopped
agent:
build: ../../monitor/agent
container_name: rclone-agent
environment:
- MACHINE_ID=${MACHINE_ID}
- SITE=${SITE}
- COLLECTOR_URL=${COLLECTOR_URL} # e.g. http://100.x.y.z:8000 (Tailscale IP)
- AGENT_TOKEN=${AGENT_TOKEN}
- WATCH_DIRS=/sources/results
volumes:
- ./Sync_logs:/logs:ro
- ${OUTPUT_DIR}:/sources/results:ro
restart: unless-stopped