ztcc provides a wrapper around the ZeroTier REST API for controlling a self-hosted ZeroTier controller. The intent of ztcc is to provide a command-line tool in the style of OpenStack's tools that enables straightforward interaction of the ZeroTier REST API from the command line.
The up to date list of prerequisites for running the python can be found in requirements.txt. Running ztcc requires access to a functioning install of of ZeroTier, generally on the same host.
- Install ZeroTier on the host see: https://www.zerotier.com/download.shtml for more information.
- Clone this repository
- Install any prerequisites from requirements.txt
- Create a YAML file with sample data
- run
pytest test_ztcc.py
ztcc can read things like the auth token other values as environment variables:
ZTCC_PORT: the port to contact the ZeroTier controller on, default is 9993.ZTCC_HOST: the hostname/ip address to contact the ZeroTier controller at, default islocalhost.ZTCC_AUTH_TOKEN: the Auth Token used to authenticate with the controller. For security sake, do not hard code this in a launch or service script, use it for sessions only.ZTCC_NET: The Network ID of the network you wish to get information on or modify.ZTCC_CONTROLLER: The Member ID of the instance of ZeroTier acting as a controller. NOTE: Environment variables take precedence over command line parameters.
network list --auth_token AUTH_TOKEN
network get --auth_token AUTH_TOKEN --network NETWORK_ID
network create --auth_token AUTH_TOKEN --controller CONTROLLER_ID
network delete --auth_token AUTH_TOKEN --network NETWORK_ID
network update --auth_token AUTH_TOKEN --network NETWORK_ID --name NETWORK_NAME
network update --auth_token AUTH_TOKEN --network NETWORK_ID --private
network update --auth_token AUTH_TOKEN --network NETWORK_ID --not-private
network update --auth_token AUTH_TOKEN --network NETWORK_ID --enable_broadcast
network update --auth_token AUTH_TOKEN --network NETWORK_ID --disable_broadcast
network update --auth_token AUTH_TOKEN --network NETWORK_ID --enable_v4_assign
network update --auth_token AUTH_TOKEN --network NETWORK_ID --disable_v4_assign
network update --auth_token AUTH_TOKEN --network NETWORK_ID --ip_pool_add POOL_START_IP:POOL_END_IP
network update --auth_token AUTH_TOKEN --network NETWORK_ID --ip_pool_del POOL_START_IP:POOL_END_IP
network update --auth_token AUTH_TOKEN --network NETWORK_ID --route_add NETWORK_IP/MASK_BITS
network update --auth_token AUTH_TOKEN --network NETWORK_ID --route_del NETWORK_IP/MASK_BITS
member list --auth_token AUTH_TOKEN --network NETWORK_ID
member get --auth_token AUTH_TOKEN --network NETWORK_ID --member MEMBER_ID
member update --auth_token AUTH_TOKEN --network NETWORK_ID --member MEMBER_ID --not_authorized
member update --auth_token AUTH_TOKEN --network NETWORK_ID --member MEMBER_ID --authorized
member update --auth_token AUTH_TOKEN --network NETWORK_ID --member MEMBER_ID --enable_active_bridging
member update --auth_token AUTH_TOKEN --network NETWORK_ID --member MEMBER_ID --disable_active_bridging
member update --auth_token AUTH_TOKEN --network NETWORK_ID --member MEMBER_ID --ip_add MANAGED_IP
member update --auth_token AUTH_TOKEN --network NETWORK_ID --member MEMBER_ID --ip_del MANAGED_IP
- ZeroTier: The target application
- Requests
- PurpleBooth: Excellent github README template
This project is licensed under the xxx license - see the LICENSE.MD file for details
Submit pull requests or issues to this github page.
ztcc uses semantic versioning. For release versions, check the tags in this repository.
- Josh Madden - Initial work - cyrex562