Code Monkey home page Code Monkey logo

gozer's Introduction

gozer - Golang + Zerotier

Gozer is an API client for the Zerotier One software-defined-network written in Go

Zerotier is a great (freemium) service that allows your Mac, Linux, Windows, iOS and Android systems to form a "virtual LAN" no matter where they are in the world.

With Zerotier you can manage your servers even if they are behind a distant firewall, or mobile, or dynamic IP.

I wrote this client becuase I wanted a way (besides using ZeroTier's web console) to quickly find the status and IP of all the hosts on my zerotier SDN.

By default gozer shows your connected network(s):

chris@Auric: () You are in ~/src/go/me/gozer (master)
So what are you going to DO about it? $ gozer
christopher_biggs    e5cdREDACTEDf921 192.168.191.1--192.168.191.254 devices belonging to Christopher Biggs

With flags, it can show all the peers:

chris@Auric: () You are in ~/src/go/me/gozer (master)
So what are you going to DO about it? $ gozer -h
Usage of gozer:
  -a	Show status for all networks
  -active
    	Show only active network members
  -all
    	Show status for all networks
  -api-token string
    	ZeroTier API token
  -api-token-file string
    	File containing ZeroTier API token (default "${HOME}/.gozer-token")
  -debug
    	Turn on debug trace
  -verbose
    	Turn on verbose log

chris@Auric: () You are in ~/src/go/me/gozer (master)
So what are you going to DO about it? $ gozer -a
christopher_biggs    e5cdREDACTEDf921 192.168.191.1--192.168.191.254 devices belonging to Christopher Biggs
                     45SEKRITe3 []  Unauthorized Offline
     auric           0fSEKRITa5 [192.168.191.231               ]
     enceladus       38SEKRITbb [192.168.191.83                ]  Offline
     gabriel         6aSEKRITc4 [192.168.191.232               ]
     palantir        f1SEKRIT10 [192.168.191.54                ]  Offline
     pimento         03SEKRIT15 [192.168.191.180               ]
     pinacolada      47SEKRIT9f [192.168.191.76                ]  Offline
     pintsize        b5SEKRIT96 [192.168.191.105               ]  Offline
     serendipity     dfSEKRIT93 [192.168.191.164               ]
     tindog          97SEKRIT8e [192.168.191.4                 ]
     trippy          b8SEKRIT70 [192.168.191.170               ]  Offline
     tweety          53SEKRITd5 [192.168.191.206               ]
     umbriel         83SEKRITcb [192.168.191.124               ]
     vulpine         bfSEKRIT5a []

Installation

  1. go get github.com/unixbigot/gozer
  2. Login to zerotier.com and create an API key
  3. Create a network via the Zerotier web api, or choose an existing one
  4. save your API key as ~/.gozer-token
  5. Join a network: sudo zerotier-cli join <id>
  6. Use the zerotier web console to approve the join
  7. Run gozer --all

FAQ

  • What if I do not own the network I want to list

    I think you need to be able to authenticate as the network owner to use the relevant parts of the API, sorry.

  • What if I am joined to several networks with different owners?

    You need to authenticate as the network owner for each.

    You will need to install an API key for each owner, and use the command line options to select which owner to authenticate as.

    I welcome a pull request to query multiple accounts at once.

  • Why not use existing zerotier-cli listpeers?

    Zerotier-cli doesn't tell you the IP of the other peers.

    I could have fixed that, but I wanted to play around with Go.

  • Gozer?

    Gozer the Traveler. He will come in one of the pre-chosen forms. During the rectification of the Vuldrini, the traveler came as a large and moving Torg! Then, during the third reconciliation of the last of the McKetrick supplicants, they chose a new form for him: that of a giant Slor! Many Shuvs and Zuuls knew what it was to be roasted in the depths of the Slor that day, I can tell you!

gozer's People

Contributors

unixbigot avatar

Watchers

 avatar  avatar

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.