diff --git a/.gitignore b/.gitignore
index 3b018c424..9c87a061e 100755
--- a/.gitignore
+++ b/.gitignore
@@ -79,3 +79,5 @@ java/build_win32/
windows/WinUI/obj/
windows/WinUI/bin/
windows/ZeroTierOne/Debug/
+/doc/*.1
+/doc/*.8
diff --git a/AUTHORS.md b/AUTHORS.md
index 23a7a10bf..6b21f572e 100644
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -9,7 +9,7 @@
* Network Containers for Linux, iOS, Android
Joseph Henry / joseph.henry@zerotier.com
-## Contributors
+## Third Party Contributors
* A number of fixes and improvements to the new controller, other stuff.
Kees Bos / https://github.com/keesbos/
@@ -17,6 +17,9 @@
* Debugging and testing, OpenWRT support fixes.
Moritz Warning / moritzwarning@web.de
+ * Debian GNU/Linux packaging, manual pages, and license compliance edits.
+ Ben Finney
+
* Several others made smaller contributions, which GitHub tracks here:
https://github.com/zerotier/ZeroTierOne/graphs/contributors/
@@ -28,7 +31,7 @@
* Home page: http://code.google.com/p/lz4/
* License grant: BSD attribution
- * http-parser by Joyent (many authors)
+ * http-parser by Joyent, Inc. (many authors)
* Files: ext/http-parser/*
* Home page: https://github.com/joyent/http-parser/
diff --git a/doc/manpage_encoding_declaration.UTF-8 b/doc/manpage_encoding_declaration.UTF-8
new file mode 100644
index 000000000..991db0a6a
--- /dev/null
+++ b/doc/manpage_encoding_declaration.UTF-8
@@ -0,0 +1 @@
+'\" -*- coding: utf-8 -*-
diff --git a/doc/module.mk b/doc/module.mk
new file mode 100644
index 000000000..34fdbaebf
--- /dev/null
+++ b/doc/module.mk
@@ -0,0 +1,52 @@
+# doc/module.mk
+# Part of ZeroTier One, a software-defined network layer.
+#
+# Copyright © 2016 Ben Finney
+# This is free software: you may copy, modify, and/or distribute this
+# work under the terms of the GNU General Public License, version 3 or
+# later as published by the Free Software Foundation.
+# No warranty expressed or implied.
+# See the file ‘LICENSE.txt’ for details.
+
+# Makefile module for ZeroTier One documentation.
+
+TEMPFILE_SUFFIX = .tmp
+.INTERMEDIATE: ${DOCUMENTATION_DIR}/*${TEMPFILE_SUFFIX}
+
+RST_SUFFIX = .txt
+manpage_sections = 1 2 3 4 5 6 7 8
+manpage_names += zerotier-one.8
+manpage_names += zerotier-idtool.1
+manpage_names += zerotier-cli.1
+manpage_source_paths = $(addprefix ${DOC_DIR}/, \
+ $(addsuffix ${RST_SUFFIX},${manpage_names}))
+manpage_paths = $(addprefix ${DOC_DIR}/,${manpage_names})
+manpage_encoding_stub = ${DOC_DIR}/manpage_encoding_declaration.UTF-8
+
+GENERATED_FILES += $(addprefix ${DOC_DIR}/,\
+ $(foreach section,${manpage_sections},*.${section}))
+
+RST2MAN = rst2man
+RST2MAN_OPTS =
+
+
+.PHONY: doc
+doc: manpages
+
+.PHONY: manpages
+manpages: ${manpage_paths}
+
+%.1: %.1${RST_SUFFIX}
+ $(RST2MAN) "$<" > "$@"${TEMPFILE_SUFFIX}
+ cat ${manpage_encoding_stub} "$@"${TEMPFILE_SUFFIX} > "$@"
+
+%.8: %.8${RST_SUFFIX}
+ $(RST2MAN) "$<" > "$@"${TEMPFILE_SUFFIX}
+ cat ${manpage_encoding_stub} "$@"${TEMPFILE_SUFFIX} > "$@"
+
+
+# Local variables:
+# coding: utf-8
+# mode: makefile
+# End:
+# vim: fileencoding=utf-8 filetype=make :
diff --git a/doc/zerotier-cli.1.txt b/doc/zerotier-cli.1.txt
new file mode 100644
index 000000000..ae8a4af77
--- /dev/null
+++ b/doc/zerotier-cli.1.txt
@@ -0,0 +1,109 @@
+============
+zerotier-cli
+============
+
+--------------------------------------------------
+management interface for ZeroTier One peer process
+--------------------------------------------------
+
+:Author: |author|
+:Date: 2016-03-04
+:Copyright:
+ Copyright © 2016 ZeroTier Inc.
+:Manual section: 1
+:Manual group: ZeroTier
+
+.. |command| replace:: **zerotier-cli**
+.. |license| replace::
+ `GNU General Public License, version 3 or later
+ `__
+
+
+SYNOPSIS
+========
+
+| |command| [ **-j** ] [ **-D** `HOMEDIR` ] [ **-p** `PORT` ] [ **-t** `AUTH_TOKEN` ] \
+ `command` [ `COMMAND_ARG` ]
+
+
+DESCRIPTION
+===========
+
+|command| is a tool to manage the running **zerotier-one**\ (8)
+process.
+
+*ZeroTier* is a peer-to-peer virtual network. Its “virtual layer 1”
+(VL1) is implemented in the communication between ZeroTier One peers.
+This provides the OSI layer 1 functionality on which to build further
+network services.
+
+
+COMMANDS
+========
+
+|command| **info**
+
+ *FIXME*: display status info
+
+|command| **listpeers**
+
+ *FIXME*: list all peers
+
+|command| **listnetworks**
+
+ *FIXME*: list all networks
+
+|command| **join** `NETWORK`
+
+ *FIXME*: join the network `NETWORK`
+
+|command| **leave** `NETWORK`
+
+ *FIXME*: leave the network `NETWORK`
+
+
+FILES
+=====
+
+The |command| process will discover the running **zerotier-one**\ (8)
+process by examining the specified `HOMEDIR` directory (default:
+``/var/lib/zerotier-one``).
+
+
+SEE ALSO
+========
+
+* **zerotier-one**\ (8)
+
+* ZeroTier One documentation:
+
+ * Product page ``__.
+ * Configuration guide ``__.
+ * Technical FAQ ``__.
+
+
+HISTORY
+=======
+
+The |command| program is developed by ZeroTier Inc.
+
+This manual page was written by |author|. This is free software: you
+may copy, modify and/or distribute this work under the terms of the
+|license| as published by the Free Software Foundation. No warranty
+expressed or implied.
+
+.. |author| replace:: |authorname| |authoremail|
+.. |authorname| replace:: Ben Finney
+.. |authoremail| replace::
+
+
+..
+ Local variables:
+ mode: rst
+ coding: utf-8
+ time-stamp-format: "%:y-%02m-%02d"
+ time-stamp-start: "^:Date:[ ]+"
+ time-stamp-end: "$"
+ time-stamp-line-limit: 20
+ End:
+ vim: filetype=rst fileencoding=utf-8 :
diff --git a/doc/zerotier-idtool.1.txt b/doc/zerotier-idtool.1.txt
new file mode 100644
index 000000000..2ff0e4c1c
--- /dev/null
+++ b/doc/zerotier-idtool.1.txt
@@ -0,0 +1,115 @@
+===============
+zerotier-idtool
+===============
+
+----------------------------------------------
+identity management tool for ZeroTier One peer
+----------------------------------------------
+
+:Author: |author|
+:Date: 2016-03-04
+:Copyright:
+ Copyright © 2016 ZeroTier Inc.
+:Manual section: 1
+:Manual group: ZeroTier
+
+.. |command| replace:: **zerotier-idtool**
+.. |license| replace::
+ `GNU General Public License, version 3 or later
+ `__
+
+
+SYNOPSIS
+========
+
+| |command| **generate** [ `SECRET` ] [ `PUBLIC` ]
+| |command| **validate** `SECRET`
+| |command| **getpublic** `SECRET`
+| |command| **sign** `SECRET`
+| |command| **verify** `IDENTITY` `FILE` `SIGNATURE`
+| |command| **mkcom** `SECRET` `ID`\ **,**\ `VALUE`\ **,**\ `MAX_DELTA` [ ... ] `IDENTITY`
+
+
+DESCRIPTION
+===========
+
+|command| is a tool to manage identities for the **zerotier-one**\ (8)
+program.
+
+*ZeroTier* is a peer-to-peer virtual network. Its “virtual layer 1”
+(VL1) is implemented in the communication between ZeroTier One peers.
+This provides the OSI layer 1 functionality on which to build further
+network services.
+
+
+COMMANDS
+========
+
+|command| **generate** [ `SECRET` ] [ `PUBLIC` ]
+
+ *FIXME*: generate an identity
+
+|command| **validate** `SECRET`
+
+ *FIXME*: validate a secret identity
+
+|command| **getpublic** `SECRET`
+
+ *FIXME*: get a public identity
+
+|command| **sign** `SECRET`
+
+ *FIXME*: sign a secret identity
+
+|command| **verify** `IDENTITY` `FILE` `SIGNATURE`
+
+ *FIXME*: verify a signature
+
+|command| **mkcom** `SECRET` `ID`\ **,**\ `VALUE`\ **,**\ `MAX_DELTA` [ ... ] `IDENTITY`
+
+ *FIXME*: mkcom
+
+
+FILES
+=====
+
+*FIXME*: how does the process know its home directory?
+
+
+SEE ALSO
+========
+
+* **zerotier-one**\ (8)
+
+* ZeroTier One documentation:
+
+ * Product page ``__.
+ * Configuration guide ``__.
+ * Technical FAQ ``__.
+
+
+HISTORY
+=======
+
+The |command| program is developed by ZeroTier Inc.
+
+This manual page was written by |author|. This is free software: you
+may copy, modify and/or distribute this work under the terms of the
+|license| as published by the Free Software Foundation. No warranty
+expressed or implied.
+
+.. |author| replace:: |authorname| |authoremail|
+.. |authorname| replace:: Ben Finney
+.. |authoremail| replace::
+
+
+..
+ Local variables:
+ mode: rst
+ coding: utf-8
+ time-stamp-format: "%:y-%02m-%02d"
+ time-stamp-start: "^:Date:[ ]+"
+ time-stamp-end: "$"
+ time-stamp-line-limit: 20
+ End:
+ vim: filetype=rst fileencoding=utf-8 :
diff --git a/doc/zerotier-one.8.txt b/doc/zerotier-one.8.txt
new file mode 100644
index 000000000..e730130e3
--- /dev/null
+++ b/doc/zerotier-one.8.txt
@@ -0,0 +1,119 @@
+============
+zerotier-one
+============
+
+-------------------------------------------------
+end-point peer for ZeroTier virtual network layer
+-------------------------------------------------
+
+:Author: |author|
+:Date: 2016-03-04
+:Copyright:
+ Copyright © 2016 ZeroTier Inc.
+:Manual section: 8
+:Manual group: ZeroTier
+
+.. |command| replace:: **zerotier-one**
+.. |license| replace::
+ `GNU General Public License, version 3 or later
+ `__
+
+
+SYNOPSIS
+========
+
+| |command| [ **-U** ] [ **-p** `PORT` ] [ **-d** ] [ `HOMEDIR` ]
+| |command| **-i** [ `IDTOOL_ARG` ... ]
+| |command| **-q** [ `QUERY_ARG` ... ]
+| |command| **-h**
+| |command| **-v**
+
+
+DESCRIPTION
+===========
+
+**ZeroTier One** is the end-point peer for the ZeroTier
+software-defined network layer.
+
+*ZeroTier* is a peer-to-peer virtual network. Its “virtual layer 1”
+(VL1) is implemented in the communication between ZeroTier One peers.
+This provides the OSI layer 1 functionality on which to build further
+network services.
+
+
+OPTIONS
+=======
+
+**-h**
+ Display concise help on command usage.
+
+**-v**
+ Display program version.
+
+**-U**
+ Run as unprivileged user (skip privilege check).
+
+**-p** `PORT`
+ Communicate on network port `PORT` (either TCP or UDP).
+
+**-d**
+ Become a conventional daemon process. Only available on Unix-like
+ operating systems.
+
+**-i** [ `IDTOOL_ARG` ... ]
+ Generate and manage identities.
+
+ This is equivalent to running the **zerotier-idtool** command with
+ all the specified `IDTOOL_ARG` parameters.
+
+**-q** [ `QUERY_ARG` ... ]
+ Query the running ZeroTier One process.
+
+ This is equivalent to running the **zerotier-cli** command with
+ all the specified `QUERY_ARG` parameters.
+
+
+FILES
+=====
+
+The |command| process will store its state in files within the
+specified `HOMEDIR` directory (default: ``/var/lib/zerotier-one``).
+
+
+SEE ALSO
+========
+
+* **zerotier-idtool**\ (1), **zerotier-cli**\ (1)
+
+* ZeroTier One documentation:
+
+ * Product page ``__.
+ * Configuration guide ``__.
+ * Technical FAQ ``__.
+
+
+HISTORY
+=======
+
+The |command| program is developed by ZeroTier Inc.
+
+This manual page was written by |author|. This is free software: you
+may copy, modify and/or distribute this work under the terms of the
+|license| as published by the Free Software Foundation. No warranty
+expressed or implied.
+
+.. |author| replace:: |authorname| |authoremail|
+.. |authorname| replace:: Ben Finney
+.. |authoremail| replace::
+
+
+..
+ Local variables:
+ mode: rst
+ coding: utf-8
+ time-stamp-format: "%:y-%02m-%02d"
+ time-stamp-start: "^:Date:[ ]+"
+ time-stamp-end: "$"
+ time-stamp-line-limit: 20
+ End:
+ vim: filetype=rst fileencoding=utf-8 :
diff --git a/make-linux.mk b/make-linux.mk
index b20cfdfd2..0b59b5b0f 100644
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -17,6 +17,9 @@
# clean: removes all built files, objects, other trash
#
+GENERATED_FILES :=
+DOC_DIR = doc
+
# Automagically pick clang or gcc, with preference for clang
# This is only done if we have not overridden these with an environment or CLI variable
ifeq ($(origin CC),default)
@@ -87,7 +90,7 @@ endif
#LDFLAGS=
#STRIP=echo
-all: one
+all: one doc
one: $(OBJS) service/OneService.o one.o osdep/LinuxEthernetTap.o
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o zerotier-one $(OBJS) service/OneService.o one.o osdep/LinuxEthernetTap.o $(LDLIBS)
@@ -115,8 +118,7 @@ installer: one FORCE
./ext/installfiles/linux/buildinstaller.sh
clean: FORCE
- rm -rf *.so *.o netcon/*.a node/*.o controller/*.o osdep/*.o service/*.o ext/http-parser/*.o ext/lz4/*.o ext/json-parser/*.o ext/miniupnpc/*.o ext/libnatpmp/*.o $(OBJS) zerotier-one zerotier-idtool zerotier-cli zerotier-selftest zerotier-netcon-service build-* ZeroTierOneInstaller-* *.deb *.rpm .depend netcon/.depend
- # Remove files from all the funny places we put them for tests
+ rm -rf ${GENERATED_FILES} *.so *.o netcon/*.a node/*.o controller/*.o osdep/*.o service/*.o ext/http-parser/*.o ext/lz4/*.o ext/json-parser/*.o ext/miniupnpc/*.o ext/libnatpmp/*.o $(OBJS) zerotier-one zerotier-idtool zerotier-cli zerotier-selftest zerotier-netcon-service build-* ZeroTierOneInstaller-* *.deb *.rpm .depend netcon/.depend
find netcon -type f \( -name '*.o' -o -name '*.so' -o -name '*.1.0' -o -name 'zerotier-one' -o -name 'zerotier-cli' -o -name 'zerotier-netcon-service' \) -delete
find netcon/docker-test -name "zerotier-intercept" -type f -delete
@@ -129,4 +131,6 @@ official: FORCE
make -j 4 ZT_OFFICIAL_RELEASE=1 one
make ZT_OFFICIAL_RELEASE=1 installer
+include ${DOC_DIR}/module.mk
+
FORCE: