mirror of
https://github.com/gvsurenderreddy/zero
synced 2025-09-26 17:31:16 +08:00
wrote readme
This commit is contained in:
17
.editorconfig
Normal file
17
.editorconfig
Normal file
@@ -0,0 +1,17 @@
|
||||
root = true
|
||||
|
||||
[*.{go}]
|
||||
indent_style = tabs
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[{Makefile}]
|
||||
indent_style = tabs
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
16
Dockerfile
Normal file
16
Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
||||
FROM ubuntu:14.04
|
||||
MAINTAINER Microfactory <info@microfactory.io>
|
||||
RUN apt-get update; apt-get install -y curl unzip;
|
||||
|
||||
# install golang runtime
|
||||
RUN curl -L https://storage.googleapis.com/golang/go1.5.2.linux-amd64.tar.gz > /tmp/golang.tar.gz; tar -C /usr/local -xzf /tmp/golang.tar.gz; rm /tmp/golang.tar.gz
|
||||
|
||||
#zerotier
|
||||
RUN curl -L https://download.zerotier.com/dist/zerotier-one_1.1.2_amd64.deb > /tmp/ztier.deb; dpkg -i /tmp/ztier.deb; rm /tmp/ztier.deb
|
||||
|
||||
# #setup go env
|
||||
ENV GOPATH=/ GO15VENDOREXPERIMENT=1 PATH=$PATH:/usr/local/go/bin
|
||||
ADD . /src/github.com/microfactory/zero
|
||||
WORKDIR /src/github.com/microfactory/zero
|
||||
RUN go build -ldflags="-X main.Version=`cat VERSION`" -o /usr/local/bin/zero main.go
|
||||
ENTRYPOINT ["zero"]
|
16
README.md
16
README.md
@@ -1,2 +1,14 @@
|
||||
# zero-up
|
||||
A single-binary utility for launching a machine into a ZeroTier network unattended
|
||||
# zero
|
||||
[ZeroTier](https://www.zerotier.com/) is an awesome zero-configuration vpn that runs almost anywhere. But the default CLI doesn't make particulary easy to join a network unattended. Manual intervention can be combersome in a cluster environment were machine are added and removed dynamically.
|
||||
|
||||
*Zero* presents the simple function of joining a Zerotier network without manual intervention. It does this by using the ZeroTier API:
|
||||
|
||||
```
|
||||
usage: zero zt_net zt_token
|
||||
```
|
||||
|
||||
The `zt_net` (network ID) and `zt_token` (API access token) can both be retrieved from the ZeroTier web interface. A typical example looks like this:
|
||||
|
||||
```
|
||||
zero e6df831e1c561fff ZkJelfeQ1dd2ffff
|
||||
```
|
||||
|
14
main.go
Normal file
14
main.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
log.SetPrefix("zero: ")
|
||||
log.SetFlags(0)
|
||||
|
||||
log.Printf("Hello World!")
|
||||
}
|
25
make.sh
Executable file
25
make.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#! /bin/bash
|
||||
set -e
|
||||
|
||||
function print_help {
|
||||
printf "Available Commands:\n";
|
||||
printf " run\n"
|
||||
}
|
||||
|
||||
function run_build_container {
|
||||
docker build -t microfactory/zero:`cat VERSION` .
|
||||
}
|
||||
|
||||
# run a Linux test environment
|
||||
function run_run {
|
||||
run_build_container
|
||||
docker run -it --rm \
|
||||
--device=/dev/net/tun \
|
||||
--cap-add=NET_ADMIN \
|
||||
microfactory/zero:`cat VERSION`
|
||||
}
|
||||
|
||||
case $1 in
|
||||
"run") run_run ;;
|
||||
*) print_help ;;
|
||||
esac
|
Reference in New Issue
Block a user