-
Notifications
You must be signed in to change notification settings - Fork 154
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
feat: capability and tags support #35
Comments
I agree that it would be nice to be able to change the node tags in the UI. Currently if you have the tags defined under your flow rules as your screenshot shows, you can use an API call to the controller to set the tags. This is an example of what I've used: The value after X-ZT1-AUTH is the API token of the ZT controller. Reference for the controller API is here: https://my.zerotier.com/central-api.html#member-member-post |
@timothyle97 Yes, and zero-ui Flow rule currently does not support cap and tag, it will be ignored, there may be small bugs. e.g.
|
@chenall If I'm not mistaken the tags are implemented by the ZT controller, not Zero-UI. I believe if the tags are set on the network and the members via the API, any flow rules referencing the tags should work even though the preview shows the tags are empty. @dec0dOS I've found another project which acts as a command line interface to set the tags on the network and members for ZTNCUI: https://github.com/Fusion/ztncli |
It's indeed a bug in zero-ui's flow rule editor which will ignore tags and caps, I've already fixed it but I haven't do a thoroughly test. zero-ui/frontend/src/components/NetworkRules/NetworkRules.jsx Lines 54 to 62 in ee6a84e
tags and caps should be object instead of array, the rule compiler uses them as objects to store parse result with names as keys. |
Hello, @snachx, thanks for sharing! Please reach out to me if it works as expected for you. |
@dec0dOS hello, you can check the detail of the rule compiler zero-ui/frontend/src/external/RuleCompiler.js Lines 1042 to 1047 in ee6a84e
zero-ui/frontend/src/external/RuleCompiler.js Lines 1120 to 1124 in ee6a84e
the compile method uses caps and tags different from rules if we pass arrays as tags and caps, the spread syntax ...tags ...caps can't handle the result returned by the compile method. I tried to init tags and caps as empty object and change the setFlowData method, it works as expected. |
Also, even if the bug is fixed, the ui interface to set member's group and capabilities still needs to be developed, I've checked MemberSettings.jsx, there's no such support yet. I intend to implement this feature, but don't have time to do it yet. |
Feature Request
Describe the Feature Request
Not sure if the self-built controller supports these functions
Additional Context
The text was updated successfully, but these errors were encountered: