GithubHelp home page GithubHelp logo

ztui's Introduction

ztui: your one-stop shop for ZeroTier terminal UI goodness

ztui aims to be a frontend for all interactions with ZeroTier in an attempt to transform how people work with it. It provides the following features:

  • Main Screen:
    • Bookmarks for Networks (disconnecting does not make the network id disappear from the list, and you can rejoin easily)
    • Interaction directly with Central members from the network list.
    • Joining, Leaving Networks
    • Per-Network bandwidth statistics
    • Bind arbitrary commands to keys that use a template to launch (see more on this below)
    • Review the network JSON formatted pretty
    • Launch $EDITOR against a file of network rules (and save them back to central)
  • Central / Member List:
    • Rename members
    • Auth, Unauth, and Delete members

Networks List View:

Members List / Network View:

Installing

Get Rust 1.60 or better if you need to. You'll need it.

cargo install ztui

You may also appreciate our GitHub Releases!

Configuring arbitrary commands

Rules

  • Command must not be mapped by existing commands
  • Will be executed in a shell; quote accordingly

Configuration Syntax

After you start ztui for the first time, $HOME/.config.zerotier/settings.json will be created for you with your last-saved network information. Now, what we want to do is create $HOME/.config.zerotier/config.json and add something like this:

{
    "network_commands": {
        "1": "/bin/tcpdump -i %i"
    },
    "member_commands": {
        "1": "/bin/iperf -c %a"
    }
}

Network format strings available:

  • %i: the interface of the ZeroTier network
  • %n: the network ID of the ZeroTier network
  • %a: the first addresses in the list of assigned IP addresses

In this case, it would allow me to press 1 over a network to tcpdump its interface; then I would control+C out of it to come back to ztui.

Member format strings available:

  • %n: the network ID of the ZeroTier network
  • %i: the identity of the member of this ZeroTier network
  • %a: the first assigned IP address of this member
  • %N: the name (not the fqdn!) of the ZeroTier network member as it appears in central

In the above example, it allows me to start an iperf client against the address of the selected member.

Author

Erik Hollensbe [email protected]

ztui's People

Contributors

erikh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ztui's Issues

Errors during install

Cool project. I am hitting some build errors while trying to install.

Versions

rustc 1.57.0
cargo 1.57.0
Ubuntu 20.04.4 LTS

Error

> cargo install --git https://github.com/erikh/ztui
...
error[E0277]: expected a `FnMut<(char,)>` closure, found `[char; 2]`
Error Details
error[E0277]: expected a `FnMut<(char,)>` closure, found `[char; 2]`
   --> /home/alan/.cargo/registry/src/github.com-1ecc6299db9ec823/progenitor-impl-0.1.1/src/method.rs:980:47
    |
980 |         buf.push_str(summary.trim_end_matches(['.', ',']));
    |                              ---------------- ^^^^^^^^^^ expected an `FnMut<(char,)>` closure, found `[char; 2]`
    |                              |
    |                              required by a bound introduced by this call
    |
    = help: the trait `FnMut<(char,)>` is not implemented for `[char; 2]`
    = note: required because of the requirements on the impl of `Pattern<'_>` for `[char; 2]`

error[E0277]: expected a `FnMut<(char,)>` closure, found `[char; 2]`
    --> /home/alan/.cargo/registry/src/github.com-1ecc6299db9ec823/progenitor-impl-0.1.1/src/method.rs:1019:47
     |
1019 |         buf.push_str(summary.trim_end_matches(['.', ',']));
     |                              ---------------- ^^^^^^^^^^ expected an `FnMut<(char,)>` closure, found `[char; 2]`
     |                              |
     |                              required by a bound introduced by this call
     |
     = help: the trait `FnMut<(char,)>` is not implemented for `[char; 2]`
     = note: required because of the requirements on the impl of `Pattern<'_>` for `[char; 2]`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `progenitor-impl` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `ztui v0.1.0 (https://github.com/erikh/ztui#d05415ba)`, intermediate artifacts can be found at `/tmp/cargo-installt5ZG8R`

Caused by:
  build failed

Cannot escape help screen

Hi,

I'm on Ubuntu 22.04. If I press "h" for the help screen and then press "Esc" the help screen does not go away and I have to close the terminal to proceed. Tried on v0.1.4.

Does not compile

Currently this does not compile on arch linux using the AUR package.

Build log
error[E0061]: this function takes 1 argument but 0 arguments were supplied
   --> /home/glizzy/.cargo/registry/src/github.com-1ecc6299db9ec823/zerotier-one-api-1.2.0/build.rs:7:25
    |
7   |     let mut generator = progenitor::Generator::new();
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^-- an argument of type `&GenerationSettings` is missing
    |
note: associated function defined here
   --> /home/glizzy/.cargo/registry/src/github.com-1ecc6299db9ec823/progenitor-impl-0.2.0/src/lib.rs:124:12
    |
124 |     pub fn new(settings: &GenerationSettings) -> Self {
    |            ^^^
help: provide the argument
    |
7   |     let mut generator = progenitor::Generator::new(/* &GenerationSettings */);
    |                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0061]: this function takes 1 argument but 0 arguments were supplied
   --> /home/glizzy/.cargo/registry/src/github.com-1ecc6299db9ec823/zerotier-central-api-1.2.0/build.rs:7:25
    |
7   |     let mut generator = progenitor::Generator::new();
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^-- an argument of type `&GenerationSettings` is missing
    |
note: associated function defined here
   --> /home/glizzy/.cargo/registry/src/github.com-1ecc6299db9ec823/progenitor-impl-0.2.0/src/lib.rs:124:12
    |
124 |     pub fn new(settings: &GenerationSettings) -> Self {
    |            ^^^
help: provide the argument
    |
7   |     let mut generator = progenitor::Generator::new(/* &GenerationSettings */);
    |                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~

For more information about this error, try `rustc --explain E0061`.
error: could not compile `zerotier-one-api` due to previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `zerotier-central-api` due to previous error
==> ERROR: A failure occurred in build().
    Aborting...

This is using both the latest current rust and rust 1.60.0 per the readme.

I'm assuming it's due to pulling in the new version of progenitor being pulled in by I believe zerotier-central-api. Even when adjusting the cargo.toml to enforce the use of the correct zerotier stuff and progenitor packages it was pulling in progenitor 0.2.0 as well as 0.1.1 and building with the 0.2.0 version, causing the above.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.