Skip to content

Latest commit

 

History

History
165 lines (113 loc) · 6.47 KB

README_ENG.md

File metadata and controls

165 lines (113 loc) · 6.47 KB

README.md

Acknowledgement

key-networks/ztncui

Zerotier All in One

GitHub License Docker Automated build Current Release GitHub stars GitHub forks Docker Pulls Docker Image Size GitHub issues GitHub closed issues GitHub contributors

Quick Navigation:

Setup Standalone Panel Environment Variables File Server Setup Moon/Planet Server


docker run -d -p 9993:9993/udp -p 3443:3443 -p 3180:3180 \
    -v zerotier-one:/var/lib/zerotier-one \
    -v zerotier-webui:/www/zerotier-webui/etc \
    -v zerotier-logs:/logs \
    --env-file ./denv \
    --name zerotier-aio \
    imashen/zerotier-aio

Additionally, you can change the data volume to be mounted as a local directory, and the method of introducing environment variables can also be changed to use the -e option. For the contents of the --env-file environment variable file, please refer to the denv in the repository.

docker run -d -p 9993:9993/udp -p 3443:3443 -p 3180:3180 \
    -v /opt/zerotier/zerotier-one:/var/lib/zerotier-one \
    -v /opt/zerotier/zerotier-webui:/www/zerotier-webui/etc \
    -v /opt/zerotier/zerotier-logs:/logs \
    -e NODE_ENV=production \
    -e ZEROTIER-WEBUI_PASSWD=password123 \
    -e MYDOMAIN=site.test \
    --name zerotier-aio \
    imashen/zerotier-aio

Files Func

/var/lib/zerotier-one is used to store Zerotier's default runtime and configuration files.

files-zt1

/www/zerotier-webui/etc is the file server and contains the certificates for the Web UI.

files-webui

/logs stores the log files.

files-logs


Required Environment Variables

Name Description Default Value
NODE_ENV Refer to https://pugjs.org/api/express.html production
MYADDR Your IP address, preferably a public IP No default value

Optional Environment Variables

Name Description Default Value
HTTPS_HOST Listen only on HTTPS_HOST:HTTPS_PORT No default value
HTTPS_PORT HTTPS Port 3443
HTTP_PORT HTTP Port 3000
HTTP_ALL_INTERFACES Listen on all interfaces, applicable only to HTTP, suitable for reverse proxy No default value
MYDOMAIN Domain name for dynamically generated TLS certificates site.test(can also be the local IP)
ZEROTIER-WEBUI_PASSWD Password for the dynamically generated admin password123(Weak passwords are dynamically generated, as detailed in the logs)

Please note that for security, HTTPS_PORT listens on all network interfaces by default, while HTTP_PORT listens only on localhost/127.0.0.1.


This image opens an HTTP server on port 3180, allowing you to serve files stored in /myfs/. For example, you can use this to build your own root server and distribute planet files.


Moon/Planet Easy Deployment

You can enter the container using docker exec -it zerotier-aio /bin/bash.

exec_container

Run mkmoon or mkplanet to view help.


Enter the command mkmoon to get help information.

usage_mkmoon

Usage: mkmoon [options]
Options:
  -h, --help            Display this help message
  -4 <IPv4>             Set the IPv4 address for the moon
  -6 <IPv6>             Set the IPv6 address for the moon
  -p <port>             Set the port for the moon (default is 9993)

You must provide either an IPv4 or IPv6 address. Each parameter can be omitted. The default port is 9993.

The following is an example of a successful operation:

usage_mkmoon_out


Enter the command mkplanet to get help information.

usage_mkplanet

Usage: mkplanet [options]
Options:
  -h, --help          Display this help message
  -j2b, --json2bin      Convert from JSON file to planet
  -b2j, --bin2json      Convert from planet to JSON format
  -r, --reset              Reset planet from origin-planet.json

First, run mkplanet -b2j or mkplanet --bin2json to convert the official planet file to a JSON file for easy modification.

usage_mkplanet_b2j

Fill in your own Planet server information in the planet.json file following the specified structure. You can fill in up to four entries.

planet_json

After configuring, run mkplanet -j2b or mkplanet --json2bin to repackage the JSON file into a planet file.

usage_mkplanet_j2b

Distribute this planet file to your devices to set up your own Moon server. For easier distribution, see File Server.

Additionally, the mkplanet tool includes a one-click reset feature. If your configuration file is corrupted or you lose the official file,
you can use mkplanet -r or mkplanet --reset to regenerate the official planet file.

usage_mkplanet_reset