quarkiverse / quarkus-ngrok

ngrok is a globally distributed reverse proxy fronting your web services running in any cloud or private network, or your machine
https://docs.quarkiverse.io/quarkus-ngrok/dev/index.html
Apache License 2.0
7 stars 7 forks source link

feat: generate config and use tunnel name to allow overrides #104

Closed maxandersen closed 7 months ago

maxandersen commented 7 months ago

this is implementing #103 but with a caveat.

Idea was that by generating config on every start and use a tunnelname users could add the ngrok specfic config if they wanted to in the default ngrok yml config.

but turns out ngrok does not support as flexible merging of configs as I expected. each tunnel is fully replaced. Also, not possible to have partial config - tunnles must specify addr to have tunneling.

meaning to have overrides take effect I must run it so the main config wins.

which this PR currently does.

It has the bad sideeffect thought that if users add any config to their ngrok.yml it will always win over whatever config quarkus has in its application.properties AND users must specify all the needed options in the main config if they want just one parameter overridden. Which feels against the principal of 'closest config should win'.

So this PR does allow users to set any config they want in a tunnel using the quarkus app name...but it does it less nicely than I had expected.

maybe should instead fallback to the old behavior and only if you set .tunnel-name would we run with that specifc named tunnel which you as user would need to ensure it is present in the config ?

wdyt?

melloware commented 7 months ago

I like your idea of "only if tunnel-name" is used.

maxandersen commented 7 months ago

updated to use tunnel-name to trigger using explicit tunnel.

nice thing here is that global config options like region still works/win; just the tunnel settings will be force overridden by users tunnel settings.

geoand commented 7 months ago

I think we should make @melloware part of this repository so he can approve and release without me 😎

melloware commented 7 months ago

Yep I don't mind doing releases!

geoand commented 7 months ago

@maxandersen can you take care of that? I don't seem to have the karma

melloware commented 7 months ago

@gastaldi usually hooks me up with stuff like this 😄

gastaldi commented 7 months ago

PR created: https://github.com/quarkiverse/quarkiverse-devops/pull/205

geoand commented 7 months ago

Thanks!