-
Notifications
You must be signed in to change notification settings - Fork 751
net/zerotier: Configure ZeroTier network options #4746
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
base: master
Are you sure you want to change the base?
Conversation
47791ad to
de9a56c
Compare
|
Amended pull request to include writing local.conf files. This is needed to preserve configuration when enabling/disabling (joining/leaving) a network. |
|
Please review when possible. |
|
Hi Thank you kindly for your PR - however, I'm no longer actively maintaining the plugin (haven't for many years). In essence, it's sorta in an "orphaned state". Perhaps someone at Opnsense can pick it up for reviewing this PR :-) Hope that helps. -=david=- |
|
Hello @dharrigan Sir I hope you are good! I've added 5032208 to address your wish. :) @divinehawk Although it's unmaintained we do accept PR's if you want to work on it. At the moment there is no plan to remove the plugin. |
| $this->setZerotierNetwork($network->networkId, 'allowManaged', $network->allowManaged); | ||
| $this->setZerotierNetwork($network->networkId, 'allowGlobal', $network->allowGlobal); | ||
| $this->setZerotierNetwork($network->networkId, 'allowDefault', $network->allowDefault); | ||
| $this->setZerotierNetwork($network->networkId, 'allowDNS', $network->allowDNS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks rather odd, but the controller is also quite old
what is your goal here to directly apply this after config save?
| $backend->configdRun("template reload OPNsense/zerotier"); | ||
| $action = $enabled ? 'join' : 'leave'; | ||
| return trim((new Backend())->configdRun("zerotier $action $networkId")); | ||
| return trim($backend->configdRun("zerotier $action $networkId")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this already was an unsafe call, check out configdpRun()
|
|
||
| private function setZerotierNetwork($networkId, $setting, $value) | ||
| { | ||
| return trim((new Backend())->configdRun("zerotier set $networkId $setting $value")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is also unsafe, check configdpRun()
| <default></default> | ||
| <Required>N</Required> | ||
| </description> | ||
| <allowManaged type="BooleanField"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since you add new required values with defaults the model version at the beginning of this file needs to be increased
| @@ -1,2 +1,3 @@ | |||
| zerotier:/etc/rc.conf.d/zerotier | |||
| local.conf:/var/db/zerotier-one/local.conf | |||
| networks-local.conf:/var/db/zerotier-one/networks.d/[OPNsense.zerotier.networks.network.%.networkId].local.conf | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note these files generated with dynamic names can not be deleted...
|
Hi @fichtner Thank you for picking this up. I wish I had more time for OPNSense - but at the moment, I'm working on other things. Perhaps 'tho in the future I can help out again :-) Thanks again! :-) -=david=- |
(cherry picked from commit 5032208)
This pull requests adds in the four configurable options for Zerotier networks: allowManaged, allowGlobal, allowDefault, allowDNS.
Zerotier defaults are used for these options.
Referenced in: #4011