mwarning / zerotier-openwrt

A OpenWrt package for ZeroTier One - Pull requests are welcome!
695 stars 146 forks source link

Doesn't persist allowGlobal, allowDefault network settings #90

Closed sboisson closed 2 months ago

sboisson commented 3 years ago

Hello,

The files /var/lib/zerotier-one/networks.d/{network id}.local.conf containing the flags is not persisted across reboot. allowGlobal, allowDefault and allowDNS should be persisted

ogarcia commented 3 years ago

@sboisson if you see config it have this entry

# persistent configuration folder (for ZT controller mode)
#option config_path '/etc/zerotier'

You can uncomment line and set the directory that you want (must be created before) to persist your config.

sboisson commented 3 years ago

Ok so it bypass the other config keys in /etc/config/zerotier ? I think it would be interesting to have the allowGlobal, allowDefault and allowDNS also configurable as keys per network in /etc/config/zerotier… Wouldn't make it easier to make a LUCi module for it then ?

ogarcia commented 3 years ago

Ok so it bypass the other config keys in /etc/config/zerotier ?

No

mwarning commented 3 years ago

Ok so it bypass the other config keys in /etc/config/zerotier ? I think it would be interesting to have the allowGlobal, allowDefault and allowDNS also configurable as keys per network in /etc/config/zerotier… Wouldn't make it easier to make a LUCi module for it then ?

If that is no big issue, then it would be useful to have those options in /etc/config/zerotier. As for the LuCI module, I don't know who is in charge of that.

generalinterest commented 4 months ago

Hi Folks,

I stumbled upon this issue where researching the same problem. It seems that /etc/init.d/zerotier deletes all the config during it's stop/start operations.

I believe I have a simple method that works by creating the ZT networks .local.conf at the same time as add_join() touches the .conf file.

By extending the add_join() procedure, you can retrieve the allowDefault var from /etc/config/zerotier and populate the .local.conf file.

I have a working version and would be happy to share if you think there is merit in this.

ogarcia commented 4 months ago

We are discussing it in #119 and #120

ogarcia commented 2 months ago

Merged! https://github.com/openwrt/packages/pull/24773