First Commit
4
pkg/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
Third-party packaging
|
||||
=====
|
||||
|
||||
For package documentation see the `Devices` section here: [docs.zerotier.com](https://docs.zerotier.com/)
|
||||
10
pkg/asustor/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
# vim: ft=dockerfile
|
||||
|
||||
FROM ubuntu:20.04
|
||||
|
||||
RUN apt-get update -qq && apt-get install python2.7 -y
|
||||
|
||||
COPY apkg-tools.py /apkg-tools.py
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
13
pkg/asustor/build.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
build_packages()
|
||||
{
|
||||
sudo docker run -v $(pwd):/zto ztasustor
|
||||
}
|
||||
|
||||
build_container()
|
||||
{
|
||||
sudo docker build -t ztasustor . --load
|
||||
}
|
||||
|
||||
"$@"
|
||||
29
pkg/asustor/entrypoint.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
ZTO_VER=$(git describe --abbrev=0 --tags)
|
||||
ZTO_COMMIT=$(git rev-parse HEAD)
|
||||
ZTO_DESC=$(jq -r '.desc' ../config.json)
|
||||
|
||||
# Clean up any pre-existing packages
|
||||
find pkg/asustor -type f -name "*.apk" -exec rm -rvf {} \;
|
||||
# Copy current license
|
||||
cp ../../LICENSE.txt zerotier/control/license.txt
|
||||
# Configure package data
|
||||
tmp="config-tmp.json"
|
||||
jq --arg a "$ZTO_VER" '.general.version = $a' pkg/asustor/zerotier/CONTROL/config.json > $tmp && mv $tmp pkg/asustor/zerotier/CONTROL/config.json
|
||||
echo $ZTO_DESC > pkg/asustor/zerotier/CONTROL/description.txt
|
||||
|
||||
# Copy binaries into pkg directory
|
||||
cp -vf output/static/zerotier-one.${ZTO_VER}.alpine-aarch64 pkg/asustor/zerotier/bin/zerotier-one.aarch64
|
||||
cp -vf output/static/zerotier-one.${ZTO_VER}.alpine-i386 pkg/asustor/zerotier/bin/zerotier-one.i386
|
||||
cp -vf output/static/zerotier-one.${ZTO_VER}.alpine-x86_64 pkg/asustor/zerotier/bin/zerotier-one.x86-64
|
||||
|
||||
# Package
|
||||
python pkg/asustor/apkg-tools.py create pkg/asustor/zerotier
|
||||
rm -rf output/asustor
|
||||
mkdir -p output/asustor
|
||||
mv ./*.apk output/asustor
|
||||
|
||||
# Show output product
|
||||
cat pkg/asustor/zerotier/CONTROL/config.json
|
||||
tree output/asustor
|
||||
15
pkg/asustor/zerotier/CONTROL/config.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"general": {
|
||||
"package": "zerotier",
|
||||
"name": "ZeroTier",
|
||||
"version": "1.8.6",
|
||||
"depends": [],
|
||||
"conflicts": [],
|
||||
"developer": "ZeroTier, Inc.",
|
||||
"maintainer": "ZeroTier, Inc.",
|
||||
"email": "support@zerotier.com",
|
||||
"website": "http://www.zerotier.com/",
|
||||
"architecture": "any",
|
||||
"firmware": "2.1.0"
|
||||
}
|
||||
}
|
||||
1
pkg/asustor/zerotier/CONTROL/description.txt
Normal file
@@ -0,0 +1 @@
|
||||
Securely connect any device, anywhere.
|
||||
BIN
pkg/asustor/zerotier/CONTROL/icon.png
Normal file
|
After Width: | Height: | Size: 144 KiB |
149
pkg/asustor/zerotier/CONTROL/license.txt
Normal file
@@ -0,0 +1,149 @@
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Business Source License 1.1
|
||||
|
||||
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
|
||||
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Parameters
|
||||
|
||||
Licensor: ZeroTier, Inc.
|
||||
Licensed Work: ZeroTier Network Virtualization Engine 1.4.4
|
||||
The Licensed Work is (c)2019 ZeroTier, Inc.
|
||||
Additional Use Grant: You may make use of the Licensed Work, provided you
|
||||
do not use it in any of the following ways:
|
||||
|
||||
* Sell hosted ZeroTier services as a "SaaS" Product
|
||||
|
||||
(1) Operate or sell access to ZeroTier root servers,
|
||||
network controllers, or authorization key or certificate
|
||||
generation components of the Licensed Work as a
|
||||
for-profit service, regardless of whether the use of
|
||||
these components is sold alone or is bundled with other
|
||||
services. Note that this does not apply to the use of
|
||||
ZeroTier behind the scenes to operate a service not
|
||||
related to ZeroTier network administration.
|
||||
|
||||
* Create Non-Open-Source Commercial Derivative Works
|
||||
|
||||
(2) Link or directly include the Licensed Work in a
|
||||
commercial or for-profit application or other product
|
||||
not distributed under an Open Source Initiative (OSI)
|
||||
compliant license. See: https://opensource.org/licenses
|
||||
|
||||
(3) Remove the name, logo, copyright, or other branding
|
||||
material from the Licensed Work to create a "rebranded"
|
||||
or "white labeled" version to distribute as part of
|
||||
any commercial or for-profit product or service.
|
||||
|
||||
* Certain Government Uses
|
||||
|
||||
(4) Use or deploy the Licensed Work in a government
|
||||
setting in support of any active government function
|
||||
or operation with the exception of the following:
|
||||
physical or mental health care, family and social
|
||||
services, social welfare, senior care, child care, and
|
||||
the care of persons with disabilities.
|
||||
|
||||
Change Date: 2026-01-01
|
||||
|
||||
Change License: Apache License version 2.0 as published by the Apache
|
||||
Software Foundation
|
||||
https://www.apache.org/licenses/
|
||||
|
||||
Alternative Licensing
|
||||
|
||||
If you would like to use the Licensed Work in any way that conflicts with
|
||||
the stipulations of the Additional Use Grant, contact ZeroTier, Inc. to
|
||||
obtain an alternative commercial license.
|
||||
|
||||
Visit us on the web at: https://www.zerotier.com/
|
||||
|
||||
Notice
|
||||
|
||||
The Business Source License (this document, or the "License") is not an Open
|
||||
Source license. However, the Licensed Work will eventually be made available
|
||||
under an Open Source License, as stated in this License.
|
||||
|
||||
For more information on the use of the Business Source License for ZeroTier
|
||||
products, please visit our pricing page which contains license details and
|
||||
and license FAQ: https://zerotier.com/pricing
|
||||
|
||||
For more information on the use of the Business Source License generally,
|
||||
please visit the Adopting and Developing Business Source License FAQ at
|
||||
https://mariadb.com/bsl-faq-adopting.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Business Source License 1.1
|
||||
|
||||
Terms
|
||||
|
||||
The Licensor hereby grants you the right to copy, modify, create derivative
|
||||
works, redistribute, and make non-production use of the Licensed Work. The
|
||||
Licensor may make an Additional Use Grant, above, permitting limited
|
||||
production use.
|
||||
|
||||
Effective on the Change Date, or the fourth anniversary of the first publicly
|
||||
available distribution of a specific version of the Licensed Work under this
|
||||
License, whichever comes first, the Licensor hereby grants you rights under
|
||||
the terms of the Change License, and the rights granted in the paragraph
|
||||
above terminate.
|
||||
|
||||
If your use of the Licensed Work does not comply with the requirements
|
||||
currently in effect as described in this License, you must purchase a
|
||||
commercial license from the Licensor, its affiliated entities, or authorized
|
||||
resellers, or you must refrain from using the Licensed Work.
|
||||
|
||||
All copies of the original and modified Licensed Work, and derivative works
|
||||
of the Licensed Work, are subject to this License. This License applies
|
||||
separately for each version of the Licensed Work and the Change Date may vary
|
||||
for each version of the Licensed Work released by Licensor.
|
||||
|
||||
You must conspicuously display this License on each original or modified copy
|
||||
of the Licensed Work. If you receive the Licensed Work in original or
|
||||
modified form from a third party, the terms and conditions set forth in this
|
||||
License apply to your use of that work.
|
||||
|
||||
Any use of the Licensed Work in violation of this License will automatically
|
||||
terminate your rights under this License for the current and all other
|
||||
versions of the Licensed Work.
|
||||
|
||||
This License does not grant you any right in any trademark or logo of
|
||||
Licensor or its affiliates (provided that you may use a trademark or logo of
|
||||
Licensor as expressly required by this License).
|
||||
|
||||
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
||||
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
||||
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
||||
TITLE.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
MariaDB hereby grants you permission to use this License’s text to license
|
||||
your works, and to refer to it using the trademark "Business Source License",
|
||||
as long as you comply with the Covenants of Licensor below.
|
||||
|
||||
Covenants of Licensor
|
||||
|
||||
In consideration of the right to use this License’s text and the "Business
|
||||
Source License" name and trademark, Licensor covenants to MariaDB, and to all
|
||||
other recipients of the licensed work to be provided by Licensor:
|
||||
|
||||
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
||||
or a license that is compatible with GPL Version 2.0 or a later version,
|
||||
where "compatible" means that software provided under the Change License can
|
||||
be included in a program with software provided under GPL Version 2.0 or a
|
||||
later version. Licensor may specify additional Change Licenses without
|
||||
limitation.
|
||||
|
||||
2. To either: (a) specify an additional grant of rights to use that does not
|
||||
impose any additional restriction on the right granted in this License, as
|
||||
the Additional Use Grant; or (b) insert the text "None".
|
||||
|
||||
3. To specify a Change Date.
|
||||
|
||||
4. Not to modify this License in any other way.
|
||||
24
pkg/asustor/zerotier/CONTROL/post-install.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
APKG_PKG_DIR=/usr/local/AppCentral/zerotier
|
||||
|
||||
case "$APKG_PKG_STATUS" in
|
||||
|
||||
install)
|
||||
modprobe tun
|
||||
mkdir -p /usr/local/bin
|
||||
mv ${APKG_PKG_DIR}/bin/zerotier-one.${AS_NAS_ARCH} ${APKG_PKG_DIR}/bin/zerotier-one
|
||||
ln -s ${APKG_PKG_DIR}/bin/zerotier-one /usr/local/bin/zerotier-cli
|
||||
ln -s ${APKG_PKG_DIR}/bin/zerotier-one /usr/local/bin/zerotier-idtool
|
||||
ln -s $APKG_PKG_DIR/data /var/lib/zerotier-one
|
||||
;;
|
||||
upgrade)
|
||||
# post upgrade script here (restore data)
|
||||
# cp -af $APKG_TEMP_DIR/* $APKG_PKG_DIR/etc/.
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
exit 0
|
||||
3
pkg/asustor/zerotier/CONTROL/post-uninstall.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
rm -rf /var/lib/zerotier-one/
|
||||
0
pkg/asustor/zerotier/CONTROL/pre-install.sh
Executable file
0
pkg/asustor/zerotier/CONTROL/pre-uninstall.sh
Executable file
26
pkg/asustor/zerotier/CONTROL/start-stop.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/script/lib/command.sh
|
||||
|
||||
APKG_PKG_DIR=/usr/local/AppCentral/zerotier
|
||||
|
||||
case $1 in
|
||||
|
||||
start)
|
||||
modprobe tun
|
||||
# start script here
|
||||
$APKG_PKG_DIR/bin/zerotier-one $APKG_PKG_DIR/data -d
|
||||
;;
|
||||
|
||||
stop)
|
||||
# stop script here
|
||||
pkill zerotier
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "usage: $0 {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
1
pkg/asustor/zerotier/apkg-version
Normal file
@@ -0,0 +1 @@
|
||||
2.0
|
||||
58
pkg/asustor/zerotier/www/index.html
Normal file
@@ -0,0 +1,58 @@
|
||||
<div class="header">
|
||||
<h2 id="zerotier">ZeroTier</h2>
|
||||
</div>
|
||||
|
||||
<p>Welcome! ZeroTier is a peer-to-peer encrypted virtual networking solution that enables you to create Local Area Networks with static IP assignments for all of your devices. Access your NAS from anywhere in the world with a single IP and without the need of cloud services backhauling your traffic. To use the CLI:</p>
|
||||
<h2 id="using-the-cli-via-ssh-">Using the CLI via SSH:</h2>
|
||||
<ol>
|
||||
<li><p>Using your (admin) account, enable SSH:</p>
|
||||
<ul>
|
||||
<li><strong><code>Services</code></strong> -> <strong><code>Terminal</code></strong> -> <strong><code>Enable SSH</code></strong> (set to port <code>22</code>)</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p>From a computer, open a terminal and SSH into your NAS device:</p>
|
||||
<ul>
|
||||
<li><strong><code>ssh admin@your_nas_device_lan_ip</code></strong></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p>Create account and network ID at <a href="https://my.zerotier.com">my.zerotier.com</a></p>
|
||||
<ul>
|
||||
<li><em>Note: This account is merely to administer your network. Your traffic is not handled by ZeroTier except in the case where a direct connection cannot be established. This is a courtesy service we offer for free that you can disable if you'd like. In any case, your traffic is <a href="https://www.zerotier.com/manual/#2_1_3">fully encrypted</a> end-to-end.</em></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p>Join your device to the network:</p>
|
||||
<ul>
|
||||
<li><strong><code>zerotier-cli join your_network_id</code></strong></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p>Use <a href="https://my.zerotier.com">my.zerotier.com</a> to authorize your NAS device to join your network.</p>
|
||||
</li>
|
||||
</ol>
|
||||
<h2 id="help-and-support-in-order-of-relevance-">Help and support (in order of relevance)</h2>
|
||||
<ul>
|
||||
<li>Github Repository: <a href="https://github.com/zerotier/ZeroTierNAS/issues">https://github.com/zerotier/ZeroTierNAS</a></li>
|
||||
<li>Forums: <a href="https://discuss.zerotier.com">https://discuss.zerotier.com</a></li>
|
||||
<li>Contact: <a href="mailto:support@zerotier.com">support@zerotier.com</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="footer">
|
||||
<h2 id="zerotier"><h2>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.header {
|
||||
padding: 1px;
|
||||
text-align: center;
|
||||
background: #F2B464;
|
||||
color: black;
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
padding: 1px;
|
||||
text-align: center;
|
||||
background: #F2B464;
|
||||
color: black;
|
||||
font-size: 30px;
|
||||
}
|
||||
</style>
|
||||
6
pkg/config.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"version": "1.8.7",
|
||||
"rev": "1",
|
||||
"desc": "Securely connect any device, anywhere.",
|
||||
"email": "support@zerotier.com"
|
||||
}
|
||||
8
pkg/qnap/Dockerfile
Normal file
@@ -0,0 +1,8 @@
|
||||
# vim: ft=dockerfile
|
||||
|
||||
FROM ubuntu:20.04
|
||||
|
||||
# COPY zerotier/qbuild /qbuild
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
13
pkg/qnap/build.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
build_packages()
|
||||
{
|
||||
sudo docker run -v $(pwd):/zto ztqnap
|
||||
}
|
||||
|
||||
build_container()
|
||||
{
|
||||
sudo docker build -t ztqnap . --load
|
||||
}
|
||||
|
||||
"$@"
|
||||
76
pkg/qnap/entrypoint.sh
Executable file
@@ -0,0 +1,76 @@
|
||||
#!/bin/bash
|
||||
|
||||
ZTO_VER=$(git describe --abbrev=0 --tags)
|
||||
ZTO_COMMIT=$(git rev-parse HEAD)
|
||||
ZTO_DESC=$(jq -r '.desc' ../config.json)
|
||||
|
||||
mkdir -p pkg/qnap/zerotier/arm_64
|
||||
mkdir -p pkg/qnap/zerotier/arm_x09
|
||||
mkdir -p pkg/qnap/zerotier/arm_x10
|
||||
mkdir -p pkg/qnap/zerotier/arm_x12
|
||||
mkdir -p pkg/qnap/zerotier/arm_x19
|
||||
mkdir -p pkg/qnap/zerotier/arm_x31
|
||||
mkdir -p pkg/qnap/zerotier/arm_x41
|
||||
mkdir -p pkg/qnap/zerotier/x86_64
|
||||
mkdir -p pkg/qnap/zerotier/x86
|
||||
mkdir -p pkg/qnap/zerotier/x86_ce53xx
|
||||
|
||||
cat > pkg/qnap/zerotier/qpkg.cfg <<- EOM
|
||||
# Update package config
|
||||
# Name of the packaged application.
|
||||
QPKG_NAME="zerotier"
|
||||
# Name of the display application.
|
||||
QPKG_DISPLAY_NAME="ZeroTier"
|
||||
# Version of the packaged application.
|
||||
QPKG_VER="$ZTO_VER"
|
||||
# Author or maintainer of the package
|
||||
QPKG_AUTHOR="ZeroTier, Inc."
|
||||
# License for the packaged application
|
||||
QPKG_LICENSE="BUSL-1.1"
|
||||
# One-line description of the packaged application
|
||||
QPKG_SUMMARY="$ZTO_DESC"
|
||||
|
||||
# Preferred number in start/stop sequence.
|
||||
QPKG_RC_NUM="101"
|
||||
# Init-script used to control the start and stop of the installed application.
|
||||
QPKG_SERVICE_PROGRAM="zerotier.sh"
|
||||
|
||||
# Specifies any packages required for the current package to operate.
|
||||
QPKG_REQUIRE="QVPN Service"
|
||||
# Specifies what packages cannot be installed if the current package
|
||||
# is to operate properly.
|
||||
#QPKG_CONFLICT="Python, OPT/sed"
|
||||
# Name of configuration file (multiple definitions are allowed).
|
||||
#QPKG_CONFIG="myApp.conf"
|
||||
#QPKG_CONFIG="/etc/config/myApp.conf"
|
||||
# Port number used by service program.
|
||||
QPKG_SERVICE_PORT="9993"
|
||||
|
||||
# Minimum QTS version requirement
|
||||
QTS_MINI_VERSION="4.1.0"
|
||||
# Maximum QTS version requirement
|
||||
QTS_MAX_VERSION="5.0.0"
|
||||
|
||||
# Location of icons for the packaged application.
|
||||
QDK_DATA_DIR_ICONS="icons"
|
||||
EOM
|
||||
|
||||
# Copy binaries into pkg directory
|
||||
# See: https://github.com/qnap-dev/QDK
|
||||
cp -vf output/static/zerotier-one.${ZTO_VER}.alpine-aarch64 pkg/qnap/zerotier/arm_64/zerotier-one
|
||||
#cp -vf output/static/zerotier-one.${ZTO_VER}.alpine-armv5tejl pkg/qnap/zerotier/arm-x09/zerotier-one
|
||||
#cp -vf output/static/zerotier-one.${ZTO_VER}.alpine-armv5tel pkg/qnap/zerotier/arm-x19/zerotier-one
|
||||
cp -vf output/static/zerotier-one.${ZTO_VER}.alpine-armhf pkg/qnap/zerotier/arm-x31/zerotier-one
|
||||
cp -vf output/static/zerotier-one.${ZTO_VER}.alpine-armhf pkg/qnap/zerotier/arm-x41/zerotier-one
|
||||
cp -vf output/static/zerotier-one.${ZTO_VER}.alpine-i386 pkg/qnap/zerotier/x86/zerotier-one
|
||||
cp -vf output/static/zerotier-one.${ZTO_VER}.alpine-x86_64 pkg/qnap/zerotier/x86_64/zerotier-one
|
||||
cp -vf output/static/zerotier-one.${ZTO_VER}.alpine-i386 pkg/qnap/zerotier/x86_ce53xx/zerotier-one
|
||||
|
||||
rm -rf output/qnap/*
|
||||
|
||||
pushd pkg/qnap/zerotier
|
||||
./qbuild #--build-arch arm-x31
|
||||
cp -f build/* ../../../output/qnap
|
||||
|
||||
# Show output product
|
||||
cd popd
|
||||
3
pkg/qnap/qdk.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
QDK_VERSION=2.3.11
|
||||
QDK_PATH_P=`pwd | awk 'BEGIN { FS = "QDK" } ; { print $1 }'`
|
||||
QDK_PATH="${QDK_PATH_P}/QDK"
|
||||
7
pkg/qnap/zerotier/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
.PHONY: all
|
||||
|
||||
all:
|
||||
@$(CC) -o qpkg_encrypt qpkg_encrypt.c
|
||||
|
||||
clean:
|
||||
rm -rf /bin/qpkg_encrypt
|
||||
0
pkg/qnap/zerotier/arm_64/.gitkeep
Normal file
0
pkg/qnap/zerotier/arm_x09/.gitkeep
Normal file
0
pkg/qnap/zerotier/arm_x10/.gitkeep
Normal file
0
pkg/qnap/zerotier/arm_x12/.gitkeep
Normal file
0
pkg/qnap/zerotier/arm_x19/.gitkeep
Normal file
0
pkg/qnap/zerotier/arm_x31/.gitkeep
Normal file
0
pkg/qnap/zerotier/arm_x41/.gitkeep
Normal file
0
pkg/qnap/zerotier/config/.gitkeep
Normal file
0
pkg/qnap/zerotier/icons/.gitkeep
Normal file
BIN
pkg/qnap/zerotier/icons/ZeroTier.gif
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
pkg/qnap/zerotier/icons/ZeroTier_80.gif
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
pkg/qnap/zerotier/icons/ZeroTier_gray.gif
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
158
pkg/qnap/zerotier/package_routines
Normal file
@@ -0,0 +1,158 @@
|
||||
######################################################################
|
||||
# List of available definitions (it's not necessary to uncomment them)
|
||||
######################################################################
|
||||
###### Command definitions #####
|
||||
#CMD_AWK="/bin/awk"
|
||||
#CMD_CAT="/bin/cat"
|
||||
#CMD_CHMOD="/bin/chmod"
|
||||
#CMD_CHOWN="/bin/chown"
|
||||
#CMD_CP="/bin/cp"
|
||||
#CMD_CUT="/bin/cut"
|
||||
#CMD_DATE="/bin/date"
|
||||
#CMD_ECHO="/bin/echo"
|
||||
#CMD_EXPR="/usr/bin/expr"
|
||||
#CMD_FIND="/usr/bin/find"
|
||||
#CMD_GETCFG="/sbin/getcfg"
|
||||
#CMD_GREP="/bin/grep"
|
||||
#CMD_GZIP="/bin/gzip"
|
||||
#CMD_HOSTNAME="/bin/hostname"
|
||||
#CMD_LN="/bin/ln"
|
||||
#CMD_LOG_TOOL="/sbin/log_tool"
|
||||
#CMD_MD5SUM="/bin/md5sum"
|
||||
#CMD_MKDIR="/bin/mkdir"
|
||||
#CMD_MV="/bin/mv"
|
||||
#CMD_RM="/bin/rm"
|
||||
#CMD_RMDIR="/bin/rmdir"
|
||||
#CMD_SED="/bin/sed"
|
||||
#CMD_SETCFG="/sbin/setcfg"
|
||||
#CMD_SLEEP="/bin/sleep"
|
||||
#CMD_SORT="/usr/bin/sort"
|
||||
#CMD_SYNC="/bin/sync"
|
||||
#CMD_TAR="/bin/tar"
|
||||
#CMD_TOUCH="/bin/touch"
|
||||
#CMD_WGET="/usr/bin/wget"
|
||||
#CMD_WLOG="/sbin/write_log"
|
||||
#CMD_XARGS="/usr/bin/xargs"
|
||||
#CMD_7Z="/usr/local/sbin/7z"
|
||||
#
|
||||
###### System definitions #####
|
||||
#SYS_EXTRACT_DIR="$(pwd)"
|
||||
#SYS_CONFIG_DIR="/etc/config"
|
||||
#SYS_INIT_DIR="/etc/init.d"
|
||||
#SYS_STARTUP_DIR="/etc/rcS.d"
|
||||
#SYS_SHUTDOWN_DIR="/etc/rcK.d"
|
||||
#SYS_RSS_IMG_DIR="/home/httpd/RSS/images"
|
||||
#SYS_QPKG_DATA_FILE_GZIP="./data.tar.gz"
|
||||
#SYS_QPKG_DATA_FILE_BZIP2="./data.tar.bz2"
|
||||
#SYS_QPKG_DATA_FILE_7ZIP="./data.tar.7z"
|
||||
#SYS_QPKG_DATA_CONFIG_FILE="./conf.tar.gz"
|
||||
#SYS_QPKG_DATA_MD5SUM_FILE="./md5sum"
|
||||
#SYS_QPKG_DATA_PACKAGES_FILE="./Packages.gz"
|
||||
#SYS_QPKG_CONFIG_FILE="$SYS_CONFIG_DIR/qpkg.conf"
|
||||
#SYS_QPKG_CONF_FIELD_QPKGFILE="QPKG_File"
|
||||
#SYS_QPKG_CONF_FIELD_NAME="Name"
|
||||
#SYS_QPKG_CONF_FIELD_VERSION="Version"
|
||||
#SYS_QPKG_CONF_FIELD_ENABLE="Enable"
|
||||
#SYS_QPKG_CONF_FIELD_DATE="Date"
|
||||
#SYS_QPKG_CONF_FIELD_SHELL="Shell"
|
||||
#SYS_QPKG_CONF_FIELD_INSTALL_PATH="Install_Path"
|
||||
#SYS_QPKG_CONF_FIELD_CONFIG_PATH="Config_Path"
|
||||
#SYS_QPKG_CONF_FIELD_WEBUI="WebUI"
|
||||
#SYS_QPKG_CONF_FIELD_WEBPORT="Web_Port"
|
||||
#SYS_QPKG_CONF_FIELD_SERVICEPORT="Service_Port"
|
||||
#SYS_QPKG_CONF_FIELD_SERVICE_PIDFILE="Pid_File"
|
||||
#SYS_QPKG_CONF_FIELD_AUTHOR="Author"
|
||||
#SYS_QPKG_CONF_FIELD_RC_NUMBER="RC_Number"
|
||||
## The following variables are assigned values at run-time.
|
||||
#SYS_HOSTNAME=$($CMD_HOSTNAME)
|
||||
## Data file name (one of SYS_QPKG_DATA_FILE_GZIP, SYS_QPKG_DATA_FILE_BZIP2,
|
||||
## or SYS_QPKG_DATA_FILE_7ZIP)
|
||||
#SYS_QPKG_DATA_FILE=
|
||||
## Base location.
|
||||
#SYS_QPKG_BASE=""
|
||||
## Base location of QPKG installed packages.
|
||||
#SYS_QPKG_INSTALL_PATH=""
|
||||
## Location of installed software.
|
||||
#SYS_QPKG_DIR=""
|
||||
## If the QPKG should be enabled or disabled after the installation/upgrade.
|
||||
#SYS_QPKG_SERVICE_ENABLED=""
|
||||
## Architecture of the device the QPKG is installed on.
|
||||
#SYS_CPU_ARCH=""
|
||||
## Name and location of system shares
|
||||
#SYS_PUBLIC_SHARE=""
|
||||
#SYS_PUBLIC_PATH=""
|
||||
#SYS_DOWNLOAD_SHARE=""
|
||||
#SYS_DOWNLOAD_PATH=""
|
||||
#SYS_MULTIMEDIA_SHARE=""
|
||||
#SYS_MULTIMEDIA_PATH=""
|
||||
#SYS_RECORDINGS_SHARE=""
|
||||
#SYS_RECORDINGS_PATH=""
|
||||
#SYS_USB_SHARE=""
|
||||
#SYS_USB_PATH=""
|
||||
#SYS_WEB_SHARE=""
|
||||
#SYS_WEB_PATH=""
|
||||
## Path to ipkg or opkg package tool if installed.
|
||||
#CMD_PKG_TOOL=
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# All package specific functions shall call 'err_log MSG' if an error
|
||||
# is detected that shall terminate the installation.
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
# Define any package specific operations that shall be performed when
|
||||
# the package is removed.
|
||||
######################################################################
|
||||
|
||||
#PKG_PRE_REMOVE="{
|
||||
#}"
|
||||
|
||||
PKG_MAIN_REMOVE="{
|
||||
rm -rf /usr/sbin/zerotier-cli
|
||||
# all identity files are stored in the Install_Path and will be removed automatically
|
||||
}"
|
||||
|
||||
#PKG_POST_REMOVE="{
|
||||
#}"
|
||||
|
||||
######################################################################
|
||||
# Define any package specific initialization that shall be performed
|
||||
# before the package is installed.
|
||||
######################################################################
|
||||
|
||||
pkg_init()
|
||||
{
|
||||
modprobe tun
|
||||
}
|
||||
|
||||
|
||||
######################################################################
|
||||
# Define any package specific requirement checks that shall be
|
||||
# performed before the package is installed.
|
||||
######################################################################
|
||||
|
||||
#pkg_check_requirement()
|
||||
#{
|
||||
#}
|
||||
|
||||
######################################################################
|
||||
# Define any package specific operations that shall be performed when
|
||||
# the package is installed.
|
||||
######################################################################
|
||||
|
||||
#pkg_pre_install()
|
||||
#{
|
||||
# log "pkg_pre_install"
|
||||
#}
|
||||
|
||||
#pkg_install()
|
||||
#{
|
||||
# log "pkg_install"
|
||||
#}
|
||||
|
||||
pkg_post_install()
|
||||
{
|
||||
log $SYS_QPKG_INSTALL_PATH
|
||||
modprobe tun
|
||||
}
|
||||
99
pkg/qnap/zerotier/qpkg.cfg
Normal file
@@ -0,0 +1,99 @@
|
||||
# Update package config
|
||||
# Name of the packaged application.
|
||||
QPKG_NAME="zerotier"
|
||||
# Name of the display application.
|
||||
QPKG_DISPLAY_NAME="ZeroTier"
|
||||
# Version of the packaged application.
|
||||
QPKG_VER="1.8.4"
|
||||
# Author or maintainer of the package
|
||||
QPKG_AUTHOR="ZeroTier, Inc."
|
||||
# License for the packaged application
|
||||
QPKG_LICENSE="BUSL-1.1"
|
||||
# One-line description of the packaged application
|
||||
QPKG_SUMMARY="Securely connect any device, anywhere."
|
||||
|
||||
# Preferred number in start/stop sequence.
|
||||
QPKG_RC_NUM="101"
|
||||
# Init-script used to control the start and stop of the installed application.
|
||||
QPKG_SERVICE_PROGRAM="zerotier.sh"
|
||||
|
||||
# Specifies any packages required for the current package to operate.
|
||||
QPKG_REQUIRE="QVPN Service"
|
||||
# Specifies what packages cannot be installed if the current package
|
||||
# is to operate properly.
|
||||
#QPKG_CONFLICT="Python, OPT/sed"
|
||||
# Name of configuration file (multiple definitions are allowed).
|
||||
#QPKG_CONFIG="myApp.conf"
|
||||
#QPKG_CONFIG="/etc/config/myApp.conf"
|
||||
# Port number used by service program.
|
||||
QPKG_SERVICE_PORT="9993"
|
||||
# Location of file with running service's PID
|
||||
#QPKG_SERVICE_PIDFILE="/var/lib/zerotier-one/zerotier-one.pid"
|
||||
# Relative path to web interface
|
||||
#QPKG_WEBUI=""
|
||||
# Port number for the web interface.
|
||||
#QPKG_WEB_PORT=""
|
||||
# Port number for the SSL web interface.
|
||||
#QPKG_WEB_SSL_PORT=""
|
||||
|
||||
# Use QTS HTTP Proxy and set Proxy_Path in the qpkg.conf.
|
||||
# When the QPKG has its own HTTP service port, and want clients to connect via QTS HTTP port (default 8080).
|
||||
# Usually use this option when the QPKG need to connect via myQNAPcloud service.
|
||||
#QPKG_USE_PROXY="1"
|
||||
#QPKG_PROXY_PATH="/qpkg_name"
|
||||
|
||||
#Desktop Application (since 4.1)
|
||||
# Set value to 1 means to open the QPKG's Web UI inside QTS desktop instead of new window.
|
||||
#QPKG_DESKTOP_APP="1"
|
||||
# Desktop Application Window default inner width (since 4.1) (not over 1178)
|
||||
#QPKG_DESKTOP_APP_WIN_WIDTH=""
|
||||
# Desktop Application Window default inner width (since 4.1) (not over 600)
|
||||
#QPKG_DESKTOP_APP_WIN_HEIGHT=""
|
||||
|
||||
# Minimum QTS version requirement
|
||||
QTS_MINI_VERSION="4.1.0"
|
||||
# Maximum QTS version requirement
|
||||
QTS_MAX_VERSION="5.0.0"
|
||||
|
||||
# Select volume
|
||||
# 1: support installation
|
||||
# 2: support migration
|
||||
# 3 (1+2): support both installation and migration
|
||||
#QPKG_VOLUME_SELECT="0"
|
||||
|
||||
# Set timeout for QPKG enable and QPKG disable (since 4.1.0)
|
||||
# Format in seconds (enable, disable)
|
||||
#QPKG_TIMEOUT="10,30"
|
||||
|
||||
# Visible setting for the QPKG that has web UI, show this QPKG on the Main menu of
|
||||
# 1(default): administrators, 2: all NAS users.
|
||||
#QPKG_VISIBLE="2"
|
||||
|
||||
# Location of the chroot environment (only TS-x09)
|
||||
#QPKG_ROOTFS=""
|
||||
# Init-script used to controls the start and stop of the
|
||||
# installed application (only TS-x09)
|
||||
#QPKG_SERVICE_PROGRAM_CHROOT=""
|
||||
|
||||
# Location of icons for the packaged application.
|
||||
QDK_DATA_DIR_ICONS="icons"
|
||||
# Location of files specific to arm-x09 packages.
|
||||
#QDK_DATA_DIR_X09="arm-x09"
|
||||
# Location of files specific to arm-x19 packages.
|
||||
#QDK_DATA_DIR_X19="arm-x19"
|
||||
# Location of files specific to arm-x31 packages.
|
||||
#QDK_DATA_DIR_X31="arm-x31"
|
||||
# Location of files specific to arm-x41 packages.
|
||||
#QDK_DATA_DIR_X41="arm_al"
|
||||
# Location of files specific to x86 packages.
|
||||
#QDK_DATA_DIR_X86="x86"
|
||||
# Location of files specific to x86 (64-bit) packages.
|
||||
#QDK_DATA_DIR_X86_64="x86_64"
|
||||
# Location of files common to all architectures.
|
||||
#QDK_DATA_DIR_SHARED="shared"
|
||||
# Location of configuration files.
|
||||
#QDK_DATA_DIR_CONFIG="config"
|
||||
# Name of local data package.
|
||||
#QDK_DATA_FILE=""
|
||||
# Name of extra package (multiple definitions are allowed).
|
||||
#QDK_EXTRA_FILE=""
|
||||
0
pkg/qnap/zerotier/shared/.gitkeep
Normal file
BIN
pkg/qnap/zerotier/shared/.qpkg_icon.gif
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
pkg/qnap/zerotier/shared/.qpkg_icon_80.gif
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
pkg/qnap/zerotier/shared/.qpkg_icon_gray.gif
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
34
pkg/qnap/zerotier/shared/zerotier.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
CONF=/etc/config/qpkg.conf
|
||||
QPKG_NAME="zerotier"
|
||||
QPKG_ROOT=`/sbin/getcfg $QPKG_NAME Install_Path -f ${CONF}`
|
||||
APACHE_ROOT=/share/`/sbin/getcfg SHARE_DEF defWeb -d Qweb -f /etc/config/def_share.info`
|
||||
case "$1" in
|
||||
start)
|
||||
modprobe tun
|
||||
ln -s $QPKG_ROOT/zerotier-one /usr/sbin/zerotier-cli
|
||||
ln -s $QPKG_ROOT/zerotier-one /usr/bin/zerotier-cli
|
||||
ln -s $QPKG_ROOT /var/lib/zerotier-one
|
||||
ENABLED=$(/sbin/getcfg $QPKG_NAME Enable -u -d FALSE -f $CONF)
|
||||
if [ "$ENABLED" != "TRUE" ]; then
|
||||
echo "$QPKG_NAME is disabled."
|
||||
exit 1
|
||||
fi
|
||||
$QPKG_ROOT/zerotier-one $QPKG_ROOT -d
|
||||
;;
|
||||
|
||||
stop)
|
||||
killall zerotier-one
|
||||
;;
|
||||
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
||||
0
pkg/qnap/zerotier/x86/.gitkeep
Normal file
0
pkg/qnap/zerotier/x86_64/.gitkeep
Normal file
0
pkg/qnap/zerotier/x86_ce53xx/.gitkeep
Normal file
90
pkg/snap/snapcraft.yaml
Normal file
@@ -0,0 +1,90 @@
|
||||
name: zerotier
|
||||
summary: Securely connect any device, anywhere.
|
||||
description: |
|
||||
|
||||
ZeroTier is a software-based managed Ethernet switch for planet Earth. Use it to connect your
|
||||
desktop clients, servers, phones, NAS, or even individual applications (using our SDK).
|
||||
|
||||
This snap contains ZeroTier One, a service that provides ZeroTier network connectivity and
|
||||
makes joining virtual networks as easy as joining IRC or Slack channels. Apps for Android
|
||||
and iOS are available for free in the Google Play and Apple app stores.
|
||||
|
||||
ZeroTier eliminates the LAN/WAN distinction and makes VPNs, tunnels, proxies, and other kludges
|
||||
arising from the inflexible nature of physical networks obsolete. Everything is encrypted
|
||||
end-to-end and traffic takes the most direct (peer to peer) path available.
|
||||
|
||||
Install (be sure to use sudo)
|
||||
|
||||
sudo snap install zerotier
|
||||
|
||||
Join your network
|
||||
|
||||
sudo zerotier join <nwid>
|
||||
sudo zerotier status
|
||||
|
||||
Approve your new node in ZeroTier Central (https://my.zerotier.com)! Welcome online!
|
||||
|
||||
adopt-info: one
|
||||
confinement: strict
|
||||
grade: stable
|
||||
base: core18
|
||||
|
||||
apps:
|
||||
one:
|
||||
# Add -U to prevent attempting to drop privileges since snaps have their
|
||||
# own containment mechanism. Otherwise, if a user named "zerotier-one"
|
||||
# exists on the system, the setgid or related calls will fail.
|
||||
command: usr/sbin/zerotier-one -U
|
||||
daemon: simple
|
||||
plugs:
|
||||
- network
|
||||
- network-bind
|
||||
- network-control
|
||||
|
||||
# For backwards compatibility with old package (e.g. zerotier.cli)
|
||||
# Should be removed someday
|
||||
cli:
|
||||
command: usr/sbin/zerotier-cli
|
||||
plugs:
|
||||
- network
|
||||
|
||||
zerotier:
|
||||
command: usr/sbin/zerotier-cli
|
||||
plugs:
|
||||
- network
|
||||
|
||||
idtool:
|
||||
command: usr/sbin/zerotier-idtool
|
||||
plugs:
|
||||
- network
|
||||
|
||||
layout:
|
||||
/var/lib/zerotier-one:
|
||||
bind: $SNAP_COMMON
|
||||
|
||||
parts:
|
||||
one:
|
||||
plugin: make
|
||||
source: https://github.com/zerotier/zerotierone.git
|
||||
source-branch: "master"
|
||||
build-packages:
|
||||
- build-essential
|
||||
- libc++-dev
|
||||
make-parameters:
|
||||
- ZT_SSO_SUPPORTED=0
|
||||
filesets:
|
||||
binaries:
|
||||
- usr/sbin/zerotier-one
|
||||
- usr/sbin/zerotier-cli
|
||||
- usr/sbin/zerotier-idtool
|
||||
prime:
|
||||
- $binaries
|
||||
override-build: |
|
||||
snapcraftctl build
|
||||
# Grab the version string from the newly-compiled binary.
|
||||
snapcraftctl set-version "$(./zerotier-one -v)"
|
||||
slots:
|
||||
zerotier-control:
|
||||
interface: content
|
||||
read:
|
||||
- $SNAP_COMMON
|
||||
20
pkg/synology/Dockerfile.spksrc
Normal file
@@ -0,0 +1,20 @@
|
||||
# vim: ft=dockerfile
|
||||
|
||||
FROM debian:buster
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
|
||||
# Manage i386 arch
|
||||
RUN dpkg --add-architecture i386
|
||||
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y make imagemagick curl jq wget procps intltool
|
||||
|
||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Volume pointing to spksrc sources
|
||||
VOLUME /spksrc
|
||||
|
||||
WORKDIR /spksrc
|
||||
|
||||
COPY syn-pkg-entrypoint.sh /syn-pkg-entrypoint.sh
|
||||
ENTRYPOINT ["/syn-pkg-entrypoint.sh"]
|
||||
8
pkg/synology/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
## Package for Synology's DSM 6
|
||||
|
||||
Documentation and downloads: [docs.zerotier.com/devices/synology](https://docs.zerotier.com/devices/synology)
|
||||
|
||||
|
||||
```
|
||||
./build.sh build
|
||||
```
|
||||
139
pkg/synology/build.sh
Executable file
@@ -0,0 +1,139 @@
|
||||
#!/bin/bash
|
||||
|
||||
ZTO_VER=$(jq -r '.version' synology/config.json)
|
||||
PKG_REV=$(jq -r '.rev' synology/config.json)
|
||||
echo $ZTO_VER-$PKG_REV
|
||||
ZTO_DESC=$(jq -r '.desc' synology/config.json)
|
||||
echo $ZTO_DESC
|
||||
ZTO_EMAIL=$(jq -r '.email' synology/config.json)
|
||||
echo $ZTO_EMAIL
|
||||
read -p "Confirm details [y/n] ? " -n 1 -r; echo; if [[ ! $REPLY =~ ^[Yy]$ ]]; then echo "Exiting."; exit; fi
|
||||
|
||||
build_environment()
|
||||
{
|
||||
git clone https://github.com/SynoCommunity/spksrc.git
|
||||
sudo docker build --load -t zt-spksrc -f Dockerfile.spksrc .
|
||||
}
|
||||
|
||||
generate_package_sources()
|
||||
{
|
||||
# Clean up any intermediate files
|
||||
sudo make -C spksrc clean
|
||||
rm -rf spksrc/distrib/*
|
||||
rm -rf spksrc/packages/*
|
||||
rm -rf spksrc/distrib/*source.tar.gz*
|
||||
rm -rf spksrc/cross/*
|
||||
mkdir -p spksrc/cross/zerotier
|
||||
|
||||
# Generate the SPK contents
|
||||
|
||||
# Copy package scripts to spksrc so they're accessible to container
|
||||
rm -rf spksrc/dsm6-pkg
|
||||
cp -rf dsm6-pkg spksrc/dsm6-pkg
|
||||
|
||||
TAB="$(printf '\t')"
|
||||
|
||||
cd ..
|
||||
|
||||
# Generate ZTO source tarball used by spksrc
|
||||
git ls-files -z | xargs -0 tar -czvf source.tar.gz
|
||||
mkdir -p synology/spksrc/distrib
|
||||
cp source.tar.gz synology/spksrc/distrib/source.tar.gz
|
||||
|
||||
cat > synology/spksrc/cross/zerotier/digests <<- EOM
|
||||
source.tar.gz SHA1 $(sha1sum source.tar.gz | awk '{print $1}')
|
||||
source.tar.gz SHA256 $(sha256sum source.tar.gz | awk '{print $1}')
|
||||
source.tar.gz MD5 $(md5sum source.tar.gz | awk '{print $1}')
|
||||
EOM
|
||||
|
||||
cd -
|
||||
|
||||
|
||||
STAGING_DIR='$(STAGING_DIR)'
|
||||
RUN='$(RUN)'
|
||||
|
||||
cat > spksrc/cross/zerotier/Makefile <<- EOM
|
||||
PKG_NAME = ZeroTierOne
|
||||
PKG_VERS = $ZTO_VER
|
||||
PKG_EXT = tar.gz
|
||||
PKG_DIST_NAME = source.tar.gz
|
||||
PKG_DIR =
|
||||
PKG_DIST_SITE = http://localhost:8000
|
||||
DEPENDS =
|
||||
GNU_CONFIGURE = 1
|
||||
CONFIGURE_ARGS = HAVE_CXX=yes
|
||||
|
||||
INSTALL_TARGET = zerotier_custom_install
|
||||
CONFIGURE_TARGET = zerotier_custom_configure
|
||||
|
||||
ENV += ZT_SYNOLOGY=1
|
||||
|
||||
include ../../mk/spksrc.cross-cc.mk
|
||||
|
||||
.PHONY: zerotier_custom_install
|
||||
zerotier_custom_install:
|
||||
${TAB}$RUN mkdir -p $STAGING_DIR/bin
|
||||
${TAB}$RUN cp zerotier-one $STAGING_DIR/bin/zerotier-one
|
||||
EOM
|
||||
|
||||
cat > spksrc/cross/zerotier/PLIST <<- EOM
|
||||
bin:bin/zerotier-one
|
||||
EOM
|
||||
|
||||
#
|
||||
# Set up (spk) directory contents
|
||||
#
|
||||
rm -rf spksrc/spk/*
|
||||
mkdir -p spksrc/spk/zerotier
|
||||
|
||||
STAGING_DIR='$(STAGING_DIR)'
|
||||
WORK_DIR='$(WORK_DIR)'
|
||||
PRODUCT_DIR='$(PRODUCT_DIR)'
|
||||
|
||||
cat > spksrc/spk/zerotier/Makefile <<- EOM
|
||||
SPK_NAME = zerotier
|
||||
SPK_VERS = $ZTO_VER
|
||||
SPK_REV = $PKG_REV
|
||||
SPK_ICON = /spksrc/dsm6-pkg/PACKAGE_ICON_256.png
|
||||
DEPENDS = cross/zerotier
|
||||
MAINTAINER = ZeroTier, Inc.
|
||||
DESCRIPTION = $ZTO_DESC
|
||||
LICENSE = BUSL-1.1
|
||||
CHANGELOG =
|
||||
HOMEPAGE = https://my.zerotier.com
|
||||
REPORT_URL = https://github.com/zerotier/ZeroTierOne/issues
|
||||
DISPLAY_NAME = ZeroTier
|
||||
PRODUCT_DIR = $WORK_DIR
|
||||
|
||||
STARTABLE = yes
|
||||
REQUIRED_DSM = 6.2.4
|
||||
|
||||
ENV += ZT_SYNOLOGY=1
|
||||
|
||||
SSS_SCRIPT = ../../dsm6-pkg/start-stop-status.sh
|
||||
|
||||
PRE_STRIP_TARGET = zerotier_install
|
||||
|
||||
include ../../mk/spksrc.spk.mk
|
||||
|
||||
.PHONY: zerotier_install
|
||||
zerotier_install:
|
||||
${TAB}install -m 755 -d $STAGING_DIR/bin
|
||||
${TAB}install -m 755 $PRODUCT_DIR/zerotier-one $STAGING_DIR/bin/zerotier-one
|
||||
EOM
|
||||
|
||||
cat > spksrc/spk/zerotier/PLIST <<- EOM
|
||||
bin:bin/zerotier-one
|
||||
EOM
|
||||
}
|
||||
|
||||
build()
|
||||
{
|
||||
pushd synology
|
||||
build_environment
|
||||
generate_package_sources
|
||||
sudo docker run -it -v $(pwd)/spksrc:/spksrc zt-spksrc /bin/bash
|
||||
popd
|
||||
}
|
||||
|
||||
"$@"
|
||||
BIN
pkg/synology/dsm6-pkg/PACKAGE_ICON.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
pkg/synology/dsm6-pkg/PACKAGE_ICON_256.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
3
pkg/synology/dsm6-pkg/scripts/postinst
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
exit 0
|
||||
3
pkg/synology/dsm6-pkg/scripts/postuninst
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
exit 0
|
||||
2
pkg/synology/dsm6-pkg/scripts/postupgrade
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exit 0
|
||||
2
pkg/synology/dsm6-pkg/scripts/preinst
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exit 0
|
||||
3
pkg/synology/dsm6-pkg/scripts/preuninst
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
exit 0
|
||||
2
pkg/synology/dsm6-pkg/scripts/preupgrade
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exit 0
|
||||
30
pkg/synology/dsm6-pkg/service-setup.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
service_postinst()
|
||||
{
|
||||
exit 0
|
||||
}
|
||||
|
||||
service_postuninst()
|
||||
{
|
||||
exit 0
|
||||
}
|
||||
|
||||
service_postupgrade()
|
||||
{
|
||||
exit 0
|
||||
}
|
||||
|
||||
service_preinst()
|
||||
{
|
||||
exit 0
|
||||
}
|
||||
|
||||
service_preuninst()
|
||||
{
|
||||
exit 0
|
||||
}
|
||||
|
||||
service_preupgrade()
|
||||
{
|
||||
exit 0
|
||||
}
|
||||
162
pkg/synology/dsm6-pkg/start-stop-status.sh
Executable file
@@ -0,0 +1,162 @@
|
||||
#!/bin/sh
|
||||
|
||||
PKGVAR=/var/packages/zerotier/var
|
||||
|
||||
ZTO_PID_FILE="$PKGVAR/zerotier-one.pid"
|
||||
WAT_PID_FILE="$PKGVAR/zerotier-watchdog.pid"
|
||||
ZTO_LOG_FILE="$PKGVAR/zerotier-one.log"
|
||||
|
||||
log()
|
||||
{
|
||||
local timestamp=$(date --iso-8601=second)
|
||||
echo "$timestamp $1" >> $ZTO_LOG_FILE
|
||||
}
|
||||
|
||||
configure_tun()
|
||||
{
|
||||
log "Checking for TUN device"
|
||||
# Create /dev/net/tun if needed
|
||||
if ( [ ! -c /dev/net/tun ] ); then
|
||||
if ( [ ! -d /dev/net ] ); then
|
||||
mkdir -m 755 /dev/net
|
||||
fi
|
||||
log "Adding TUN device"
|
||||
mknod /dev/net/tun c 10 200
|
||||
chmod 0755 /dev/net/tun
|
||||
fi
|
||||
|
||||
# Load TUN kernel module
|
||||
if ( !( lsmod | grep -q "^tun\s" ) ); then
|
||||
log "Loading TUN kernel module"
|
||||
insmod /lib/modules/tun.ko
|
||||
fi
|
||||
}
|
||||
|
||||
configure_cli()
|
||||
{
|
||||
# Create ZT CLI symlinks if needed
|
||||
mkdir -p /usr/local/bin/
|
||||
ln -s $SYNOPKG_PKGDEST/bin/zerotier-one /usr/local/bin/zerotier-cli
|
||||
ln -s $SYNOPKG_PKGDEST/bin/zerotier-one /usr/local/bin/zerotier-idtool
|
||||
rm -rf /var/lib/zerotier-one
|
||||
ln -s /var/packages/zerotier/var /var/lib/zerotier-one
|
||||
}
|
||||
|
||||
apply_routes()
|
||||
{
|
||||
echo $BASHPID >> $WAT_PID_FILE
|
||||
log "Started Watchdog ($(cat $WAT_PID_FILE))"
|
||||
|
||||
# Wait for ZT service to come online before attempting queries
|
||||
sleep 15
|
||||
|
||||
# Loop until killed, check for required routes and add if needed
|
||||
while true
|
||||
do
|
||||
NETWORK_COUNT=$(zerotier-cli -j listnetworks | jq -r '. | length')
|
||||
if [ "$NETWORK_COUNT" -gt 0 ]; then
|
||||
for ((j=0; j<=$((NETWORK_COUNT-1)); j++))
|
||||
do
|
||||
ROUTE_COUNT=$(zerotier-cli -j listnetworks | jq -r '.['$j'].routes | length')
|
||||
for ((k=0; k<=$((ROUTE_COUNT-1)); k++))
|
||||
do
|
||||
ROUTE=$(zerotier-cli -j listnetworks | jq -r '.['$j'].routes['$k'].target')
|
||||
EXIST=$(ip route show $ROUTE | wc -l)
|
||||
if [ $EXIST -eq 0 ];
|
||||
then
|
||||
IFNAME=$(zerotier-cli -j listnetworks | jq -r '.['$j'] | .portDeviceName')
|
||||
ip route add $ROUTE dev $IFNAME
|
||||
log "Added route $ROUTE to dev $IFNAME"
|
||||
# Routes will be deleted when ZT brings the interface down
|
||||
fi
|
||||
done
|
||||
done
|
||||
fi
|
||||
sleep 15
|
||||
done
|
||||
}
|
||||
|
||||
configure_routes()
|
||||
{
|
||||
if [ -r "${WAT_PID_FILE}" ]; then
|
||||
exit 0
|
||||
else
|
||||
apply_routes &
|
||||
fi
|
||||
}
|
||||
|
||||
start_daemon()
|
||||
{
|
||||
${SYNOPKG_PKGDEST}/bin/zerotier-one $PKGVAR -d
|
||||
echo $(pidof zerotier-one) > ${ZTO_PID_FILE}
|
||||
log "Started ZeroTier ($(cat $ZTO_PID_FILE))"
|
||||
}
|
||||
|
||||
stop_daemon() {
|
||||
if [ -r "$ZTO_PID_FILE" ]; then
|
||||
local ZTO_PID=$(cat "${ZTO_PID_FILE}")
|
||||
log "Stopped ZeroTier ($(cat $ZTO_PID_FILE))"
|
||||
kill -TERM $ZTO_PID
|
||||
wait_for_status 1 || kill -KILL $PID >> $LOG_FILE 2>&1
|
||||
rm -f $ZTO_PID_FILE > /dev/null
|
||||
fi
|
||||
if [ -r "$WAT_PID_FILE" ]; then
|
||||
local WAT_PID=$(cat "${WAT_PID_FILE}")
|
||||
log "Stopped Watchdog ($(cat $WAT_PID_FILE))"
|
||||
kill -TERM $WAT_PID
|
||||
rm -f $WAT_PID_FILE > /dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
daemon_status()
|
||||
{
|
||||
if [ -f $ZTO_PID_FILE ] && kill -0 `cat $ZTO_PID_FILE` > /dev/null 2>&1; then
|
||||
return
|
||||
fi
|
||||
rm -f $ZTO_PID_FILE
|
||||
return 1
|
||||
}
|
||||
|
||||
wait_for_status()
|
||||
{
|
||||
counter=$2
|
||||
while [ $counter -gt 0 ]; do
|
||||
daemon_status
|
||||
[ $? -eq $1 ] && return
|
||||
let counter=counter-1
|
||||
sleep 1
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if ( pidof zerotier-one ); then
|
||||
exit 0
|
||||
else
|
||||
configure_tun
|
||||
configure_cli
|
||||
start_daemon
|
||||
configure_routes
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
if ( pidof zerotier-one ); then
|
||||
stop_daemon
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
status)
|
||||
if ( pidof zerotier-one ); then
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
30
pkg/synology/dsm7-docker/Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
# vim: ft=dockerfile
|
||||
|
||||
FROM alpine:latest as builder
|
||||
|
||||
WORKDIR /src
|
||||
RUN apk add --no-cache rust cargo \
|
||||
&& apk add openssl-dev \
|
||||
&& apk add --update alpine-sdk linux-headers \
|
||||
&& git clone --quiet https://github.com/zerotier/ZeroTierOne.git /src \
|
||||
&& git reset --quiet --hard ${ZTO_COMMIT} \
|
||||
&& make -f make-linux.mk
|
||||
|
||||
FROM alpine:latest
|
||||
LABEL version=${ZTO_VER}
|
||||
LABEL description="ZeroTier One docker image for Synology NAS"
|
||||
|
||||
RUN apk add --update --no-cache bash jq libc6-compat libstdc++
|
||||
|
||||
EXPOSE 9993/udp
|
||||
ENV MAX_WAIT_SECS SLEEP_TIME
|
||||
|
||||
COPY --from=builder /src/zerotier-one /usr/sbin/
|
||||
RUN mkdir -p /var/lib/zerotier-one \
|
||||
&& ln -s /usr/sbin/zerotier-one /usr/sbin/zerotier-idtool \
|
||||
&& ln -s /usr/sbin/zerotier-one /usr/sbin/zerotier-cli
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod 755 /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
8
pkg/synology/dsm7-docker/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
## Docker image for Synology's DSM7
|
||||
|
||||
Documentation: [docs.zerotier.com/devices/synology](https://docs.zerotier.com/devices/synology)
|
||||
|
||||
### Build & Push changes to DockerHub
|
||||
```shell
|
||||
./build.sh build
|
||||
```
|
||||
19
pkg/synology/dsm7-docker/build.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
ZTO_VER=$(git describe --tags $(git rev-list --tags --max-count=1))
|
||||
ZTO_COMMIT=$(git rev-parse HEAD)
|
||||
|
||||
build() {
|
||||
sudo docker login --username=${DOCKERHUB_USERNAME}
|
||||
|
||||
sudo docker buildx build \
|
||||
--push \
|
||||
--platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
|
||||
--tag zerotier/zerotier-synology:${ZTO_VER} \
|
||||
--tag zerotier/zerotier-synology:latest \
|
||||
--build-arg ZTO_COMMIT=${ZTO_COMMIT} \
|
||||
--build-arg ZTO_VER=${ZTO_VER} \
|
||||
.
|
||||
}
|
||||
|
||||
"$@"
|
||||
82
pkg/synology/dsm7-docker/entrypoint.sh
Executable file
@@ -0,0 +1,82 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -uo pipefail
|
||||
|
||||
trap 'trap " " SIGTERM; kill 0; wait' SIGTERM SIGQUIT SIGINT
|
||||
|
||||
echo "Starting Zerotier-One"
|
||||
zerotier-one -d
|
||||
|
||||
echo "Wait for ZT service to come online before attempting queries..."
|
||||
MAX_WAIT_SECS="${MAX_WAIT_SECS:-90}"
|
||||
SLEEP_TIME="${SLEEP_TIME:-15}"
|
||||
if [[ "$SLEEP_TIME" -le 0 ]]
|
||||
then
|
||||
SLEEP_TIME=1
|
||||
fi
|
||||
|
||||
iterations=$((MAX_WAIT_SECS/SLEEP_TIME))
|
||||
online=false
|
||||
|
||||
for ((s=0; s<=iterations; s++))
|
||||
do
|
||||
online="$(zerotier-cli -j info | jq '.online' 2>/dev/null)"
|
||||
if [[ "$online" == "true" ]]
|
||||
then
|
||||
break
|
||||
fi
|
||||
sleep "$SLEEP_TIME"
|
||||
echo " ."
|
||||
done
|
||||
|
||||
if [[ "$online" != "true" ]]
|
||||
then
|
||||
echo "Waited $MAX_WAIT_SECS for zerotier-one to start, exiting." >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "done."
|
||||
|
||||
(
|
||||
echo "Starting route helper"
|
||||
while true
|
||||
do
|
||||
if ! NETWORK_LIST="$(zerotier-cli -j listnetworks)"
|
||||
then
|
||||
echo "Route helper: $NETWORK_LIST" >&2
|
||||
exit 1
|
||||
fi
|
||||
NETWORK_COUNT="$(jq -r '. | length' <<< "$NETWORK_LIST")"
|
||||
if [[ "$NETWORK_COUNT" -gt 0 ]]
|
||||
then
|
||||
for ((j=0; j<=$((NETWORK_COUNT-1)); j++))
|
||||
do
|
||||
ALLOW_DEFAULT="$(jq -r '.['$j'].allowDefault' <<< "$NETWORK_LIST")"
|
||||
ROUTE_COUNT="$(jq -r '.['$j'].routes | length' <<< "$NETWORK_LIST")"
|
||||
for ((k=0; k<=$((ROUTE_COUNT-1)); k++))
|
||||
do
|
||||
ROUTE="$(jq -r '.['$j'].routes['$k'].target' <<< "$NETWORK_LIST")"
|
||||
VIA="$(jq -r '.['$j'].routes['$k'].via' <<< "$NETWORK_LIST")"
|
||||
if [[ -n "$ROUTE" ]]
|
||||
then
|
||||
# check if route is default and allowDefault enabled for this network
|
||||
if [[ "$ROUTE" == "0.0.0.0/0" && "$ALLOW_DEFAULT" == "false" ]]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
EXIST="$(ip -o route show "$ROUTE")"
|
||||
if [[ -z "${EXIST}" && "$VIA" == "null" ]]
|
||||
then
|
||||
IFNAME="$(jq -r '.['$j'] | .portDeviceName' <<< "$NETWORK_LIST")"
|
||||
echo " Adding route $ROUTE to dev $IFNAME"
|
||||
ip route add "$ROUTE" dev "$IFNAME"
|
||||
# Routes will be deleted when ZT brings the interface down
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
fi
|
||||
sleep 15
|
||||
done ) &
|
||||
|
||||
wait
|
||||
|
||||
38
pkg/synology/syn-pkg-entrypoint.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
pushd spk/zerotier
|
||||
|
||||
make arch-x64-6.2.4
|
||||
make arch-braswell-6.2.4
|
||||
# make arch-88f6281-6.2.4 #(std11)
|
||||
# make arch-monaco-6.2.4 #(ZT_AES_NO_ACCEL=1)
|
||||
# make arch-hi3535-6.2.4 #(take out -mfloat-abi=hard)
|
||||
# make arch-comcerto2k-6.2.4 #(ZT_AES_NO_ACCEL=1, remove all flags from arm hf section)
|
||||
# make arch-alpine4k-6.2.4 #(problem?)
|
||||
# make arch-alpine-6.2.4 #(problem?)
|
||||
make arch-aarch64-6.2.4
|
||||
make arch-apollolake-6.2.4
|
||||
make arch-armada370-6.2.4
|
||||
make arch-armada375-6.2.4
|
||||
make arch-armada37xx-6.2.4
|
||||
make arch-armada38x-6.2.4
|
||||
make arch-armadaxp-6.2.4
|
||||
make arch-armv7-6.2.4
|
||||
make arch-avoton-6.2.4
|
||||
make arch-broadwell-6.2.4
|
||||
make arch-broadwellnk-6.2.4
|
||||
make arch-bromolow-6.2.4
|
||||
make arch-cedarview-6.2.4
|
||||
make arch-denverton-6.2.4
|
||||
make arch-evansport-6.2.4
|
||||
make arch-geminilake-6.2.4
|
||||
make arch-grantley-6.2.4
|
||||
make arch-kvmx64-6.2.4
|
||||
make arch-dockerx64-6.2.3
|
||||
make arch-purley-6.2.4
|
||||
make arch-qoriq-6.2.4
|
||||
make arch-rtd1296-6.2.4
|
||||
make arch-v1000-6.2.4
|
||||
make arch-x86-6.2.4
|
||||
|
||||
popd
|
||||
9
pkg/wd/Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
||||
# vim: ft=dockerfile
|
||||
|
||||
FROM ubuntu:20.04
|
||||
|
||||
COPY mksapkg-OS5 /mksapkg-OS5
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
13
pkg/wd/build.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
build_packages()
|
||||
{
|
||||
sudo docker run -v $(pwd):/zto ztwd
|
||||
}
|
||||
|
||||
build_container()
|
||||
{
|
||||
sudo docker build -t ztwd . --load
|
||||
}
|
||||
|
||||
"$@"
|
||||
98
pkg/wd/entrypoint.sh
Executable file
@@ -0,0 +1,98 @@
|
||||
#!/bin/sh
|
||||
|
||||
ZTO_VER=$(git describe --abbrev=0 --tags)
|
||||
ZTO_COMMIT=$(git rev-parse HEAD)
|
||||
ZTO_DESC=$(jq -r '.desc' ../config.json)
|
||||
|
||||
generate_new_pkg_spec()
|
||||
{
|
||||
cat > zerotier/apkg.rc <<- EOM
|
||||
Package: zerotier
|
||||
Section: Apps
|
||||
Version: $ZTO_VER
|
||||
Packager: ZeroTier, Inc.
|
||||
Email: contact@zerotier.com
|
||||
Homepage: http://www.zerotier.com
|
||||
Description: $ZTO_DESC
|
||||
AddonShowName: ZeroTier
|
||||
Icon: zerotier.png
|
||||
AddonIndexPage: index.html
|
||||
AddonUsedPort: 9993
|
||||
InstDepend:
|
||||
InstConflict:
|
||||
StartDepend:
|
||||
StartConflict:
|
||||
CenterType:1
|
||||
UserControl:0
|
||||
MinFWVer:
|
||||
MaxFWVer:
|
||||
IndividualFlag:
|
||||
|
||||
EOM
|
||||
}
|
||||
|
||||
pkg_x64()
|
||||
{
|
||||
MKSAPKG=../mksapkg-OS5
|
||||
chmod a+x $MKSAPKG
|
||||
BIN_SRC_DIR=..
|
||||
|
||||
pushd zerotier
|
||||
|
||||
cp -f $BIN_SRC_DIR/zerotier-one bin/zerotier-one
|
||||
$MKSAPKG -E -s -m WDMyCloudDL2100
|
||||
$MKSAPKG -E -s -m WDMyCloudDL4100
|
||||
$MKSAPKG -E -s -m MyCloudPR4100
|
||||
$MKSAPKG -E -s -m MyCloudPR2100
|
||||
|
||||
popd
|
||||
}
|
||||
|
||||
pkg_armhf()
|
||||
{
|
||||
MKSAPKG=../mksapkg-OS5
|
||||
chmod a+x $MKSAPKG
|
||||
BIN_SRC_DIR=..
|
||||
|
||||
pushd zerotier
|
||||
cp -f $BIN_SRC_DIR/zerotier-one bin/zerotier-one
|
||||
|
||||
# MyCloudEX2Ultra (Armada A385)
|
||||
$MKSAPKG -E -s -m MyCloudEX2Ultra
|
||||
# WDMyCloudEX4100 (Armada A385)
|
||||
$MKSAPKG -E -s -m WDMyCloudEX4100
|
||||
# WDMyCloudEX2100 (Armada A385)
|
||||
$MKSAPKG -E -s -m WDMyCloudEX2100
|
||||
# WDMyCloudEX4 (Armada A300)
|
||||
$MKSAPKG -E -s -m WDMyCloudEX4
|
||||
# WDMyCloudEX2 (Armada A370)
|
||||
$MKSAPKG -E -s -m WDMyCloudEX2
|
||||
# WDMyCloudMirrorGen2 (Armada A385)
|
||||
$MKSAPKG -E -s -m WDMyCloudMirrorGen2
|
||||
# WDMyCloudMirror (Armada A370)
|
||||
$MKSAPKG -E -s -m WDMyCloudMirror
|
||||
# WDCloud (Armada A375 (2 cores, 1GHz each, armhf, ARMv7l, Cortex A9, vfp, neon))
|
||||
$MKSAPKG -E -s -m WDCloud
|
||||
|
||||
popd
|
||||
}
|
||||
|
||||
normalize-filenames()
|
||||
{
|
||||
for f in *'('*')'*
|
||||
do
|
||||
mv -i "$f" "${f/(*)/}"
|
||||
done
|
||||
}
|
||||
|
||||
clean()
|
||||
{
|
||||
rm -rf *.bin zerotier/apkg.sign
|
||||
}
|
||||
|
||||
generate_new_pkg_spec
|
||||
pkg_x64
|
||||
pkg_armhf
|
||||
normalize-filenames
|
||||
|
||||
"$@"
|
||||
21
pkg/wd/zerotier/apkg.rc
Normal file
@@ -0,0 +1,21 @@
|
||||
Package: zerotier
|
||||
Section: Apps
|
||||
Version: 1.8.8
|
||||
Packager: ZeroTier, Inc.
|
||||
Email: contact@zerotier.com
|
||||
Homepage: http://www.zerotier.com
|
||||
Description: Securely connect any device, anywhere.
|
||||
AddonShowName: ZeroTier
|
||||
Icon: zerotier.png
|
||||
AddonIndexPage: index.html
|
||||
AddonUsedPort: 9993
|
||||
InstDepend:
|
||||
InstConflict:
|
||||
StartDepend:
|
||||
StartConflict:
|
||||
CenterType:1
|
||||
UserControl:0
|
||||
MinFWVer:
|
||||
MaxFWVer:
|
||||
IndividualFlag:
|
||||
|
||||
37
pkg/wd/zerotier/apkg.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<config>
|
||||
<apkg>
|
||||
<item>
|
||||
<procudt_id>0</procudt_id>
|
||||
<custom_id>20</custom_id>
|
||||
<model_id>8</model_id>
|
||||
<app_id>11</app_id>
|
||||
<user_control>0</user_control>
|
||||
<center_type>1</center_type>
|
||||
<individual_flag>0</individual_flag>
|
||||
<name>zerotier</name>
|
||||
<show>ZeroTier</show>
|
||||
<enable>1</enable>
|
||||
<version>1.8.8</version>
|
||||
<date>20220425</date>
|
||||
<inst_date/>
|
||||
<path/>
|
||||
<ps_name/>
|
||||
<url>index.html</url>
|
||||
<url_port>9993</url_port>
|
||||
<apkg_version>2</apkg_version>
|
||||
<packager>ZeroTier, Inc.</packager>
|
||||
<email>contact@zerotier.com</email>
|
||||
<homepage>http://www.zerotier.com</homepage>
|
||||
<inst_depend/>
|
||||
<inst_conflict/>
|
||||
<start_depend/>
|
||||
<start_conflict/>
|
||||
<description>Securely connect any device, anywhere.</description>
|
||||
<icon>zerotier.png</icon>
|
||||
<MinFWVer/>
|
||||
<MaxFWVer/>
|
||||
<Hidden/>
|
||||
</item>
|
||||
</apkg>
|
||||
</config>
|
||||
7
pkg/wd/zerotier/clean.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
rm -f /usr/bin/zerotier-one 2> /dev/null
|
||||
rm -f /usr/sbin/zerotier-one 2> /dev/null
|
||||
|
||||
rm -f /usr/bin/zerotier-cli 2> /dev/null
|
||||
rm -f /usr/sbin/zerotier-cli 2> /dev/null
|
||||
15
pkg/wd/zerotier/init.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
install_path=$1
|
||||
|
||||
ln -s $install_path/bin/zerotier-one /usr/sbin/zerotier-one
|
||||
ln -s $install_path/bin/zerotier-one /usr/sbin/zerotier-cli
|
||||
ln -s $install_path/bin/zerotier-one /usr/bin/zerotier-one
|
||||
ln -s $install_path/bin/zerotier-one /usr/bin/zerotier-cli
|
||||
|
||||
ln -s $install_path/ /var/lib/zerotier-one
|
||||
|
||||
APKG_PATH=$(readlink -f $1)
|
||||
WEBPATH="/var/www/apps/zerotier/"
|
||||
mkdir -p $WEBPATH
|
||||
ln -sf ${APKG_PATH}/web/* $WEBPATH
|
||||
5
pkg/wd/zerotier/install.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
path_src=$1
|
||||
path_des=$2
|
||||
mv $path_src $path_des
|
||||
1
pkg/wd/zerotier/preinst.sh
Executable file
@@ -0,0 +1 @@
|
||||
#!/bin/sh
|
||||
10
pkg/wd/zerotier/remove.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
path=$1
|
||||
rm -f /usr/bin/zerotier-one 2> /dev/null
|
||||
rm -f /usr/sbin/zerotier-one 2> /dev/null
|
||||
|
||||
rm -f /usr/bin/zerotier-cli 2> /dev/null
|
||||
rm -f /usr/sbin/zerotier-cli 2> /dev/null
|
||||
|
||||
rm -rf $path
|
||||
3
pkg/wd/zerotier/start.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#! /bin/sh
|
||||
|
||||
/usr/bin/zerotier-one -d
|
||||
3
pkg/wd/zerotier/stop.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#! /bin/sh
|
||||
|
||||
killall zerotier-one
|
||||
58
pkg/wd/zerotier/web/index.html
Normal file
@@ -0,0 +1,58 @@
|
||||
<div class="header">
|
||||
<h2 id="zerotier">ZeroTier</h2>
|
||||
</div>
|
||||
|
||||
<p>Welcome! ZeroTier is a peer-to-peer encrypted virtual networking solution that enables you to create Local Area Networks with static IP assignments for all of your devices. Access your NAS from anywhere in the world with a single IP and without the need of cloud services backhauling your traffic. To use the CLI:</p>
|
||||
<h2 id="using-the-cli-via-ssh-">Using the CLI via SSH:</h2>
|
||||
<ol>
|
||||
<li><p>Using your (sshd) account, enable SSH:</p>
|
||||
<ul>
|
||||
<li><strong><code>Settings</code></strong> -> <strong><code>Network</code></strong> -> <strong><code>SSH</code></strong></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p>From a computer, open a terminal and SSH into your NAS device:</p>
|
||||
<ul>
|
||||
<li><strong><code>ssh sshd@your_nas_device_lan_ip</code></strong></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p>Create account and network ID at <a href="https://my.zerotier.com">my.zerotier.com</a></p>
|
||||
<ul>
|
||||
<li><em>Note: This account is merely to administer your network. Your traffic is not handled by ZeroTier except in the case where a direct connection cannot be established. This is a courtesy service we offer for free that you can disable if you'd like. In any case, your traffic is <a href="https://www.zerotier.com/manual/#2_1_3">fully encrypted</a> end-to-end.</em></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p>Join your device to the network:</p>
|
||||
<ul>
|
||||
<li><strong><code>zerotier-cli join your_network_id</code></strong></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p>Use <a href="https://my.zerotier.com">my.zerotier.com</a> to authorize your NAS device to join your network.</p>
|
||||
</li>
|
||||
</ol>
|
||||
<h2 id="help-and-support-in-order-of-relevance-">Help and support (in order of relevance)</h2>
|
||||
<ul>
|
||||
<li>Github Repository: <a href="https://github.com/zerotier/ZeroTierNAS/issues">https://github.com/zerotier/ZeroTierNAS</a></li>
|
||||
<li>Forums: <a href="https://discuss.zerotier.com">https://discuss.zerotier.com</a></li>
|
||||
<li>Contact: <a href="mailto:contact@zerotier.com">contact@zerotier.com</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="footer">
|
||||
<h2 id="zerotier"><h2>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.header {
|
||||
padding: 1px;
|
||||
text-align: center;
|
||||
background: #F2B464;
|
||||
color: black;
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
padding: 1px;
|
||||
text-align: center;
|
||||
background: #F2B464;
|
||||
color: black;
|
||||
font-size: 30px;
|
||||
}
|
||||
</style>
|
||||
BIN
pkg/wd/zerotier/web/zerotier.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
pkg/wd/zerotier/zerotier.png
Normal file
|
After Width: | Height: | Size: 47 KiB |