Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config file #5

Open
aramperes opened this issue Oct 16, 2021 · 3 comments
Open

Config file #5

aramperes opened this issue Oct 16, 2021 · 3 comments
Milestone

Comments

@aramperes
Copy link
Owner

As the options will become more numerous with #1 and #2, I think it makes sense to allow a TOML config file to configure the ports and WG tunnel. Something like

[tunnel]
endpoint-addr = "140.30.3.182:51820"
endpoint-public-key = "..."
private-key = "..."
source-peer-ip = "192.168.4.3"
keep-alive = 10
log = "trace"

[ports]

[ports.my-web-server]
source = "127.0.0.1:8080"
destination = "192.168.4.2:8080,192.168.4.4:8080"  # Comma-separated for round-robin
protocol = "TCP"

[ports.my-udp-service]
source = "127.0.0.1:8081"
destination = "192.168.4.4:8081"
protocol = "UDP"

[ports.my-dual-protocol-service]
source = "127.0.0.1:8082"
destination = "192.168.4.4:8082"
protocol = "UDP,TCP"

That could be passed as

$ ./onetun -f onetun.toml
@aramperes aramperes added this to the v0.2 milestone Oct 16, 2021
@vi
Copy link

vi commented Oct 16, 2021

Should all features on Onetun be still reachable without using config file, just long enough command line?

E.g. would multiple forwards be still supported file-less?

@cipriancraciun
Copy link

destination = "192.168.4.2:8080,192.168.4.4:8080" # Comma-separated for round-robin

Why not make destination a single target option, and introduce destinations that takes a list of targets? (With TCP it's not a problem as , is not allowed as a character. But if one would support UNIX domain sockets, as proposed in #11, then , would be allowed.)

Then inside the code make sure that only one is set destination or destinations and use them appropriatedly.

@aramperes
Copy link
Owner Author

@vi

Should all features on Onetun be still reachable without using config file, just long enough command line?

E.g. would multiple forwards be still supported file-less?

I think as much as possible I'd like for those to be configurable from the CLI. If SSH can do it, it should be feasible.

@cipriancraciun

destination = "192.168.4.2:8080,192.168.4.4:8080" # Comma-separated for round-robin

Why not make destination a single target option, and introduce destinations that takes a list of targets? (With TCP it's not a problem as , is not allowed as a character. But if one would support UNIX domain sockets, as proposed in #11, then , would be allowed.)

Then inside the code make sure that only one is set destination or destinations and use them appropriatedly.

That's a good point about UNIX domain sockets. I'm still internally debating the need for , for load-balancing in #10, but I suppose that'll only become a problem when/if both #11 and #10 are implemented.

@aramperes aramperes modified the milestones: v0.2, v0.3 Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants