Repository navigation
portless run doesn't support --tld (alias does) #585
williamdenton
started this conversation in
Ideas
Replies: 0 comments
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.
First off, thank you for fixing #405 so quickly.
I under-reported the scope there. Having upgraded to 0.17.0,
alias --tldworks as hoped, butportless runhas the same problem: it registers the app under every TLD the proxy serves, and there's no way to restrict it. So arunapp can't share a label with an alias that has been scoped to another TLD.Use case
One proxy serving two TLDs:
staging.example.com: aliases to ssh tunnels into a deployed environment, using--upstream https://...so they keep their real hostnames.local.example.com: apps running on this machine viaportless run.When the same service exists in both places (
service.staging.example.comtunnelled,service.local.example.comlocal), the localrunalso claimsservice.staging.example.comandcollides with the alias.
Repro (portless 0.17.0)
Uses a throwaway state dir and an unprivileged HTTP proxy, so it needs no sudo:
Actual
The alias is scoped correctly:
but
runexpands to both TLDs and refuses to start:A fully qualified name doesn't help either.
portless run --name service.local.example.com -- sleep 3strips the TLD and re-expands it to the same two hostnames, with the same error.
--forceisn't a workaround: it replaces the alias, so the tunnelled service's hostname now points atthe local app.
runhas no--tldto scope it:and
PORTLESS_TLDonrunis checked against the running proxy's config, not used to scope theroute.
Expected
The same opt-in as
alias: a repeatable--tldonrun(andportless <name> <cmd>), validatedagainst the TLDs the proxy serves, so that:
registers only
service.local.example.com. Ideally there would also be a matchingtldkey per appin
portless.json, so monorepo apps can declare it once.portless getwould then need to honour thesame setting, so it prints the URL the app was actually registered under. Omitting it keeps today's
fan-out.
All reactions