Dockernized ZeroTierOne controller with zero-ui web interface.

Overview

docker-zerotier-controller

Dockernized ZeroTierOne controller with zero-ui web interface. 中文讨论

Customize ZeroTierOne's controller planets

Modify patch/planets.json as you needed, then build the docker image. I've put the patch/planet.public and patch/planet.private files in this repo.

{
  "planets": [
    {
      "Location": "Beijing", // Where this planet located
      "Identity": "a4de2130c2:0:ab5257bb05cd2fb8044fe26483f6d27b57124ca7b350fb3e0f07d405c68c4416094dbc836bf62ed483072501aa3384dff3c74ac50050c1bfbb1dc657001ef6a1", // The planet's public key, ex: identity.public
      "Endpoints": ["127.0.0.1/9993"] // The list of endpoints in 'ip/port' format. IPv6 is supportted
    }
  ]
}

Build

docker build --force-rm . -t sbilly/zerotier-controller:latest

Run

Controller

# Run with default settings
docker run --rm -ti -p 4000:4000 -p 9993:9993 -p 9993:9993/udp sbilly/zerotier-controller:latest

# Run with custom envirments settings
docker run --rm -ti -e ZU_SECURE_HEADERS=false -e ZU_CONTROLLER_ENDPOINT=http://127.0.0.1:9993/ -e ZU_DEFAULT_USERNAME=admin -e ZU_DEFAULT_PASSWORD=zero-ui -p 4000:4000 -p 3000:3000 -p 9993:9993 -p 9993:9993/udp sbilly/zerotier-controller:latest

# Run with docker volumes
docker run --rm -ti -v `pwd`/config/identity.public:/app/config/identity.public -v `pwd`/config/identity.secret:/app/config/identity.secret -v `pwd`/config/authtoken.secret:/app/config/authtoken.secret -p 3000:3000 -p 4000:4000 -p 9993:9993 -p 9993:9993/udp sbilly/zerotier-controller:latest

Peer

Download planet from controller WEB interface to peer configuration directory. For example, /var/lib/zerotier-one/planet, Then start zerotier-one.

# Download planet
wget http://[IP_OF_CONTROLLER]:[PORT_OF_CONTROLLER]/app/static/planet -O /var/lib/zerotier-one/planet

# Start ZeroTierOne
zerotier-one /var/lib/zerotier-one

Environment Variables

  • The default username/password (admin/zero-ui) is defined by ZU_DEFAULT_USERNAME and ZU_DEFAULT_PASSWORD.
  • The environment variable ZT_PRIMARY_PORT is ZeroTierOne's primaryPort in local.conf.
  • Please check zero-ui for other environment variables.

Files in Docker Image

/app/
├── config/
├── backend/
├── frontend/
└── ZeroTierOne/
  • config: The configurations of ZeroTierOne, such as identity.*, authtoken.secret, etc.
  • backend: zero-ui backend.
  • frontend: The static files of zero-ui frontend.
  • ZeroTierOne: The binaries of ZeroTierOne, such as zerotier-*, mkworld.

Change Log

  • 20210904 - Update peer's instructions.
  • 20210902 - First Release.
Comments
  • Peer端无法连上Planet服务器

    Peer端无法连上Planet服务器

    端口均开启,但是peer端join网络没反应,显示200 join但是网页上看不到。 同时zerotier-cli peers显示 200 peers <ztaddr> <ver> <role> <lat> <link> <lastTX> <lastRX> <path> a4de2130c2 - PLANET -1 RELAY

    opened by gundami 7
  • 构建脚本失败 麻烦作者看看

    构建脚本失败 麻烦作者看看

    构建脚本问题 添加了aliyun repo文件 添加了 xmlto软件宝 我改成如下还是报错 postgre 头文件错误 FROM node:current-alpine as build-stage LABEL Author="sbilly [email protected]" LABEL Maintainer="sbilly [email protected]"

    ENV NODE_OPTIONS=--openssl-legacy-provider ENV YARN_VERSION=2.4.0

    RUN echo "http://mirrors.aliyun.com/alpine/latest-stable/community" > /etc/apk/repositories RUN echo "http://mirrors.aliyun.com/alpine/latest-stable/main" >> /etc/apk/repositories RUN apk update &&
    apk add python3 alpine-sdk gcc wget git linux-headers libpq postgresql-dev xmlto bash jq

    WORKDIR /src

    Prepaire Environment

    COPY ./patch /src/patch COPY ./config /src/config

    Downloading and build latest libpqxx

    RUN LIBPQXX_VERSION=curl --silent "https://api.github.com/repos/jtv/libpqxx/releases" | jq -r ".[0].tag_name" &&
    curl https://codeload.github.com/jtv/libpqxx/tar.gz/refs/tags/${LIBPQXX_VERSION} --output /tmp/libpqxx.tar.gz &&
    mkdir -p /src &&
    cd /src &&
    tar fxz /tmp/libpqxx.tar.gz &&
    mv /src/libpqxx-* /src/libpqxx &&
    rm -rf /tmp/libpqxx.tar.gz &&
    cd /src/libpqxx &&
    /src/libpqxx/configure &&
    make &&
    make install

    Downloading and build latest version ZeroTierOne

    RUN ZEROTIER_ONE_VERSION=curl --silent "https://api.github.com/repos/zerotier/ZeroTierOne/releases" | jq -r ".[0].tag_name" &&
    curl https://codeload.github.com/zerotier/ZeroTierOne/tar.gz/refs/tags/${ZEROTIER_ONE_VERSION} --output /tmp/ZeroTierOne.tar.gz &&
    mkdir -p /src &&
    cd /src &&
    tar fxz /tmp/ZeroTierOne.tar.gz &&
    mv /src/ZeroTierOne-* /src/ZeroTierOne &&
    rm -rf /tmp/ZeroTierOne.tar.gz &&
    python3 /src/patch/patch.py &&
    cd /src/ZeroTierOne &&
    make central-controller CPPFLAGS+=-w &&
    cd /src/ZeroTierOne/attic/world &&
    bash build.sh

    Downloading and build latest tagged zero-ui

    RUN ZERO_UI_VERSION=curl --silent "https://api.github.com/repos/dec0dOS/zero-ui/tags" | jq -r '.[0].name' &&
    curl https://codeload.github.com/dec0dOS/zero-ui/tar.gz/refs/tags/${ZERO_UI_VERSION} --output /tmp/zero-ui.tar.gz &&
    mkdir -p /src/ &&
    cd /src &&
    tar fxz /tmp/zero-ui.tar.gz &&
    mv /src/zero-ui-* /src/zero-ui &&
    rm -rf /tmp/zero-ui.tar.gz &&
    cd /src/zero-ui &&
    yarn set version ${YARN_VERSION} &&
    yarn install &&
    yarn installDeps &&
    yarn build

    FROM node:current-alpine

    WORKDIR /app/ZeroTierOne

    libpqxx

    COPY --from=build-stage /usr/local/lib/libpqxx.la /usr/local/lib/libpqxx.la COPY --from=build-stage /usr/local/lib/libpqxx.a /usr/local/lib/libpqxx.a

    ZeroTierOne

    COPY --from=build-stage /src/ZeroTierOne/zerotier-one /app/ZeroTierOne/zerotier-one RUN cd /app/ZeroTierOne &&
    ln -s zerotier-one zerotier-cli &&
    ln -s zerotier-one zerotier-idtool

    mkworld @ ZeroTierOne

    COPY --from=build-stage /src/ZeroTierOne/attic/world/mkworld /app/ZeroTierOne/mkworld COPY --from=build-stage /src/ZeroTierOne/attic/world/world.bin /app/config/world.bin COPY --from=build-stage /src/config/world.c /app/config/world.c

    Envirment

    RUN apk update &&
    apk add libpq postgresql-dev postgresql jq curl bash wget &&
    mkdir -p /var/lib/zerotier-one/ &&
    ln -s /app/config/authtoken.secret /var/lib/zerotier-one/authtoken.secret

    Installing s6-overlay

    RUN S6_OVERLAY_VERSION=curl --silent "https://api.github.com/repos/just-containers/s6-overlay/releases/latest" | jq -r .tag_name &&
    wget https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-amd64.tar.gz -O /tmp/s6-overlay-amd64.tar.gz &&
    gunzip -c /tmp/s6-overlay-amd64.tar.gz | tar -xf - -C / &&
    rm -rf /tmp/s6-overlay-amd64.tar.gz

    Frontend @ zero-ui

    COPY --from=build-stage /src/zero-ui/frontend/build /app/frontend/build/

    Backend @ zero-ui

    WORKDIR /app/backend COPY --from=build-stage /src/zero-ui/backend/package*.json /app/backend COPY --from=build-stage /src/zero-ui/backend/yarn.lock /app/backend RUN yarn set version ${YARN_VERSION} &&
    yarn install &&
    ln -s /app/config/world.bin /app/frontend/build/static/planet COPY --from=build-stage /src/zero-ui/backend /app/backend

    s6-overlay

    COPY ./s6-files/etc /etc/

    schema

    COPY ./schema /app/schema/

    EXPOSE 3000 4000 9993 9993/UDP ENV S6_KEEP_ENV=1

    ENTRYPOINT ["/init"] CMD []

    opened by chenxudong2020 2
  • http://server:4000/app/static/planet 404 , but file exist.

    http://server:4000/app/static/planet 404 , but file exist.

    use https://hub.docker.com/r/sbilly/zerotier-controller

    open http://server:4000/app/static/planet : {"error":"404 Not found"}  
    
    [root@5d2e4707698b backend]# ls /app/frontend/build/static
    css  js  media  planet
    
    opened by kkkgo 0
  • centos 8 报错

    centos 8 报错

    大佬能不能搞个一键脚本?我用甲骨文的amd X6服务器(centos 8),运行:docker build --force-rm . -t sbilly/zerotier-controller:latest,就报错: unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /root/Dockerfile: no such file or directory

    opened by itv3 0
  • 无法加入自建的Planet服务器

    无法加入自建的Planet服务器

    无论是用openwrt,手机端的zerotier-fix还是电脑的客户端,都无法加入自建的服务器。 planet文件已经替换,openwrt替换位置为 /etc/config/zero,手机端直接导入,windows电脑是C:\ProgramData\ZeroTier\One。 日志如下 root@OPENWRT 00:49 ~# zerotier-cli status -j { "address": "fc1aae366a", "clock": 1644511794525, "config": { "physical": null, "settings": { "allowTcpFallbackRelay": true, "portMappingEnabled": true, "primaryPort": 9993, "softwareUpdate": "disable", "softwareUpdateChannel": "release" } }, "online": false, "planetWorldId": 149604618, "planetWorldTimestamp": 1639375815023, "publicIdentity": "fc1aae366a:0:0782c85dc7256ba78aa5f13b98906791e412b035e095f29a937f4e5c67e1a43843e5d0824268fe5ed5f6bb96ac1910086411c747764748dff9eeb09afc3b844d", "tcpFallbackActive": false, "version": "1.6.6", "versionBuild": 0, "versionMajor": 1, "versionMinor": 6, "versionRev": 6 } root@OPENWRT 00:49 ~# zerotier-cli listpeers -j [ { "address": "a4de2130c2", "isBonded": false, "latency": -1, "paths": [], "role": "PLANET", "version": "-1.-1.-1", "versionMajor": -1, "versionMinor": -1, "versionRev": -1 } ]

    opened by zkh1992 3
  • Dockerfile say, Zerotier 1.6.6, whereas current is 1.8.4

    Dockerfile say, Zerotier 1.6.6, whereas current is 1.8.4

    Hello Current version of ZeroTier is 1.8.4 Are you continuing to support this?

    OK: Just seen your latest commit, where you identify 1.8.4 breaks controller. I guess there are other things too as I had to add libpq-dev, but still the controller build fails

    Yes: Just looked at PostgreSQL.cpp, and they are very different. Alas, I'm not conversant with C++

    opened by jradxl 5
Controller state monitor plugin for EVA ICS

eva-plugin-cmon Controller status monitor plugin for EVA ICS Monitors connected controllers status in SFA and pushes measurements into an external Inf

Altertech 1 Nov 6, 2021
A turtlebot auto controller allows robot to autonomously explore environment.

A turtlebot auto controller allows robot to autonomously explore environment.

Yuliang Zhong 1 Nov 10, 2021
My HA controller for veg and flower rooms

HAGrowRoom My HA controller for veg and flower rooms I will do my best to keep this updated as I change, add and improve. System heavily uses custom t

null 4 May 25, 2022
Python PID Controller and Process Simulator (FOPDT) with GUI.

PythonPID_Simulator Python PID Controller and Process Simulator (FOPDT) with GUI. Run the File. Then select Model Values and Tune PID.. Hit Refresh to

null 19 Oct 14, 2022
An app that mirrors your phone to your compute and maps controller input to the screen

What is 'Dragalia Control'? An app that mirrors your phone to your compute and maps controller input to the screen. Inputs are mapped specifically for

null 1 May 3, 2022
Comics/doujinshi reader application. Web-based, will work on desktop and tablet devices with swipe interface.

Yomiko Comics/doujinshi reader application. Web-based, will work on desktop and tablet devices with swipe interface. Scans one or more directories of

Kyubi Systems 26 Aug 10, 2022
This is a simple web interface for SimplyTranslate

SimplyTranslate Web This is a simple web interface for SimplyTranslate List of Instances You can find a list of instances here: SimplyTranslate Projec

null 4 Dec 14, 2022
A web interface for a soft serve Git server.

Soft Serve monitor Soft Sevre is a very nice git server. It offers a really nice TUI to browse the repositories on the server. Unfortunately, it does

Maxime Bouillot 5 Apr 26, 2022
Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero.

Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero. Print the decimal value of each fraction on a new line with places after the decimal.

Shruti Dhave 2 Nov 29, 2021
A collection of common regular expressions bundled with an easy to use interface.

CommonRegex Find all times, dates, links, phone numbers, emails, ip addresses, prices, hex colors, and credit card numbers in a string. We did the har

Madison May 1.5k Dec 31, 2022
Python3 Interface to numa Linux library

py-libnuma is python3 interface to numa Linux library so that you can set task affinity and memory affinity in python level for your process which can help you to improve your code's performence.

Dalong 13 Nov 10, 2022
poro is a LCU interface to change some lol's options.

poro is a LCU interface to change some lol's options. with this program you can: change your profile icon change your profiel background image ch

João Dematte 2 Jan 5, 2022
python DroneCAN code generation, interface and utilities

UAVCAN v0 stack in Python Python implementation of the UAVCAN v0 protocol stack. UAVCAN is a lightweight protocol designed for reliable communication

DroneCAN 11 Dec 12, 2022
Project Interface For nextcord-ext

Project Interface For nextcord-ext

nextcord-ext 1 Nov 13, 2021
This is a far more in-depth and advanced version of "Write user interface to a file API Sample"

Fusion360-Write-UserInterface This is a far more in-depth and advanced version of "Write user interface to a file API Sample" from https://help.autode

null 4 Mar 18, 2022
Um sistema de llogin feito em uma interface grafica.

Interface-para-login Um sistema de login feito com JSON. Utilizando a biblioteca Tkinter, eu criei um sistema de login, onde guarda a informações de l

Mobben 1 Nov 28, 2021
Custom python interface to xstan (a modified (cmd)stan)

Custom python interface to xstan (a modified (cmd)stan) Use at your own risk, currently everything is very brittle and will probably be changed in the

null 2 Dec 16, 2021
apysc is the Python frontend library to create html and js file, that has ActionScript 3 (as3)-like interface.

apysc apysc is the Python frontend library to create HTML and js files, that has ActionScript 3 (as3)-like interface. Notes: Currently developing and

simonritchie 17 Dec 14, 2022
A(Sync) Interface for internal Audible API written in pure Python.

Audible Audible is a Python low-level interface to communicate with the non-publicly Audible API. It enables Python developers to create there own Aud

mkb79 192 Jan 3, 2023