Files
tri-bootstrap-server/scripts/publish-bootstrap.sh
T
Krystie 50bd396c2b Initial commit: TRI bootstrap server
- Caddy HTTPS static file server config
- Tor hidden service (V3 onion) for anonymous access
- Bootstrap generation script (blk0001.dat + txleveldb + database)
- Dropbox upload script
- Systemd services (tor-bootstrap, caddy)
- Operator guide and verification script
2026-04-21 01:53:34 -07:00

48 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# publish-bootstrap.sh — Uploads bootstrap archive to Dropbox
# Requires: dbxcli (Dropbox CLI)
# Usage: ./publish-bootstrap.sh /path/to/archive.tar.gz [dropbox-path]
set -euo pipefail
ARCHIVE="${1:?Usage: $0 /path/to/archive.tar.gz}"
DROPBOX_PATH="${2:-/TRI $(date +%m\ %d\ %y) bootstrap}"
echo "=== Dropbox Publisher ==="
echo "File: $ARCHIVE"
echo "Destination: $DROPBOX_PATH"
echo ""
if ! command -v dbxcli &>/dev/null; then
echo "ERROR: dbxcli not found. Install: https://github.com/dropbox/dbxcli"
exit 1
fi
# Verify the archive first
echo "Running quick verification..."
if ! tar -tzf "$ARCHIVE" --wildcards "blk0001.dat" &>/dev/null; then
echo "ERROR: Archive does not contain blk0001.dat"
exit 1
fi
# Upload
echo "Uploading to Dropbox..."
dbxcli put "$ARCHIVE" "$DROPBOX_PATH/$(basename "$ARCHIVE")"
# Get the shared link (if available)
echo ""
echo "Getting shareable link..."
LINK=$(dbxcli share "$DROPBOX_PATH/$(basename "$ARCHIVE")" 2>/dev/null | grep -oE "https://www\.dropbox\.com[^ ]+" | head -1 || echo "manual link needed")
echo ""
echo "=== Upload Complete ==="
echo "Dropbox path: $DROPBOX_PATH"
echo "Share link: $LINK"
echo ""
echo "To use this bootstrap:"
echo " 1. Download from Dropbox to the bootstrap server"
echo " 2. Extract to /var/www/triangles-bootstrap/"
echo " 3. Update symlinks:"
echo " cd /var/www/triangles-bootstrap"
echo " ln -sf triangles-bootstrap-YYYY-MM-DD.tar.gz triangles-bootstrap.tar.gz"