Documentation
¶
Overview ¶
Package cmd holds the dragonrun CLI.
dragonrun runs ONE shared dev stack -- postgres, pgbouncer, mailpit, pgweb, caddy, dnsmasq -- and hands each project a generated environment pointing at it. Applications keep running on the host under mprocs; dragonrun never supervises them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Module ¶ added in v0.2.0
func Module() string
Module is the import path this binary was built from, which is what `update` hands back to `go install`. Read from build info rather than hard-coded so a fork updates from ITSELF, not from upstream.
func Release ¶ added in v0.2.0
func Release() string
Release is the version alone, as a semver tag or "dev". `update` compares against this, and needs it without the surrounding prose.
func Vars ¶
Vars builds the environment a project needs to talk to the shared stack.
The split between the two database URLs is not cosmetic. DATABASE_URL goes through pgbouncer in TRANSACTION pooling mode, which is what makes hundreds of app connections cheap.
ADMIN_DATABASE_URL goes DIRECT, for session semantics rather than for DDL: a bare CREATE DATABASE does survive the pooler, but transaction pooling breaks advisory locks, LISTEN/NOTIFY, session GUCs and temp tables -- and tenant provisioning code typically takes an advisory lock to serialise migrations. Teardown is the other half: pgbouncer's own idle server connections block DROP DATABASE until they are terminated, so an admin connection through the pooler is holding open what it is trying to drop.
Setting `auth_dbname` in pgbouncer.ini does not change this. That only moves the pooler's auth_query into a fixed database instead of the one being connected to; it buys nothing for session semantics, which is the whole reason this URL bypasses the pooler.
It also carries the CLUSTER SUPERUSER, not the project role. The project role has CREATEDB and owns its tenants, which covers create and drop -- but not CREATE EXTENSION, not terminating another role's backends, and not the recovery case where the login guard in template1 is what is broken. This is the same trade `edge.WriteBookmark` already makes for pgweb.
The cost is real and deliberate: a project holding this string can reach every other project's data, so the cross-project login guard protects against accident, not against a project that chooses to use its admin DSN.
Types ¶
This section is empty.