diff --git a/pkg/wd/Dockerfile b/pkg/wd/Dockerfile new file mode 100644 index 000000000..fd8b6774b --- /dev/null +++ b/pkg/wd/Dockerfile @@ -0,0 +1,9 @@ +# vim: ft=dockerfile + +FROM ubuntu:20.04 + +COPY mksapkg-OS5 /mksapkg-OS5 + +COPY entrypoint.sh /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] + diff --git a/pkg/wd/build.sh b/pkg/wd/build.sh new file mode 100755 index 000000000..36f81022f --- /dev/null +++ b/pkg/wd/build.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +build_packages() +{ + sudo docker run -v $(pwd):/zto ztwd +} + +build_dockerfile() +{ + sudo docker build -t ztwd . --load +} + +"$@" diff --git a/pkg/wd/entrypoint.sh b/pkg/wd/entrypoint.sh new file mode 100755 index 000000000..8e10c9ffe --- /dev/null +++ b/pkg/wd/entrypoint.sh @@ -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 + +"$@" diff --git a/pkg/wd/zerotier/apkg.rc b/pkg/wd/zerotier/apkg.rc new file mode 100644 index 000000000..c01af66d1 --- /dev/null +++ b/pkg/wd/zerotier/apkg.rc @@ -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: + diff --git a/pkg/wd/zerotier/apkg.xml b/pkg/wd/zerotier/apkg.xml new file mode 100644 index 000000000..6ce296cc6 --- /dev/null +++ b/pkg/wd/zerotier/apkg.xml @@ -0,0 +1,37 @@ + + + + + 0 + 20 + 8 + 11 + 0 + 1 + 0 + zerotier + ZeroTier + 1 + 1.8.8 + 20220425 + + + + index.html + 9993 + 2 + ZeroTier, Inc. + contact@zerotier.com + http://www.zerotier.com + + + + + Securely connect any device, anywhere. + zerotier.png + + + + + + diff --git a/pkg/wd/zerotier/clean.sh b/pkg/wd/zerotier/clean.sh new file mode 100755 index 000000000..0b6a9b312 --- /dev/null +++ b/pkg/wd/zerotier/clean.sh @@ -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 diff --git a/pkg/wd/zerotier/init.sh b/pkg/wd/zerotier/init.sh new file mode 100755 index 000000000..e17d6c186 --- /dev/null +++ b/pkg/wd/zerotier/init.sh @@ -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 \ No newline at end of file diff --git a/pkg/wd/zerotier/install.sh b/pkg/wd/zerotier/install.sh new file mode 100755 index 000000000..3ea51d268 --- /dev/null +++ b/pkg/wd/zerotier/install.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +path_src=$1 +path_des=$2 +mv $path_src $path_des diff --git a/pkg/wd/zerotier/preinst.sh b/pkg/wd/zerotier/preinst.sh new file mode 100755 index 000000000..1a2485251 --- /dev/null +++ b/pkg/wd/zerotier/preinst.sh @@ -0,0 +1 @@ +#!/bin/sh diff --git a/pkg/wd/zerotier/remove.sh b/pkg/wd/zerotier/remove.sh new file mode 100755 index 000000000..f1f97b41d --- /dev/null +++ b/pkg/wd/zerotier/remove.sh @@ -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 diff --git a/pkg/wd/zerotier/start.sh b/pkg/wd/zerotier/start.sh new file mode 100755 index 000000000..71a62a839 --- /dev/null +++ b/pkg/wd/zerotier/start.sh @@ -0,0 +1,3 @@ +#! /bin/sh + +/usr/bin/zerotier-one -d \ No newline at end of file diff --git a/pkg/wd/zerotier/stop.sh b/pkg/wd/zerotier/stop.sh new file mode 100755 index 000000000..a357a9ebf --- /dev/null +++ b/pkg/wd/zerotier/stop.sh @@ -0,0 +1,3 @@ +#! /bin/sh + +killall zerotier-one diff --git a/pkg/wd/zerotier/web/index.html b/pkg/wd/zerotier/web/index.html new file mode 100644 index 000000000..d6b235c66 --- /dev/null +++ b/pkg/wd/zerotier/web/index.html @@ -0,0 +1,58 @@ +
+

ZeroTier

+
+ +

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:

+

Using the CLI via SSH:

+
    +
  1. Using your (sshd) account, enable SSH:

    + +
  2. +
  3. From a computer, open a terminal and SSH into your NAS device:

    + +
  4. +
  5. Create account and network ID at my.zerotier.com

    + +
  6. +
  7. Join your device to the network:

    + +
  8. +
  9. Use my.zerotier.com to authorize your NAS device to join your network.

    +
  10. +
+

Help and support (in order of relevance)

+ + + + + diff --git a/pkg/wd/zerotier/web/zerotier.png b/pkg/wd/zerotier/web/zerotier.png new file mode 100644 index 000000000..cd864eb99 Binary files /dev/null and b/pkg/wd/zerotier/web/zerotier.png differ diff --git a/pkg/wd/zerotier/zerotier.png b/pkg/wd/zerotier/zerotier.png new file mode 100644 index 000000000..cd864eb99 Binary files /dev/null and b/pkg/wd/zerotier/zerotier.png differ