Documentation
¶
Overview ¶
Package edge generates the per-project artefacts the long-running containers read: a caddy site file and a pgweb bookmark.
Both are plain files in DRAGONRUN_HOME, mounted read-only into the containers. Registering a project therefore never restarts the stack -- caddy gets a reload, pgweb picks bookmarks up on next page load.
Index ¶
- Variables
- func DeleteCA(fp string) error
- func Fingerprint(path string) (string, error)
- func KeychainCAs() ([]string, error)
- func Reload() error
- func RemoveBookmark(name string) error
- func RemoveSite(name string) error
- func RootCA() (string, error)
- func TrustCA(path string) error
- func UntrustCA(rootCrt string) (bool, error)
- func WriteBookmark(c *registry.Config, p registry.Project) error
- func WriteServiceSites(c *registry.Config) error
- func WriteSite(p registry.Project) error
Constants ¶
This section is empty.
Variables ¶
var ServiceHosts = map[string]string{
"mail": "mailpit:8025",
"pgweb": "pgweb:8081",
}
ServiceHosts are the built-in UIs dragonrun serves under its own domain, so you never have to remember a port. They proxy to the CONTAINERS by service name -- caddy shares a network with them -- rather than back out through the host's published ports.
These are browser URLs, which is why a hostname is fine here while the database and SMTP DSNs deliberately stay on localhost: a browser URL failing off-network is a mild annoyance, an app failing to boot is not.
Functions ¶
func Fingerprint ¶
Fingerprint returns the SHA-1 of a PEM certificate, formatted the way `security find-certificate -Z` prints it.
func KeychainCAs ¶
KeychainCAs lists every trusted caddy root, by fingerprint. Used to find roots left behind when the caddy volume was recreated.
func Reload ¶
func Reload() error
Reload asks caddy to re-read its config in place. A restart would drop in-flight requests and, more annoyingly, re-issue certificates.
func RemoveBookmark ¶
func RemoveSite ¶
func RootCA ¶
RootCA copies caddy's local CA out of the container so it can be trusted by the host. Until this is trusted, every https://*.test hit shows a warning.
func TrustCA ¶
TrustCA installs caddy's root into the system keychain. Requires sudo, and deliberately shells out visibly so the password prompt is not a surprise.
func UntrustCA ¶
UntrustCA removes dragonrun's caddy root from the system keychain.
It matches on the certificate's SHA-1 fingerprint, not its name: the label carries a year ("Caddy Local Authority - 2026 ECC Root") and any other Caddy on this machine -- one of the per-project Caddyfiles, say -- produces a root with the same name. Deleting by name could untrust someone else's CA.
func WriteBookmark ¶
WriteBookmark points pgweb at the project's control database as the cluster superuser, so tenant databases created later are reachable from the UI's database switcher without any further registration.
It connects to postgres directly rather than through pgbouncer: browsing is a session-oriented workload and transaction pooling would only get in the way.
func WriteServiceSites ¶
WriteServiceSites renders the built-in hostnames. One file, rewritten whenever the stack comes up, named with a leading underscore so it can never collide with a project's own site file.
Types ¶
This section is empty.