Something went wrong. Try again.
A container registry that uses the AT Protocol for manifest storage and S3 for blob storage.
Something went wrong. Try again.
1.5 kB · 55 lines
Shell
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556#!/bin/bash## Request crawl for a PDS from the Bluesky relay## Usage: ./request-crawl.sh <hostname> [relay-url]# Example: ./request-crawl.sh hold01.atcr.io#
set -e
DEFAULT_RELAY="https://bsky.network/xrpc/com.atproto.sync.requestCrawl"
# Parse argumentsHOSTNAME="${1:-}"RELAY_URL="${2:-$DEFAULT_RELAY}"
# Validate hostnameif [ -z "$HOSTNAME" ]; then echo "Error: hostname is required" >&2 echo "" >&2 echo "Usage: $0 <hostname> [relay-url]" >&2 echo "Example: $0 hold01.atcr.io" >&2 echo "" >&2 echo "Options:" >&2 echo " hostname Hostname of the PDS to request crawl for (required)" >&2 echo " relay-url Relay URL to send crawl request to (default: $DEFAULT_RELAY)" >&2 exit 1fi
# Log what we're doingecho "Requesting crawl for hostname: $HOSTNAME"echo "Sending to relay: $RELAY_URL"
# Make the requestRESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$RELAY_URL" \ -H "Content-Type: application/json" \ -d "{\"hostname\":\"$HOSTNAME\"}")
# Split response and status codeHTTP_BODY=$(echo "$RESPONSE" | head -n -1)HTTP_CODE=$(echo "$RESPONSE" | tail -n 1)
# Check responseif [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ]; then echo "✅ Success! Crawl requested for $HOSTNAME" if [ -n "$HTTP_BODY" ]; then echo "Response: $HTTP_BODY" fielse echo "❌ Failed with status $HTTP_CODE" >&2 if [ -n "$HTTP_BODY" ]; then echo "Response: $HTTP_BODY" >&2 fi exit 1fi