Skip to content

Commit

Permalink
Add PDS host argument to blob export (#884)
Browse files Browse the repository at this point in the history
This PR introduces the `--pds-host` argument to the `blob export`
command chain.

This was needed in order to export the blobs from an old PDS when by DID
document was pointing to the new one already.
  • Loading branch information
bnewbold authored Dec 20, 2024
2 parents 17593f7 + 39439f4 commit 7e16f33
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cmd/goat/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ var cmdBlob = &cli.Command{
Aliases: []string{"o"},
Usage: "directory to store blobs in",
},
&cli.StringFlag{
Name: "pds-host",
Usage: "URL of the PDS to export blobs from (overrides DID doc)",
},
},
Action: runBlobExport,
},
Expand Down Expand Up @@ -73,9 +77,14 @@ func runBlobExport(cctx *cli.Context) error {
return err
}

pdsHost := cctx.String("pds-host")
if pdsHost == "" {
pdsHost = ident.PDSEndpoint()
}

// create a new API client to connect to the account's PDS
xrpcc := xrpc.Client{
Host: ident.PDSEndpoint(),
Host: pdsHost,
}
if xrpcc.Host == "" {
return fmt.Errorf("no PDS endpoint for identity")
Expand Down

0 comments on commit 7e16f33

Please sign in to comment.