mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-09-20 01:04:15 +00:00
show availableUserDomains
This commit is contained in:
+10
-1
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// XRPC handler for ATProto endpoints
|
||||
@@ -93,9 +94,17 @@ func (h *XRPCHandler) HandleDescribeServer(w http.ResponseWriter, r *http.Reques
|
||||
return
|
||||
}
|
||||
|
||||
// Extract hostname from public URL for availableUserDomains
|
||||
// For hold01.atcr.io, return [".hold01.atcr.io"] to match stream.place pattern
|
||||
hostname := h.publicURL
|
||||
hostname = strings.TrimPrefix(hostname, "http://")
|
||||
hostname = strings.TrimPrefix(hostname, "https://")
|
||||
hostname = strings.Split(hostname, "/")[0] // Remove path
|
||||
hostname = strings.Split(hostname, ":")[0] // Remove port
|
||||
|
||||
response := map[string]interface{}{
|
||||
"did": h.pds.DID(),
|
||||
"availableUserDomains": []string{},
|
||||
"availableUserDomains": []string{"." + hostname},
|
||||
"inviteCodeRequired": true, // Single-user PDS, no account creation
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user