declarative relay deployment on hetzner relay.waow.tech
atproto
at main 35 lines 961 B view raw
1#!/usr/bin/env bash 2set -euo pipefail 3cd "$(dirname "$0")/.." 4source .env 5 6: "${ZLAY_ADMIN_PASSWORD:?set ZLAY_ADMIN_PASSWORD}" 7: "${ZLAY_DOMAIN:=zlay.waow.tech}" 8 9ACTION="${1:-status}" 10 11case "$ACTION" in 12 start) 13 SOURCE="${2:-bsky.network}" 14 curl -sf -X POST \ 15 -H "Authorization: Bearer $ZLAY_ADMIN_PASSWORD" \ 16 "https://$ZLAY_DOMAIN/admin/backfill-collections?source=$SOURCE" | jq . 17 ;; 18 status) 19 curl -sf --max-time 30 \ 20 -H "Authorization: Bearer $ZLAY_ADMIN_PASSWORD" \ 21 "https://$ZLAY_DOMAIN/admin/backfill-collections" | jq '{ 22 running, total, completed, in_progress, total_imported, 23 recent: [.collections[] | select(.completed == false)] | .[0:5] 24 }' 25 ;; 26 full) 27 curl -sf --max-time 30 \ 28 -H "Authorization: Bearer $ZLAY_ADMIN_PASSWORD" \ 29 "https://$ZLAY_DOMAIN/admin/backfill-collections" | jq . 30 ;; 31 *) 32 echo "usage: $0 [status|start [source]|full]" 33 exit 1 34 ;; 35esac