Author SHA1 Message Date
Key Networks 16b0034cbf IPv6_route_del: version bump 2021-12-31 09:28:26 +08:00
lidemingandKey Networks 2b1409e721 fix IPv6 route target comparing 2021-12-31 09:27:08 +08:00
7 changed files with 39 additions and 51 deletions
+23 -14
View File
@@ -10,7 +10,7 @@ Follow us on [![alt @key_networks on Twitter](https://i.imgur.com/wWzX9uB.png)](
Instructions for installing on Linux from RPM or DEB packges are available at [key-networks.com/ztncui](https://key-networks.com/ztncui). Instructions for installing on Linux from RPM or DEB packges are available at [key-networks.com/ztncui](https://key-networks.com/ztncui).
## Docker Container Image ## Docker Container Image
See [https://github.com/key-networks/ztncui-aio](https://github.com/key-networks/ztncui-aio) See [github.com/key-networks/ztncui-containerized](https://github.com/key-networks/ztncui-containerized)
## Getting Started ## Getting Started
@@ -45,9 +45,21 @@ npm install
##### 3. authtoken.secret ##### 3. authtoken.secret
The app needs to know the zerotier-one authtoken.secret. The app needs to know the zerotier-one authtoken.secret. There are two options:
###### Make a .env file ###### A: Allow access to /var/lib/zerotier-one/authtoken.secret
The user running the ztncui app needs read access to authtoken.secret. This can be achieved with:
```shell
sudo usermod -aG zerotier-one username
sudo chmod g+r /var/lib/zerotier-one/authtoken.secret
```
Where:
* username is the user running the ztncui app
Note that you need to log out and in again to apply the new group membership.
###### OR
###### B: Make a .env file
In the root of the ztncui directory, create a `.env` file with the content: In the root of the ztncui directory, create a `.env` file with the content:
``` ```
ZT_TOKEN=######################## ZT_TOKEN=########################
@@ -55,19 +67,17 @@ ZT_TOKEN=########################
Where: Where:
* ######################## is the token string. * ######################## is the token string.
After all edits to the `.env file` (see other options below), make the `.env` readable by the user running ztncui only: You can also specify in the `.env` file a different address for the zerotier-one API (which defaults to localhost:9993):
```shell
chmod 400 .env
chown ztncui.ztncui .env
```
##### 4. Zerotier-one API port
You can specify in the `.env` file a different address for the zerotier-one API (which defaults to localhost:9993):
``` ```
ZT_ADDR=localhost:9995 ZT_ADDR=localhost:9995
``` ```
Make `.env` readable by the user running ztncui only:
```shell
chmod 600 .env
```
The `.env` file should make it easier to run ztncui on a non-Linux platform.
##### 4. Run in production mode ##### 4. Run in production mode
To run the server in production mode, add the following to the `.env` file (see 3B above): To run the server in production mode, add the following to the `.env` file (see 3B above):
@@ -305,5 +315,4 @@ Problems with ztncui can be reported using the GitHub issue tracking system. Pl
The ztncui code is open source code, licensed under the GNU GPLv3, and is free to use on those terms. If you are interested in commercial licensing, please contact us via the contact form at [key-networks.com](https://key-networks.com) . The ztncui code is open source code, licensed under the GNU GPLv3, and is free to use on those terms. If you are interested in commercial licensing, please contact us via the contact form at [key-networks.com](https://key-networks.com) .
## Thanks ## Thanks
- @lideming for a rework and improvement of the network details page, adding DNS support, peer status/address/latency and other improvements. @lideming for a rework and improvement of the network details page, adding DNS support, peer status/address/latency and other improvements.
- @Koromix for a fix for incompatibility with ZeroTier 1.12.
-8
View File
@@ -1,8 +0,0 @@
getent passwd ztncui || useradd --system --home-dir /opt/key-networks/ztncui --shell /bin/false ztncui
if [ $(getent group zerotier-one) ]; then
echo "Adding user ztncui to group zerotier-one..."
usermod -a -G zerotier-one ztncui
chmod g+r /var/lib/zerotier-one/authtoken.secret
else
echo "Could not add user ztncui to group zerotier-one... is zerotier-one installed?"
fi
+1 -1
View File
@@ -4,7 +4,7 @@
], ],
"cflags+": ["-Wno-cast-function-type"], "cflags+": ["-Wno-cast-function-type"],
"include_dirs+": ["<!(node -e \"require('nan')\")"], "include_dirs+": ["<!(node -e \"require('nan')\")"],
+ "libraries": ["/usr/lib/gcc/x86_64-redhat-linux/8/libstdc++fs.a"], + "libraries": ["/usr/lib/gcc/x86_64-redhat-linux/8/libstdc++.a"],
"dependencies": ["libargon2"], "dependencies": ["libargon2"],
"configurations": { "configurations": {
"Debug": { "Debug": {
+1 -1
View File
@@ -26,7 +26,7 @@ BINDINGGYP='node_modules/argon2/binding.gyp'
NODE_VER='v16' NODE_VER='v16'
if [ ! -f /usr/lib/gcc/x86_64-redhat-linux/8/libstdc++fs.a ]; then if [ ! -f /usr/lib/gcc/x86_64-redhat-linux/8/libstdc++.a ]; then
echo "You must install libstdc++-static" echo "You must install libstdc++-static"
exit 1 exit 1
fi fi
+4 -15
View File
@@ -17,26 +17,15 @@ async function get_network_with_members(nwid) {
zt.network_detail(nwid), zt.network_detail(nwid),
zt.peers(), zt.peers(),
zt.members(nwid) zt.members(nwid)
.then(member_ids => { .then(member_ids =>
// Fix weird data returned by ZeroTier 1.12 Promise.all(
if (Array.isArray(member_ids)) {
let obj = {};
for (let id of member_ids) {
let key = Object.keys(id)[0];
let value = Object.values(id)[0];
obj[key] = value;
}
member_ids = obj;
}
return Promise.all(
Object.keys(member_ids) Object.keys(member_ids)
.map(id => Promise.all([ .map(id => Promise.all([
zt.member_detail(nwid, id), zt.member_detail(nwid, id),
storage.getItem(id) storage.getItem(id)
])) ]))
); )
}).then(results => results.map(([member, name]) => { ).then(results => results.map(([member, name]) => {
member.name = name || ''; member.name = name || '';
return member; return member;
})) }))
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "ztncui", "name": "ztncui",
"version": "0.8.14", "version": "0.8.5",
"private": true, "private": true,
"scripts": { "scripts": {
"start": "node ./bin/www", "start": "node ./bin/www",
@@ -19,7 +19,7 @@
"got": "^7.1.0", "got": "^7.1.0",
"helmet": "^3.23.0", "helmet": "^3.23.0",
"ip-address": "^5.8.9", "ip-address": "^5.8.9",
"jquery": "^3.6.1", "jquery": "~3.4.1",
"morgan": "~1.9.1", "morgan": "~1.9.1",
"node-persist": "^2.1.0", "node-persist": "^2.1.0",
"pug": "^3.0.2", "pug": "^3.0.2",
+1 -3
View File
@@ -1,6 +1,6 @@
//- //-
ztncui - ZeroTier network controller UI ztncui - ZeroTier network controller UI
Copyright (C) 2017-2023 Key Networks (https://key-networks.com) Copyright (C) 2017-2021 Key Networks (https://key-networks.com)
Licensed under GPLv3 - see LICENSE for details. Licensed under GPLv3 - see LICENSE for details.
extends network_layout extends network_layout
@@ -135,7 +135,6 @@ block net_content
td td
if (peer) if (peer)
each path in peer.paths each path in peer.paths
if (path.preferred == true)
- const [ip, port] = path.address.split('/'); - const [ip, port] = path.address.split('/');
= ip = ip
span(style='color: gray;') /#{port} span(style='color: gray;') /#{port}
@@ -143,7 +142,6 @@ block net_content
if (peer.latency != -1) if (peer.latency != -1)
br br
| (#{peer.latency} ms) | (#{peer.latency} ms)
- break
else else
.alert.alert-info .alert.alert-info
strong There are no members on this network - invite users to join #{network.nwid} strong There are no members on this network - invite users to join #{network.nwid}