A container registry that uses the AT Protocol for manifest storage and S3 for blob storage. atcr.io
docker container atproto go
at lexgen 55 lines 1.5 kB view raw
1#!/bin/bash 2# 3# Request crawl for a PDS from the Bluesky relay 4# 5# Usage: ./request-crawl.sh <hostname> [relay-url] 6# Example: ./request-crawl.sh hold01.atcr.io 7# 8 9set -e 10 11DEFAULT_RELAY="https://bsky.network/xrpc/com.atproto.sync.requestCrawl" 12 13# Parse arguments 14HOSTNAME="${1:-}" 15RELAY_URL="${2:-$DEFAULT_RELAY}" 16 17# Validate hostname 18if [ -z "$HOSTNAME" ]; then 19 echo "Error: hostname is required" >&2 20 echo "" >&2 21 echo "Usage: $0 <hostname> [relay-url]" >&2 22 echo "Example: $0 hold01.atcr.io" >&2 23 echo "" >&2 24 echo "Options:" >&2 25 echo " hostname Hostname of the PDS to request crawl for (required)" >&2 26 echo " relay-url Relay URL to send crawl request to (default: $DEFAULT_RELAY)" >&2 27 exit 1 28fi 29 30# Log what we're doing 31echo "Requesting crawl for hostname: $HOSTNAME" 32echo "Sending to relay: $RELAY_URL" 33 34# Make the request 35RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$RELAY_URL" \ 36 -H "Content-Type: application/json" \ 37 -d "{\"hostname\":\"$HOSTNAME\"}") 38 39# Split response and status code 40HTTP_BODY=$(echo "$RESPONSE" | head -n -1) 41HTTP_CODE=$(echo "$RESPONSE" | tail -n 1) 42 43# Check response 44if [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ]; then 45 echo "✅ Success! Crawl requested for $HOSTNAME" 46 if [ -n "$HTTP_BODY" ]; then 47 echo "Response: $HTTP_BODY" 48 fi 49else 50 echo "❌ Failed with status $HTTP_CODE" >&2 51 if [ -n "$HTTP_BODY" ]; then 52 echo "Response: $HTTP_BODY" >&2 53 fi 54 exit 1 55fi