فهرست منبع

Add Western Digital apkg build scripts

Joseph Henry 3 سال پیش
والد
کامیت
acd1f24a3f

+ 9 - 0
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"]
+

+ 13 - 0
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
+}
+
+"$@"

+ 98 - 0
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: [email protected]
+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 - 0
pkg/wd/zerotier/apkg.rc

@@ -0,0 +1,21 @@
+Package: zerotier
+Section: Apps
+Version: 1.8.8
+Packager: ZeroTier, Inc.
+Email: [email protected]
+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 - 0
pkg/wd/zerotier/apkg.xml

@@ -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>[email protected]</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 - 0
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

+ 15 - 0
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

+ 5 - 0
pkg/wd/zerotier/install.sh

@@ -0,0 +1,5 @@
+#!/bin/sh
+
+path_src=$1
+path_des=$2
+mv $path_src $path_des

+ 1 - 0
pkg/wd/zerotier/preinst.sh

@@ -0,0 +1 @@
+#!/bin/sh

+ 10 - 0
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

+ 3 - 0
pkg/wd/zerotier/start.sh

@@ -0,0 +1,3 @@
+#! /bin/sh
+
+/usr/bin/zerotier-one -d

+ 3 - 0
pkg/wd/zerotier/stop.sh

@@ -0,0 +1,3 @@
+#! /bin/sh
+
+killall zerotier-one

+ 58 - 0
pkg/wd/zerotier/web/index.html

@@ -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> -&gt; <strong><code>Network</code></strong> -&gt; <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&#39;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:[email protected]">[email protected]</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


BIN
pkg/wd/zerotier/zerotier.png