Open daymr opened 1 year ago
I realise I'm replying to an old issue, but you -can- do this anyway, just not via the UI.
Just add this to the ports section of the zerotier service in docker-compose so that you can directly access the controller...
- "9993:9993/tcp"
... and then restart the docker ...
docker-compose up -d
Then execute this:-
TOKEN=$(sudo cat /srv/zero-ui/zerotier-one/authtoken.secret)
NWID=your_network_id
curl -X POST "http://localhost:9993/controller/network/${NWID}" -H "X-ZT1-AUTH: ${TOKEN}" \
-d '{"dns": { "domain": "YOUR-DOMAIN-HERE", "servers": ["192.168.1.2","192.168.1.3"] } }'
Obviously you need to make sure 9993/tcp is blocked at the firewall level if you do this.
I realise I'm replying to an old issue, but you -can- do this anyway, just not via the UI.
Just add this to the ports section of the zerotier service in docker-compose so that you can directly access the controller...
- "9993:9993/tcp"
... and then restart the docker ...
docker-compose up -d
Then execute this:-
TOKEN=$(sudo cat /srv/zero-ui/zerotier-one/authtoken.secret) NWID=your_network_id curl -X POST "http://localhost:9993/controller/network/${NWID}" -H "X-ZT1-AUTH: ${TOKEN}" \ -d '{"dns": { "domain": "YOUR-DOMAIN-HERE", "servers": ["192.168.1.2","192.168.1.3"] } }'
Obviously you need to make sure 9993/tcp is blocked at the firewall level if you do this.
This doesn't work at all...access denied
Did you replace 'your_network_id' with your network ID?
Did you replace 'your_network_id' with your network ID?
I won't risk running the above command and ruining an already wicked deployement...
curl "http://zerotier:9993/controller/network/e2df222b16f332ce/member" -H "X-ZT1-AUTH: $(sudo cat /var/lib/zerotier-one/authtoken.secret)" | jq % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: zerotier
I am sorry for the rudeness but this UI is so badly documented that you have to trial and error until you "make" it work. And then you just can't communicate with the API at all.
Let me tell you this. I deployed the container yesterday following strictly the "installation guide" and it didn't work out of the box (apparently). I then installed zerotier-one and managed to login to localhost:4000 but could not create a network (the button wouldn't respond even if you cleared the cache). THEN I removed the zerotier-one package (sudo remove didn't remove the var/lib/zerotier-one directory at all (lol)) and only then managed to create a network. Now I cannot join the controller to the network because where am I supposed to look at? You get two zerotier directories in var/lib and srv/zero-ui with separate tokens. I think this is some bad comedy already but it is actually sad. Because this image mitigates some problems with ztncui but all this container stuff makes it a big no go.
You are attempting to connect to 'zerotier' not localhost. And anyway, even if it did work, it wouldn't have worked because you're targeting the wrong folder there. The zerotier instance that belongs to zero-ui is in /srv/zero-ui.
I can't comment on the rest of your post... All I can tell you is that everything worked first time for me out of the box. You do not need to (and should not have) manually installed zerotier. It's part of the container - so you now have two copies of zerotier on that machine.
I'd start again from scratch to be honest.
Feature Request
Describe the Feature Request
The ability to configure domain and DNS that is pushed to zerotier clients. Similar to Zerotier Central hosted solution..![image](https://github.com/dec0dOS/zero-ui/assets/23305998/41765bc6-e5d1-4cf6-bf73-c66a4e60c164)
Describe Preferred Solution
enable the webUI to POST to API the following... http://localhost:9993/controller/network/{networkID}
"dns": { "domain": "some.domain", "servers": ["10.0.0.3"] }
Describe Alternatives
I have developed a dirty workaround for my windows deployment because of the lack of the proposed functionality... Powershell deployment script to clients..
Related Code
enable the webUI to POST to API the following... http://localhost:9993/controller/network/{networkID}
"dns": { "domain": "some.domain", "servers": ["10.0.0.3"] }
Additional Context
none
If the feature request is approved, would you be willing to submit a PR? Yes