Closed guideloom closed 1 year ago
I think this is an issue with zerotier itself. I've opened the following there: https://github.com/zerotier/ZeroTierOne/issues/1654
zerotier have confirmed this is a bug. As a result they are going to change the json output of "zerotier-cli listpeers -j" to resolve this issue.
I don't know if that change is going to affect this project, but in the interests of a "heads up".. you may want to view the issue listed above and followup once the code changes are pushed out.
I edit the src/views/network_detail.pug file and starting from 136 rows. I delete the first 'if' sentence and add another line span() #{peer.paths[0].address}
then, In my server, I just got one IP address.
Can you post a patch file for this? See here on how to create one: https://www.thegeekstuff.com/2014/12/patch-command-examples/
--- edited file
+++ original file
@@ -133,10 +133,15 @@
else
span(style='color: red;') OFFLINE
td
- span() #{peer.paths[0].address}
- if (peer.latency != -1)
- br
- | (#{peer.latency} ms)
+ if (peer)
+ each path in peer.paths
+ - const [ip, port] = path.address.split('/');
+ = ip
+ span(style='color: gray;') /#{port}
+ = ' '
+ if (peer.latency != -1)
+ br
+ | (#{peer.latency} ms)
else
.alert.alert-info
strong There are no members on this network - invite users to join #{network.nwid}
Can you post a patch file for this? See here on how to create one: https://www.thegeekstuff.com/2014/12/patch-command-examples/
sorry. I find a bug when one peer's status is offline, the website will not work. so, I put a correct code file.
--- tmp/src/views/network_detail.pug 2022-05-13 08:16:00.317863121 +0800
+++ ztncui/src/views/network_detail.pug 2022-05-15 09:36:26.342241570 +0800
@@ -133,12 +133,8 @@
else
span(style='color: red;') OFFLINE
td
- if (peer)
- each path in peer.paths
- - const [ip, port] = path.address.split('/');
- = ip
- span(style='color: gray;') /#{port}
- = ' '
+ if ( peer )
+ span() #{peer.paths[0].address}
if (peer.latency != -1)
br
| (#{peer.latency} ms)
这个到底有什么办法可以去除掉重复的啊?看着太难受了,虽然不影响使用
@guideloom Try installing this version manually on the server as I have no issue with it and I also tried on a fresh VM and found no such issues that you have mentioned above.
@guideloom Try installing this version manually on the server as I have no issue with it and I also tried on a fresh VM and found no such issues that you have mentioned above.
Also when I tried the latest version of zerotier I had the same issue that you mentioned above.
This is also happening on my server as well with zerotier v1.10.1.
I reverted back to v1.6.5 as mentioned in the thread and so far I'm not seeing duplicates. I will report back as it does take a bit for the dupes to show.
This is 95% a problem with zerotier listpeers in json format returning many duplicate entries as per https://github.com/zerotier/ZeroTierOne/issues/1654; waiting on the zerotier folks to resolve this.
In the meantime, perhaps the ztncui folks can filter the output of that information grab to remove duplicates before displaying them in the web interface?
Going back to zerotier v1.6.5 does fix the issue. Once zerotier fixes the bug in the newer versions I will try it out, but for now this seems like a temporary workaround.
My temp solution: add if (path.preferred == true)
after each path in peer.paths
in views/network_detail.pug
file
Update: There are multiple preferred items in current version(1.10.2), we can add a break if we don't need it.
Final code looks like this:
If you are using ztncui 0.8.6 x86_64 version and don't want repack executable file, just replace /opt/key-networks/ztncui/ztncui with ztncui.tar.gz (don't forget extract, chown to ztncui user and gives it execute permission)
@TkYu can you show the code you are using in views/network)detail.pug
?
Fixed for me by updating to zerotier one 1.10.3
Fixed for me by updating to zerotier one 1.10.3
key-networks closed this as completed
Still have the issue.
v0.8.12 of #ztncui is available for testing. The DEB package is here: https://key-networks.s3.us-west-1.amazonaws.com/deb/ztncui/1/x86_64/ztncui_0.8.12_amd64.deb
The RPM can be installed with:
sudo dnf --enablerepo=ztncui-testing upgrade ztncui
This includes the fix from @TkYu .
Please let me know if this resolves the issue.
Please try this one after upgrading to ZT 1.10.4:
For DEB: https://key-networks.s3.us-west-1.amazonaws.com/deb/ztncui/1/x86_64/ztncui_0.8.13_amd64.deb
For RPM: sudo dnf --enablerepo=ztncui-testing upgrade ztncui
Confirmed multiple peer latency entries fixed on ZT 1.10.4 with ZTNCUI 0.8.13
Ah, that's great - thanks for confirming that @noodlenoggan !
@key-networks
I tried to modify the code in the file by myself, and compile, install and run, the test result is perfect
That's great, @TcDhlPro !
For some of the members, there are multiple peer lines.. like LOTS of them. Can the duplicate lines be removed?