Closed ogarcia closed 4 years ago
IMHO. I would not implement this change. There is a simple workaround to see networks IDs:
# uci show zerotier
zerotier.mybeautifulnetwork=zerotier
zerotier.mybeautifulnetwork.enabled='1'
zerotier.mybeautifulnetwork.config_path='/etc/zerotier'
zerotier.mybeautifulnetwork.join='8056c2e21c000011'
zerotier.mybeautifulnetwork.secret='XXXXXXX'
Or if you know the name of network in your current config:
# uci get zerotier.mybeautifulnetwork.join
8056c2e21c000011
Even if you want do this in one command:
zerotier-cli join `uci get zerotier.mybeautifulnetwork.join`
Or for lazy ones can make a shell function
zerotierjoin () {
zerotier-cli join `uci get zerotier.${1}.join`
}
The reason of don't touch config file and don't add the new options is that maintain both versions of config is hard to do it and confusing for the user
This really boils down to how user friendly you want to be. Off course users can already work around it (I can curl any website by first doing an nslookup and parsing that and substituting the IP address ;-) But that's not the point.
ZT is the userfriendly counterpart to WG. Which has much wider adoption, better support, but is more linux-y and requires your own publicly reachable server (AFAIK). So do you want to get people off WG, or enable less savy people to get on the ZT wagon....
So to the core of the argument: is it more confusing for the user? (and hey, I'm a user and since you asked...)
I think the current format is not following conventions, so you could argue it doesn't follow the principle of least surprise. There are really two issues:
From a user's perspective it really doesn't matter how hard it is to do, buy i'm assuming you'll be the one to do it so ultimately it's your call.
Sorry for the delay. I will look into this again this weekend.
It seems to be a good idea to attach a human readable name to a network id.
But I do not know if switching between different networks is a common practice with ZT. I have only use ZT with one network so far. If it is, then I would give this feature a go. Otherwise, I would advise people to use the ZT command line interface or to script something.
From our experience running, and operating ZeroTier, switching between different networks is not commonplace. Especially since ZeroTier can join multiple networks at once. It's more of a set it & leave it going all the time thing.
As say @glimberg switching between different networks not is a common practice. Is more common up an instance and join (with same ID) in multiple networks at once.
I think that better of implement the proposed change is modify the start_instance()
to can do /etc/init.d/zerotier start_instance instance_name
by hand. This change only need move the logic of section_enabled
from start_instance
to start_service
. Doing this you can have a command to connect and disconnect by hand without modify the syntax of config file.
Ok, that settles it. I will close the issue.
@ogarcia we can implement that another day. Or feel free to submit a merge request.
To avoid discuss over commits, better use this issue. Related to https://github.com/zerotier/ZeroTierOne/issues/1240
Current status
Current config file have the following options:
Proposal
Instead of use a list of networks use a list of configs to have named networks and can use commands
join
andleave
Benefits of proposal
Proposal problems