Monorepo for Tangled โ€” https://tangled.org

knotserver/config: add PLC URL config option #682

closed
opened by shailpatels.me targeting master from shailpatels.me/core: knotserver_configurable_plc

The knotserver can now use alternative PLCs for DID resolution by setting the env var KNOT_SERVER_PLC_URL. The default identity directory was copied out of the at proto lib and updated to take in a target url for the PLC being used to do this.

0
by shailpatels.me 1 comment
expand 1 commit
knotserver/config: add PLC URL config option

The original issue was related to DID resolution with ipv6 only https://tangled.org/@tangled.org/core/issues/268,

I setup my knot with the env KNOT_SERVER_PLC_URL=https://plc.wtf and got a little farther but looks like the PDS also doesn't support IPV6 ;-;

Oct 18 04:43:30 debian-2gb-ash-1 knot[34274]: 2025/10/18 04:43:30 DEBU knot/server/serviceauth: valid signature ActorDid=did:plc:fjoxhdnj2kep6llsvhtxqrk3
Oct 18 04:43:30 debian-2gb-ash-1 knot[34274]: 2025/10/18 04:43:30 DEBU knot: performing request subsystem=RobustHTTPClient method=GET url="https://russula.us-west.host.bsky.network/xrpc/com.atproto.repo.getRecord?collection=sh.tangled.repo&repo=did%3Aplc%3Afjoxhdnj2kep6llsvhtxqrk3&rkey=3m3gxyvkylt22"
Oct 18 04:43:34 debian-2gb-ash-1 knot[34274]: 2025/10/18 04:43:34 WARN knot: request failed subsystem=RobustHTTPClient error="Get \"https://russula.us-west.host.bsky.network/xrpc/com.atproto.repo.getRecord?collection=sh.tangled.repo&repo=did%3Aplc%3Afjoxhdnj2kep6llsvhtxqrk3&rkey=3m3gxyvkylt22\": context canceled" method=GET url="https://russula.us-west.host.bsky.network/xrpc/com.atproto.repo.getRecord?collection=sh.tangled.repo&repo=did%3Aplc%3Afjoxhdnj2kep6llsvhtxqrk3&rkey=3m3gxyvkylt22"
Oct 18 04:43:34 debian-2gb-ash-1 knot[34274]: 2025/10/18 04:43:34 ERRO knot/server/xrpc: failed handler=NewRepo kind=Generic error="request failed: Get \"https://russula.us-west.host.bsky.network/xrpc/com.atproto.repo.getRecord?collection=sh.tangled.repo&repo=did%3Aplc%3Afjoxhdnj2kep6llsvhtxqrk3&rkey=3m3gxyvkylt22\": GET https://russula.us-west.host.bsky.network/xrpc/com.atproto.repo.getRecord?collection=sh.tangled.repo&repo=did%3Aplc%3Afjoxhdnj2kep6llsvhtxqrk3&rkey=3m3gxyvkylt22 giving up after 1 attempt(s): context canceled"
shail@debian13:~/tangled/core$ dig russula.us-west.host.bsky.network AAAA @8.8.8.8

; <<>> DiG 9.20.11-4-Debian <<>> russula.us-west.host.bsky.network AAAA @8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12857
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;russula.us-west.host.bsky.network. IN	AAAA

;; AUTHORITY SECTION:
bsky.network.		42	IN	SOA	ns-61.awsdns-07.com. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 7200

;; Query time: 27 msec
;; SERVER: 8.8.8.8#53(8.8.8.8) (UDP)
;; WHEN: Sat Oct 18 01:24:50 EDT 2025
;; MSG SIZE  rcvd: 142
sign up or login to add to the discussion
expand 1 commit
knotserver/config: add PLC URL config option

thanks for the PR! if i am understanding correctly:

  • this PR introduces a new idresolver.DefaultDirectory
  • this is subsequently used in idresolver.DefaultResolver

the issue here is that users of the redis based resolver will be unable to overload their PLC URL (it uses idresolver.BaseDirectory internally). i would suggest that:

  • we remove idresolver.DefaultDirectory
  • add the PLC URL overload to idresolver.BaseDirectory
  • permit PLC URL overload on users of idresolver.RedisDirectory

@oppi.li I've been working on same feature but for appview side, I'll open a new PR merging both with your review applied.

closing in flavor of #683

Yeah exactly, I pulled the defaultDirectory out of the library https://github.com/bluesky-social/indigo/blob/main/atproto/identity/directory.go#L65 and added the url parameter.

Thanks for the other PR @boltless.me!

closed without merging
sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 3
AT URI
at://did:plc:fjoxhdnj2kep6llsvhtxqrk3/sh.tangled.repo.pull/3m3gzy4m25a22