Bug 274660 - net/zerotier API/controller not working properly
Summary: net/zerotier API/controller not working properly
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Dave Cottlehuber
URL:
Keywords:
Depends on: 277735
Blocks:
  Show dependency treegraph
 
Reported: 2023-10-22 22:09 UTC by wired2network
Modified: 2024-03-16 10:48 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (dch)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wired2network 2023-10-22 22:09:59 UTC
Team,

I am trying to get zerotier on OPNsense's FreeBSD to operate as a controller. I attempted to use the API commands to elevate to a controller but get illegal variable using X-ZT1-Auth.

CONTROLLER_ID=$(zerotier-cli info | cut -d' ' -f 3)
curl -X POST \
 -H "X-ZT1-Auth: $(cat /var/lib/zerotier-one/authtoken.secret)" \
 -d '{"name":"love death and robots"}' \
 "http://localhost:9993/controller/network/${CONTROLLER_ID}______"

perhaps since I am using the wrong variable or API commands to perform this operation? I did attempt to force the files into the appropriate controller.d folder to create a controller, which built out the associated folder housing the members. When I attempted to add nodes to this controller, the controller received  the member files for authenticated, but everytime I change the status to authorized: true, the system tends to revert it back to false. I also attempted to adjust the zerotier-one file to state true for the controller, but this also resulted in not being able to authorize nodes. Can you please help point me in the right direction?

"controller": true,
"apiVersion": %d,
"clock": %llu
"databaseReady": %s
Comment 1 Dave Cottlehuber freebsd_committer freebsd_triage 2024-01-04 23:49:02 UTC
I'm guessing this is more of a user issue, best dealt with on ZT forums.

- the token lives in /var/db/zerotier-one/authtoken.secret on FreeBSD at least
- due to https://github.com/zerotier/ZeroTierOne/issues/2151 you may need to
  add this to /var/db/zerotier-one/local.conf

```json
{
  "settings": {
    "allowManagementFrom": ["::"],
   ...
```