v2.10.0: Templates, hosts sync, and a sharper logs view
Pitchfork v2.10.0 brings configuration templating so daemons can reference each other's resolved ports, a much smarter reverse proxy that manages /etc/hosts and injects framework-friendly env vars, and a refreshed pitchfork logs UI. It also fixes a long-standing macOS boot-start bug where root installs landed in the wrong launchd directory.
Added
-
Tera templates in daemon config (#419) -- @gaojunran.
run,envvalues,hooks.*, andready_cmdcan now use{{ ... }}template expressions that resolve at start time, following the dependency graph. This finally makesport = { expect = [...], bump = N }composable: daemons that depend on a port can read its actual resolved value instead of hardcoding it.[daemons.redis] run = "redis-server" port = { expect = [6379], bump = 10 } [daemons.api] run = "server --redis-port {{ daemons.redis.port }}" env = { DATABASE_URL = "redis://localhost:{{ daemons.redis.port }}/0" } depends = ["redis"]
Available variables include self metadata (
name,namespace,id,slug,dir),daemons.<name>.{port,ports,id,slug,dir,...}for same-namespace references,daemons["ns.name"]for cross-namespace,settings.proxy.*, andproxy_url. Undefined variables produce strict errors at start time. Full guide: Configuration Templates. -
Proxy syncs
/etc/hostsautomatically (#418) -- @gaojunran. Withproxy.sync_hosts = true(default), pitchfork maintains a marked block in/etc/hostsfor every registered slug, e.g.127.0.0.1 myapp.localhost. This removes the need fordnsmasqand per-OS resolver configuration in most setups, and finally makes Safari.localhostresolution and custom TLDs (e.g..test) work out of the box. Entries are cleaned up on proxy shutdown. Writing to/etc/hostsmay require running pitchfork with sudo; setproxy.sync_hosts = falseto opt out. -
Proxy env vars for routed daemons (#418) -- @gaojunran. Daemons with a registered slug now receive useful env vars automatically:
HOST=127.0.0.1so frameworks bind to loopbackPITCHFORK_URLset to the daemon's public proxy URL (e.g. thehttpsURL for its slug)NODE_EXTRA_CA_CERTSpointing at the pitchfork CA when HTTPS is enabled, so Node backends trust internal proxy traffic__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS=.<tld>so Vite dev servers accept the proxy hostname without manualserver.allowedHostsconfig
-
HTTP/2 and graceful proxy shutdown (#418) -- @gaojunran. The HTTPS proxy now advertises
h2andhttp/1.1via ALPN, eliminating the browser's 6-connections-per-host bottleneck. The supervisor cancels and drains in-flight proxy connections on shutdown (with a 10-second timeout) instead of dropping them mid-request. Plain HTTP requests on the HTTPS port now receive a 302 redirect to the HTTPS equivalent, and plain-HTTP WebSocket upgrades on the TLS port are rejected with 400 instead of stalling. -
Daemon running info in templates (#419) -- Already-running daemons contribute their resolved ports to the template context, so a freshly started daemon can reference a sibling that was started in a previous batch.
-
Refined
pitchfork logsdisplay (#420) -- @gaojunran. Multi-daemon output now uses deterministic per-daemon colors and a width-aligned name column so messages line up across daemons. Tail mode (--tail, andpitchfork wait) was rewritten to use a 200ms polling loop that tracks bytes consumed rather thanBufReader::stream_position, fixing dropped lines when writers used buffered I/O. New log files that appear after--tailstarts are now picked up automatically.
Fixed
-
macOS root boot-start uses
LaunchDaemons(#423) -- @gaojunran.sudo pitchfork boot enablepreviously installed to/Library/LaunchAgents/, which is the wrong directory for system-level launchd jobs and caused boot start to silently misbehave. Root installs now correctly use/Library/LaunchDaemons/pitchfork.plist. On enable, pitchfork detects and migrates legacyLaunchAgentsentries from older versions;boot statuswarns if both user- and system-level entries are present. -
boot disablereports incomplete cleanup (#423) -- Runningboot disablewithout sufficient privileges to remove a system-level entry no longer reports false success; it now bails with a message indicating elevated privileges are required.
Changed
- Smaller release binaries via
seriousprofile (#424) -- @gaojunran. Release builds now use a new Cargo profile that enables LTO,codegen-units = 1, and symbol stripping for noticeably smaller binaries on all platforms.
Full Changelog: v2.9.1...v2.10.0
💚 Sponsor pitchfork
pitchfork is built by @jdx at en.dev — an independent studio shipping developer tools like mise, aube, hk, pitchfork, and more. Development is sustained by sponsorships.
If pitchfork has a place in your dev workflow, please consider sponsoring at en.dev. Individual and company sponsorships are what keep the project healthy and moving forward.