reverse-tunnel icon indicating copy to clipboard operation
reverse-tunnel copied to clipboard

Dynamic configuration

Open jbendes opened this issue 3 years ago • 4 comments

Is there any way we can change the agent config while the server is running?

jbendes avatar Dec 07 '21 19:12 jbendes

Do you mean reconfiguring the server (adding agents for example) without breaking existing connections? That is not supported currently. You need to restart rtun-server to load a new config.

snsinfu avatar Dec 08 '21 13:12 snsinfu

Yes that is exactly what I meant! Do you have any thoughts on how you'd want that implemented? I would be happy to submit a PR. This is an awesome awesome tool you've made

jbendes avatar Dec 08 '21 14:12 jbendes

Thanks! PR is welcome.

I would trap SIGHUP signal (standard-ish signal for reloading config) in the main package and reconfigure the running server with a newly loaded configuration upon signal arrival.

In the current implementation, agent configurations are passed to Action from here and are used to create tcp.Service and udp.Service objects (which handle agent auth). Luckily, these service objects are stateless, so we can replace them with new ones on the fly. I'd add Action.Update(conf) method or something to update tcp and udp services.

I'm not sure what to do with a change of control_address. Maybe the program should detect incompatible changes and refuse to reload a new config.

snsinfu avatar Dec 08 '21 16:12 snsinfu

Is this ability also being implemented for the client component? I'm interested in dynamically initializing connections from the client config.

berttejeda avatar Jun 07 '22 03:06 berttejeda