Closed SadPencil closed 8 months ago
This request can be also achieved as follows.
The current behavior config_path
is to make a symlink from /var/lib/zerotier-one
to /etc/zerotier
. However, it can be improved by something like,
option config_path '/etc/zerotier'
option option copy_config_path '0' # default to 0 in order to be compatible with older versions
and instead of making a symlink, copy all the files from /etc/zerotier
to /var/lib/zerotier-one
, and initialize the rest files.
@SadPencil the only temporally files that ZT creates in /etc/zerotier
are zerotier-one.pid
and zerotier-one.port
. Both with size of 4K and only rewrite on a router reboot. I think that flash can manage this without problem.
@SadPencil the only temporally files that ZT creates in
/etc/zerotier
arezerotier-one.pid
andzerotier-one.port
. Both with size of 4K and only rewrite on a router reboot. I think that flash can manage this without problem.
The temporally files are small, indeed. But I create a PR for this anyhow. Tested on my router. https://github.com/mwarning/zerotier-openwrt/pull/92
@ogarcia For those SPI flash without wear leveling feature, even though the files are small, minimizing the write is meaningful. Please review PR #92 .
@mwarning what do you think?
I will take a look later this week. @SadPencil thank you for your contribution!
@mwarning support MOON?
This feature sounds nice, but since I have never used mooons, it takes some time to grook and to have time to get into it. I hope to have time soon. Thank you for all the contributions so far! :)
In a regular Linux distro, path
/var/lib/zerotier-one/moons.d
folder contains the information of MOON peers, each*.moon
file per peer. When zerotier service starts, these files are loaded.Currently, to let the zerotier node join the MOON in openwrt, the only way is to specify
config_path
in your configuration file.and place the moon files inside the folder. However, there are some cons in this method. Zerotier writes temporary files in the configuration folder and the persistent storage space in a OpenWRT router should not be written too much as it is a simple SPI flash that can't support too much write.
See the next comment for my solution.