MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / SetBaseURL

Method SetBaseURL

internal/server/server.go:1123–1134  ·  view source on GitHub ↗

SetBaseURL sets the public base URL used for generating shareable links. If the supplied URL has an unspecified bind-all host ("0.0.0.0", "::", "[::]"), this logs a WARN: such a URL is the right thing to *bind* to but the wrong thing to *send* to a recipient (their browser cannot resolve 0.0.0.0 /

(rawURL string)

Source from the content-addressed store, hash-verified

1121// links from such a deployment should set PAD_URL or PUBLIC_URL to the
1122// real public hostname (e.g. https://app.getpad.dev). See BUG-899.
1123func (s *Server) SetBaseURL(rawURL string) {
1124 s.baseURL = strings.TrimRight(rawURL, "/")
1125 if s.baseURL == "" {
1126 return
1127 }
1128 if u, err := url.Parse(s.baseURL); err == nil {
1129 switch u.Hostname() {
1130 case "", "0.0.0.0", "::":
1131 slog.Warn("server base URL has an unspecified host; emailed links (password reset, invites, share links) will not be reachable. Set PAD_URL or PUBLIC_URL to the deployment's public URL (e.g. https://app.getpad.dev).", "base_url", s.baseURL)
1132 }
1133 }
1134}
1135
1136// specialUseTLDs is the (finite) set of reserved top-level names from the IANA
1137// Special-Use Domain Names registry + related RFCs that never resolve to a

Calls

no outgoing calls