From a71f3c4df4ef2b011e9a3ddbaaf24e7e9b319dcc Mon Sep 17 00:00:00 2001 From: Luna Date: Tue, 19 Nov 2024 01:49:43 -0300 Subject: [PATCH] let ATP_PLC_HOST override default plc host --- atproto/identity/identity.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/atproto/identity/identity.go b/atproto/identity/identity.go index c0453b2af..c0ab1b1f5 100644 --- a/atproto/identity/identity.go +++ b/atproto/identity/identity.go @@ -7,6 +7,7 @@ import ( "net" "net/http" "net/url" + "os" "strings" "time" @@ -62,8 +63,13 @@ var DefaultPLCURL = "https://plc.directory" // Returns a reasonable Directory implementation for applications func DefaultDirectory() Directory { + url := DefaultPLCURL + envPlc := os.Getenv("ATP_PLC_HOST") + if envPlc != "" { + url = envPlc + } base := BaseDirectory{ - PLCURL: DefaultPLCURL, + PLCURL: url, HTTPClient: http.Client{ Timeout: time.Second * 10, Transport: &http.Transport{