Spokes v0.9.11 Updates

We don’t talk often about Spokes, our self-hosted server, but we’ve been busy making updates to it the past few weeks and we have some updates and new features we think are going to really helpful with managing your Spokes sever.

Every wanted to self-host ngrok or an alternative? Spokes can do all that and you can re-use the Packetriot client that provides more modern features than these other services.

Check out our full documentation to learn everything you can do with Spokes.

Updates

In our last release, v0.9.9, we added registration tokens which allow more programmatic creation of tunnels. This is going to be very helpful for device (IoT) manufacturers. Device makers can now create tunnels automatically on first-boot or factory resets.

We added a +20% buffer for maximum number of tunnels generated when using registration a token. We thought some room to shift tunnels/clients around may be helpful when you have a fleet of devices. Note, if you are creating tokens in the CLI it will not provide any buffer there since a human is there is manage any issues.

Our crontab jobs for managing bandwidth metrics are not fully working as expected. Daily metrics are now reset at 00:00 UTC and monthly metrics are reset on the first of the month. You can view the crontab by switch the spokes and using this command.

[user@host:~/] sudo su spokes

[spokes@host:~/] crontab -l
# reset daily metrics for tunnels at 00:10 each morning.
10 0 2-31 * *	/usr/bin/spokes metrics reset daily

# reset monthly metrics for tunnels at 00:30 on the first
# day of each month.
30 0 1 * *	/usr/bin/spokes metrics reset monthly

# aggregate metrics data locally every 5 minutes
*/5 * * * *	/usr/bin/spokes metrics update

With bandwidth metric recorded daily and monthly, you will not be able to monitor how much data your tunnels (clients) are using.

We use this on managed Packetriot servers to meter and track usage and we thought it would be just as helpful and useful to our Spokes users.

New Commands

We added a bunch of new commands to the CLI after we received requests from some of our users. Thank you for the suggestions!

New commands available in v0.9.11: port, tunnel and clean.

The port command will list all the allocated ports and their associated tunnels.

[user@host] spokes port ls

+------------------------------------------------------------------------------------------------------------------+
| Port No.   | User   | Tunnel ID                          | Tunnel Online   | Tunnel Uptime   | Daily / Monthly   |
+------------------------------------------------------------------------------------------------------------------+
| 22817      | jack   | 70fddfb497874f1e8e99a4140f3cad0d   | false           | 0 secs          | 0.00 B / 0.00 B   |
+------------------------------------------------------------------------------------------------------------------+
| 22708      | jack   | 70fddfb497874f1e8e99a4140f3cad0d   | false           | 0 secs          | 0.00 B / 0.00 B   |
+------------------------------------------------------------------------------------------------------------------+
| 22459      | jack   | 70fddfb497874f1e8e99a4140f3cad0d   | false           | 0 secs          | 0.00 B / 0.00 B   |
+------------------------------------------------------------------------------------------------------------------+
| 22212      | jack   | 70fddfb497874f1e8e99a4140f3cad0d   | false           | 0 secs          | 0.00 B / 0.00 B   |
+------------------------------------------------------------------------------------------------------------------+

4 port allocations

The tunnel command will list all tunnels, their info, hosts (IPs) and data consumption.

[user@host] spokes tunnel ls

+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ID                                 | User   | Hostname                    | Online   | Address         | Uptime   | Daily / Monthly   | Created              |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 8cf14c7e48fd4addb5f6daa5af7da969   |        | tun-01.spokes.example.com   | false    |                 | 0 secs   | 0.00 B / 0.00 B   | Mar 20, 2020 17:28   |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 4a2954d4eff04fe9bf881ea546f827ba   |        | tun-02.spokes.example.com   | false    |                 | 0 secs   | 0.00 B / 0.00 B   | Mar 20, 2020 17:28   |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 5d906dcf26ab4e67909ad3ffc282b770   |        | tun-03.spokes.example.com   | false    |                 | 0 secs   | 0.00 B / 0.00 B   | Mar 20, 2020 17:29   |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 399b236fdfa84c58b46acf7db7d00562   |        | testing-non-functional      | false    |                 | 0 secs   | 0.00 B / 0.00 B   | Mar 20, 2020 17:29   |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 810b2453b97c44f8bdb1369126e99489   | jack   | tun-10.spokes.example.com   | false    |                 | 0 secs   | 0.00 B / 0.00 B   | Mar 20, 2020 17:31   |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 6bb481ae9e614686a23d12470ae69d76   | jack   | tun-11.spokes.example.com   | false    |                 | 0 secs   | 0.00 B / 0.00 B   | Mar 20, 2020 17:31   |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 70fddfb497874f1e8e99a4140f3cad0d   | jack   | tun-13.spokes.example.com   | false    | 123.45.67.89    | 0 secs   | 0.00 B / 0.00 B   | Mar 20, 2020 17:31   |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------+

7 tunnels

Finally we the clean command will perform some house-keeping (this operation is also performed by the server periodically as well).

[user@host] spokes clean

Issues Fixed (tunnels + ports): 0

Updates to Existing Features

We added custom hostname for tunnels and can be found in two places. You can specify a hostname in the Packetriot client when you run pktriot unmanaged configure. Here is an example.

[user@host] pktriot unmanaged configuration --hostname tun-01.spokes.example.com --registration <token...>

The hostname is not funtional. If you setup a wildcard domain for your Spokes server then it can be if the hostname will be resolved using a wildcard domain record. Check out our documentation for more information setting up a wildcard domain.

The second place is when you generate an auth token on the Spokes server side. You can use the command spokes token create and input a hostname/nickname there as well. Here is an example of that.

[user@host] spokes token create --hostname tun-01.spokes.example.com
Client auth-token:
c6e15c70e9a6504dd1fe036d23b...

Hope you enjoy these new features and updates! Have any feature suggestions, please reach out on Twitter or email.

Cheers!