help.go 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright (c)2019 ZeroTier, Inc.
  3. *
  4. * Use of this software is governed by the Business Source License included
  5. * in the LICENSE.TXT file in the project's root directory.
  6. *
  7. * Change Date: 2023-01-01
  8. *
  9. * On the date above, in accordance with the Business Source License, use
  10. * of this software will be governed by version 2.0 of the Apache License.
  11. */
  12. /****/
  13. package cli
  14. import (
  15. "fmt"
  16. "zerotier/pkg/zerotier"
  17. )
  18. var copyrightText = fmt.Sprintf(`ZeroTier Network Virtualization Service Version %d.%d.%d
  19. (c)2019 ZeroTier, Inc.
  20. Licensed under the ZeroTier BSL (see LICENSE.txt)`, zerotier.CoreVersionMajor, zerotier.CoreVersionMinor, zerotier.CoreVersionRevision)
  21. // Help dumps help to stdout
  22. func Help() {
  23. fmt.Println(copyrightText)
  24. fmt.Println(`
  25. Usage: zerotier [-options] <command> [command args]
  26. Global Options:
  27. -j Output raw JSON where applicable
  28. -p <path> Use alternate base path
  29. -t <path> Use secret auth token from this file
  30. Commands:
  31. help Show this help
  32. version Print version
  33. service Start in system service mode
  34. status Show ZeroTier service status and config
  35. peers Show VL1 peers
  36. roots Show VL1 root servers
  37. addroot <locator> [name] Add a VL1 root
  38. removeroot <name> Remove a VL1 root
  39. locator <command> [args] Locator management commands
  40. new <identity> <address> [...] Create and sign a locator
  41. newdnskey Create a secure DNS name and secret
  42. getdns <key> <locator> Create secure DNS TXT records
  43. identity <command> [args] Identity management commands
  44. new Create new identity (including secret)
  45. getpublic <identity> Extract only public part of identity
  46. validate <identity> Locally validate an identity
  47. sign <identity> <file> Sign a file with an identity's key
  48. verify <identity> <file> <sig> Verify a signature
  49. networks Show joined VL2 virtual networks
  50. join <network ID> Join a virtual network
  51. leave <network ID> Leave a virtual network
  52. show <network ID> Show verbose network info
  53. set <network ID> <option> <value> Set a network local config option
  54. manageips <boolean> Is IP management allowed?
  55. manageroutes <boolean> Is route management allowed?
  56. globalips <boolean> Can IPs in global IP space be managed?
  57. globalroutes <boolean> Can global IP space routes be set?
  58. defaultroute <boolean> Can default route be overridden?
  59. set <local config option> <value> Set a local configuration option
  60. phy <IP/bits> blacklist <boolean> Set or clear blacklist for CIDR
  61. phy <IP/bits> trust <path ID/0> Set or clear trusted path ID for CIDR
  62. virt <address> try <IP/port> [...] Set explicit IPs for reaching a peer
  63. port <port> Set primary local port for VL1 P2P
  64. secondaryport <port/0> Set or disable secondary VL1 P2P port
  65. tertiaryport <port/0> Set or disable tertiary VL1 P2P port
  66. portsearch <boolean> Set or disable port search on startup
  67. portmapping <boolean> Set or disable use of uPnP and NAT-PMP
  68. explicitaddresses <IP/port> [...] Set explicit external IPs to advertise
  69. Most commands require a secret token to permit control of a running ZeroTier
  70. service. The CLI will automatically try to read this token from the
  71. authtoken.secret file in the service's working directory and then from a
  72. file called .zerotierauth in the user's home directory. The -t option can be
  73. used to explicitly specify a location.`)
  74. fmt.Println()
  75. }