mwarning / zerotier-openwrt

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

[WIP] Support orbit on startup #87

Closed SalimTerryLi closed 3 years ago

SalimTerryLi commented 3 years ago

This PR tries to bring support for automatic orbit operation on startup, which currently isn't supported on OpenWRT.

Upstream does not respond to my PR. Waiting for some time and see if is necessary to merge it as a patch file under this repo.

Looking forward to this feature in the next major release :)

mwarning commented 3 years ago

Does this work with the current version of ZeroTier, or does it depend on the other MR?

SalimTerryLi commented 3 years ago

It requires the MR list above. Seems ZT official repository is not very active so I'm wonder if we can do it as a patch instead of merging it into upstream, as it only benefits openwrt user group for now.

ogarcia commented 3 years ago

Since OpenWRT Zerotier packages are based in stable versions of Zerotier I think that this PR should wait until upstream merge dependencies and release a stable version with this feature.

glimberg commented 3 years ago

The behavior requested upstream already exists as is and the upstream PR was rejected because it changes the behavior of what's already there. Upstream does requires a properly named & generated .moon file from a previous orbit operation to be put in the moons.d/ subfolder in ZeroTier's home directory. How that translates into how this OpenWRT port is implemented, I can't say.

SalimTerryLi commented 3 years ago

The behavior requested upstream already exists as is and the upstream PR was rejected because it changes the behavior of what's already there. Upstream does requires a properly named & generated .moon file from a previous orbit operation to be put in the moons.d/ subfolder in ZeroTier's home directory. How that translates into how this OpenWRT port is implemented, I can't say.

I must pointed out that there is no change with current behavior. All configuration works today will also works tomorrow, but new feature is available too. They have a clearly different entrance, although depends on the same file

SalimTerryLi commented 3 years ago

Upstream doesn't accept the change and, how about your idea from OpenWRT side? I really want this feature to be available and, this could be the most straight-forward way to do that, by accept those change as patch.

If it is not tolerable just close it :)

glimberg commented 3 years ago

As I stated in the upstream pull request, OpenWRT moon handling would be better handled here in the OpenWRT port where you already have methods for filesystem state handling via the config files. The one catch is that the content of the moon files are binary, so you'll likely have to use base64 or some other method of encoding the content to text in order to store it in the configuration files.

SalimTerryLi commented 3 years ago

As I stated in the upstream pull request, OpenWRT moon handling would be better handled here in the OpenWRT port where you already have methods for filesystem state handling via the config files. The one catch is that the content of the moon files are binary, so you'll likely have to use base64 or some other method of encoding the content to text in order to store it in the configuration files.

Things comes and where can we grab the contents of .moon ahead of ZT it self being launched....... All other parts work with a already-known plain text initial configuration except for moons.

glimberg commented 3 years ago

The content of the moon file will be the same across systems, IIRC. You can grab it from another system using the same moon. Or you can join it on the OpenWRT system, then update the config with the content so that you'll have it for the next reboot/launch of ZeroTier.

SalimTerryLi commented 3 years ago

The content of the moon file will be the same across systems, IIRC. You can grab it from another one using the same moon. Or you can join it on the OpenWRT system, then update the config with the content so that you'll have it for the next reboot/launch of ZeroTier.

That is what I want to avoid. It works indeed not in the OpenWRT way and be much complicated. If this solution is not acceptable by OpenWRT then devs or users, at least one of them will be quite headache.

glimberg commented 3 years ago

Well unfortunately that cannot be avoided.

ogarcia commented 3 years ago

As I say we cannot accept changes that have not been accepted by upstream. If upstream consider that have this improvement is bad idea, we cannot do anything.

Anyway now you can configure option config_path '/etc/zerotier' to persist zerotier config files and .moons files.