Repository navigation
A declared url for a daemon the proxy doesn't serve #1145
jholzinger-hadrian
started this conversation in
Ideas
Replies: 1 comment
|
Thanks for the detailed write-up. This is implemented in #1146. A daemon can now declare the URL it answers on: [daemons.cache]
run = "redis-server --port $PORT"
port = 6380
proxy = false
url = "redis://127.0.0.1:{{ port }}/0"
Not included: mise exporting a declared AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: unavailable. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
{{ url }}and{{ daemons.<name>.url }}give a daemon's proxy URL, which is great when the proxy serves it. When it doesn't, because the daemon setsproxy = false, the proxy is turned off, or the daemon doesn't speak HTTP, there's no URL at all.{{ daemons.api.url }}is null while{{ daemons.api.port }}still works, so every consumer rebuilds the address from the port:mise, which exports each daemon's endpoint as
<NAME>_PORTand<NAME>_URL, has the same gap. Withproxy = falsethere's noAPI_URL, so{{ env.API_URL }}fails withField `API_URL` is not defined, and the fallback moves into[env]:Both have to guess two things the config never says:
http://orhttps://. Without it, the daemon might speakhttp,https(as withproxy_tls = "passthrough"),redis,postgresornats.localhostcan resolve to::1first, which a daemon bound to127.0.0.1refuses. pitchfork itself isn't consistent here: it forwards terminated HTTP tolocalhost:<port>but connects passthrough to127.0.0.1:<port>(src/proxy/server.rs), so a consumer can't copy what the proxy does.Proposal
Let a daemon declare the URL it answers on, used whenever the proxy isn't serving it:
{{ daemons.cache.url }}isredis://127.0.0.1:6380/0, sourlworks for any daemon, not only HTTP ones.{{ daemons.api.url }}is the proxy URL when the proxy servesapi, andhttp://127.0.0.1:4300when it doesn't, such as on a machine without the proxy set up.urlbehaves as today.The proxy URL wins when there is one, because it's stable across checkouts. Anyone who always wants the direct address sets
proxy = false, as now.This needs the daemon's own port in templates:
{{ port }}and{{ ports }}as self variables, matchingdaemons.<name>.portand.ports. Today only$PORTin commands gives it.urlwould use{{ port }}the wayrunuses$PORT, so it follows the port when it changes.mise could then export a declared
urlas<NAME>_URLwhenever there's no proxy URL, so{{ env.API_URL }}would always resolve without a fallback.AI-assisted — Tool: pi 1.5.2; model: bifrost/claude-opus-5-5; version: unavailable.
All reactions