summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2016-02-25 10:08:30 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2016-02-25 10:08:30 -0800
commite5f82f545755f582fc576aa7c583689403d8fe8a (patch)
tree4995818efdfd188aa68dd0546391d547e72a2888 /examples
parenta5e4e3fcac21ed26743f343b43baf7a12199c576 (diff)
downloadinfinitytier-e5f82f545755f582fc576aa7c583689403d8fe8a.tar.gz
infinitytier-e5f82f545755f582fc576aa7c583689403d8fe8a.zip
cleanup
Diffstat (limited to 'examples')
-rw-r--r--examples/api/README.md26
-rw-r--r--examples/api/circuit-test-pingpong.json13
-rw-r--r--examples/api/public.json27
-rw-r--r--examples/docker/Dockerfile19
-rw-r--r--examples/docker/README.md8
-rw-r--r--examples/docker/main.sh25
-rwxr-xr-xexamples/docker/maketestenv.sh11
7 files changed, 0 insertions, 129 deletions
diff --git a/examples/api/README.md b/examples/api/README.md
deleted file mode 100644
index 50b1b65e..00000000
--- a/examples/api/README.md
+++ /dev/null
@@ -1,26 +0,0 @@
-API Examples
-======
-
-This folder contains examples that can be posted with curl or another http query utility to a local instance.
-
-To test querying with curl:
-
- curl -H 'X-ZT1-Auth:AUTHTOKEN' http://127.0.0.1:9993/status
-
-To create a public network on a local controller (service must be built with "make ZT\_ENABLE\_NETWORK\_CONTROLLER=1"):
-
- curl -H 'X-ZT1-Auth:AUTHTOKEN' -X POST -d @public.json http://127.0.0.1:9993/controller/network/################
-
-Replace AUTHTOKEN with the contents of this instance's authtoken.secret file and ################ with a valid network ID. Its first 10 hex digits must be the ZeroTier address of the controller itself, while the last 6 hex digits can be anything. Also be sure to change the port if you have this instance listening somewhere other than 9993.
-
-After POSTing you can double check the network config with:
-
- curl -H 'X-ZT1-Auth:AUTHTOKEN' http://127.0.0.1:9993/controller/network/################
-
-Once this network is created (and if your controller is online, etc.) you can then join this network from any device anywhere in the world and it will receive a valid network configuration.
-
----
-
-**public.json**: A valid configuration for a public network that allows IPv4 and IPv6 traffic.
-
-**circuit-test-pingpong.json**: An example circuit test that can be posted to /controller/network/################/test to order a test -- you will have to edit this to insert the hops you want since the two hard coded device IDs are from our own test instances.
diff --git a/examples/api/circuit-test-pingpong.json b/examples/api/circuit-test-pingpong.json
deleted file mode 100644
index 8fcc5d94..00000000
--- a/examples/api/circuit-test-pingpong.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "hops": [
- [ "4cbc810d4c" ],
- [ "868cd1664f" ],
- [ "4cbc810d4c" ],
- [ "868cd1664f" ],
- [ "4cbc810d4c" ],
- [ "868cd1664f" ],
- [ "4cbc810d4c" ],
- [ "868cd1664f" ]
- ],
- "reportAtEveryHop": true
-}
diff --git a/examples/api/public.json b/examples/api/public.json
deleted file mode 100644
index 4317bd3e..00000000
--- a/examples/api/public.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "public_test_network",
- "private": false,
- "enableBroadcast": true,
- "allowPassiveBridging": false,
- "v4AssignMode": "zt",
- "v6AssignMode": "rfc4193",
- "multicastLimit": 32,
- "relays": [],
- "gateways": [],
- "ipLocalRoutes": ["10.66.0.0/16"],
- "ipAssignmentPools": [{"ipRangeStart":"10.66.0.1","ipRangeEnd":"10.66.255.254"}],
- "rules": [
- {
- "ruleNo": 10,
- "etherType": 2048,
- "action": "accept"
- },{
- "ruleNo": 20,
- "etherType": 2054,
- "action": "accept"
- },{
- "ruleNo": 30,
- "etherType": 34525,
- "action": "accept"
- }]
-}
diff --git a/examples/docker/Dockerfile b/examples/docker/Dockerfile
deleted file mode 100644
index f1ce6bb5..00000000
--- a/examples/docker/Dockerfile
+++ /dev/null
@@ -1,19 +0,0 @@
-FROM centos:7
-
-MAINTAINER https://www.zerotier.com/
-
-RUN yum -y update && yum install -y sqlite net-tools && yum clean all
-
-EXPOSE 9993/udp
-
-RUN mkdir -p /var/lib/zerotier-one
-RUN mkdir -p /var/lib/zerotier-one/networks.d
-RUN ln -sf /var/lib/zerotier-one/zerotier-one /usr/local/bin/zerotier-cli
-RUN ln -sf /var/lib/zerotier-one/zerotier-one /usr/local/bin/zerotier-idtool
-
-ADD zerotier-one /var/lib/zerotier-one/
-
-ADD main.sh /
-RUN chmod a+x /main.sh
-
-CMD ["./main.sh"]
diff --git a/examples/docker/README.md b/examples/docker/README.md
deleted file mode 100644
index fbc93481..00000000
--- a/examples/docker/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-Simple Dockerfile Example
-======
-
-This is a simple Docker example using ZeroTier One in normal tun/tap mode. It uses a Dockerfile to build an image containing ZeroTier One and a main.sh that launches it with an identity supplied via the Docker environment via the ZEROTIER\_IDENTITY\_SECRET and ZEROTIER\_NETWORK variables. The Dockerfile assumes that the zerotier-one binary is in the build folder.
-
-This is not a very secure way to load an identity secret, but it's useful for testing since it allows you to repeatedly launch Docker containers with the same identity. For production we'd recommend using something like Hashicorp Vault, or modifying main.sh to leave identities unspecified and allow the container to generate a new identity at runtime. Then you could script approval of containers using the controller API, approving them as they launch, etc. (We are working on better ways of doing mass provisioning.)
-
-To use in normal tun/tap mode with Docker, containers must be run with the options "--device=/dev/net/tun --privileged". The main.sh script supplied here will complain and exit if these options are not present (no /dev/net/tun device).
diff --git a/examples/docker/main.sh b/examples/docker/main.sh
deleted file mode 100644
index 53fb6540..00000000
--- a/examples/docker/main.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin
-
-if [ ! -c "/dev/net/tun" ]; then
- echo 'FATAL: must be docker run with: --device=/dev/net/tun --cap-add=NET_ADMIN'
- exit 1
-fi
-
-if [ -z "$ZEROTIER_IDENTITY_SECRET" ]; then
- echo 'FATAL: ZEROTIER_IDENTITY_SECRET not set -- aborting!'
- exit 1
-fi
-
-if [ -z "$ZEROTIER_NETWORK" ]; then
- echo 'Warning: ZEROTIER_NETWORK not set, you will need to docker exec zerotier-cli to join a network.'
-else
- # The existence of a .conf will cause the service to "remember" this network
- touch /var/lib/zerotier-one/networks.d/$ZEROTIER_NETWORK.conf
-fi
-
-rm -f /var/lib/zerotier-one/identity.*
-echo "$ZEROTIER_IDENTITY_SECRET" >/var/lib/zerotier-one/identity.secret
-
-/var/lib/zerotier-one/zerotier-one
diff --git a/examples/docker/maketestenv.sh b/examples/docker/maketestenv.sh
deleted file mode 100755
index 275692e1..00000000
--- a/examples/docker/maketestenv.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-if [ -z "$1" -o -z "$2" ]; then
- echo 'Usage: maketestenv.sh <output file e.g. test-01.env> <network ID>'
- exit 1
-fi
-
-newid=`../../zerotier-idtool generate`
-
-echo "ZEROTIER_IDENTITY_SECRET=$newid" >$1
-echo "ZEROTIER_NETWORK=$2" >>$1