Delete zerotier directory

This commit is contained in:
OPPEN321 2025-02-05 00:21:11 +08:00 committed by GitHub
parent 76796811bd
commit 1310bc898b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 0 additions and 384 deletions

View File

@ -1,14 +0,0 @@
menu "Configuration"
depends on PACKAGE_zerotier
config ZEROTIER_ENABLE_DEBUG
bool "Build in debug mode"
depends on PACKAGE_zerotier
default n
config ZEROTIER_ENABLE_SELFTEST
bool "Build a self test program"
depends on PACKAGE_zerotier
default n
endmenu

View File

@ -1,82 +0,0 @@
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=zerotier
PKG_VERSION:=1.14.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/zerotier/ZeroTierOne/tar.gz/$(PKG_VERSION)?
PKG_HASH:=4f9f40b27c5a78389ed3f3216c850921f6298749e5819e9f2edabb2672ce9ca0
PKG_BUILD_DIR:=$(BUILD_DIR)/ZeroTierOne-$(PKG_VERSION)
PKG_MAINTAINER:=Moritz Warning <moritzwarning@web.de>
PKG_LICENSE:=BSL 1.1
PKG_LICENSE_FILES:=LICENSE.txt
PKG_ASLR_PIE:=0
PKG_BUILD_PARALLEL:=1
PKG_BUILD_FLAGS:=gc-sections
include $(INCLUDE_DIR)/package.mk
define Package/zerotier
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libpthread +libstdcpp +kmod-tun +ip +libminiupnpc +libnatpmp +libatomic
TITLE:=Create flat virtual Ethernet networks of almost unlimited size
URL:=https://www.zerotier.com
SUBMENU:=VPN
endef
define Package/zerotier/description
ZeroTier creates a global provider-independent virtual private cloud network.
endef
define Package/zerotier/config
source "$(SOURCE)/Config.in"
endef
ifeq ($(CONFIG_ZEROTIER_ENABLE_DEBUG),y)
MAKE_FLAGS += ZT_DEBUG=1
endif
MAKE_FLAGS += \
ZT_EMBEDDED=1 \
ZT_SSO_SUPPORTED=0 \
DEFS="" \
OSTYPE="Linux" \
define Build/Compile
$(call Build/Compile/Default,one)
ifeq ($(CONFIG_ZEROTIER_ENABLE_SELFTEST),y)
$(call Build/Compile/Default,selftest)
endif
endef
# Make binary smaller
TARGET_CFLAGS += -Wl,-z,noexecstack
TARGET_LDFLAGS += -Wl,--as-needed -Wl,-z,noexecstack
#define Package/zerotier/conffiles
#/etc/config/zerotier
#endef
define Package/zerotier/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/zerotier-one $(1)/usr/bin/
$(LN) zerotier-one $(1)/usr/bin/zerotier-cli
$(LN) zerotier-one $(1)/usr/bin/zerotier-idtool
$(INSTALL_DIR) $(1)/etc/uci-defaults
ifeq ($(CONFIG_ZEROTIER_ENABLE_SELFTEST),y)
$(INSTALL_BIN) $(PKG_BUILD_DIR)/zerotier-selftest $(1)/usr/bin/
endif
#$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,zerotier))

View File

@ -1,39 +0,0 @@
config zerotier 'global'
# Sets whether ZeroTier is enabled or not
option enabled 0
# Sets the ZeroTier listening port (default 9993; set to 0 for random)
#option port '9993'
# Client secret (leave blank to generate a secret on first run)
option secret ''
# Path of the optional file local.conf (see documentation at
# https://docs.zerotier.com/config#local-configuration-options)
#option local_conf_path '/etc/zerotier.conf'
# Persistent configuration directory (to perform other configurations such
# as controller mode or moons, etc.)
#option config_path '/etc/zerotier'
# Copy the contents of the persistent configuration directory to memory
# instead of linking it, this avoids writing to flash
#option copy_config_path '1'
# Network configuration, you can have as many configurations as networks you
# want to join (the network name is optional)
config network 'earth'
# Identifier of the network you wish to join
option id '8056c2e21c000001'
# Network configuration parameters (all are optional, if not indicated the
# default values are set, see documentation at
# https://docs.zerotier.com/config/#network-specific-configuration)
option allow_managed '1'
option allow_global '0'
option allow_default '0'
option allow_dns '0'
# Example of a second network (unnamed as it is optional)
#config network
# option id '1234567890123456'
# option allow_managed '1'
# option allow_global '0'
# option allow_default '0'
# option allow_dns '0'

View File

@ -1,108 +0,0 @@
#!/bin/sh /etc/rc.common
START=90
USE_PROCD=1
PROG=/usr/bin/zerotier-one
CONFIG_PATH=/var/lib/zerotier-one
join_network() {
local section="${1}"
local id allow_managed allow_global allow_default allow_dns
config_get id "${section}" 'id'
config_get_bool allow_managed "${section}" 'allow_managed' 1
config_get_bool allow_global "${section}" 'allow_global' 0
config_get_bool allow_default "${section}" 'allow_default' 0
config_get_bool allow_dns "${section}" 'allow_dns' 0
if [ -n "${id}" ]; then
# an (empty) config file will cause ZT to join a network
touch "${CONFIG_PATH}"/networks.d/"${id}".conf
echo "allowManaged=${allow_managed}" > "${CONFIG_PATH}"/networks.d/"${id}".local.conf
echo "allowGlobal=${allow_global}" >> "${CONFIG_PATH}"/networks.d/"${id}".local.conf
echo "allowDefault=${allow_default}" >> "${CONFIG_PATH}"/networks.d/"${id}".local.conf
echo "allowDNS=${allow_dns}" >> "${CONFIG_PATH}"/networks.d/"${id}".local.conf
fi
}
start_service() {
config_load zerotier
local enabled port secret local_conf_path config_path copy_config_path
local args=""
config_get_bool enabled 'global' 'enabled' 0
config_get port 'global' 'port'
config_get secret 'global' 'secret'
config_get local_conf_path 'global' 'local_conf_path'
config_get config_path 'global' 'config_path'
config_get_bool copy_config_path 'global' 'copy_config_path' 0
if [ ${enabled} -eq 0 ]; then
echo "disabled in /etc/config/zerotier"
return
fi
# Remove existing link or folder
rm -rf "${CONFIG_PATH}"
# Create link or copy files from config_path to CONFIG_PATH
if [ -n "${config_path}" ]; then
if [ ! -d "${config_path}" ]; then
echo "ZeroTier config_path does not exist: ${config_path}" 1>&2
return
fi
if [ ${copy_config_path} -eq 1 ]; then
cp -r "${config_path}" "${CONFIG_PATH}"
else
ln -s "${config_path}" "${CONFIG_PATH}"
fi
fi
mkdir -p "${CONFIG_PATH}"/networks.d
config_foreach join_network network
if [ -f "${local_conf_path}" ]; then
ln -s "${local_conf_path}" "${CONFIG_PATH}"/local.conf
fi
if [ -n "${port}" ]; then
args="${args} -p${port}"
fi
if [ -z "${secret}" ]; then
echo -n "Generating secret - please wait... "
secret="$(zerotier-idtool generate)"
[ ${?} -ne 0 ] && return 1
uci set zerotier.global.secret="${secret}"
uci commit zerotier
echo "done."
fi
if [ -n "${secret}" ]; then
echo "${secret}" > "${CONFIG_PATH}"/identity.secret
# make sure there is not previous identity.public
rm -f "${CONFIG_PATH}"/identity.public
fi
procd_open_instance
procd_set_param command ${PROG} ${args}
procd_set_param stderr 1
procd_set_param respawn
procd_close_instance
}
stop_service() {
rm -rf "${CONFIG_PATH}"
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger 'zerotier'
}

View File

@ -1,19 +0,0 @@
# Convert the join list into networks
nets=$(uci -q get zerotier.@zerotier[0].join)
if [ -n "$nets" ]; then
for net in ${nets}; do
sid=$(uci add zerotier network)
uci set zerotier.${sid}.id=${net}
done
uci delete zerotier.@zerotier[0].join
# Rename local conf (only if defined)
uci -q rename zerotier.@zerotier[0].local_conf='local_conf_path' || true
# Rename configuration to global
uci rename zerotier.@zerotier[0]='global'
# Commit all changes
uci commit zerotier
fi

View File

@ -1,31 +0,0 @@
From ec02787ae7c5b6e906ab50bcebcd676d4219c812 Mon Sep 17 00:00:00 2001
From: Moritz Warning <moritzwarning@web.de>
Date: Tue, 17 Sep 2024 14:17:08 +0200
Subject: [PATCH 1/5] fix miniupnpc natpmp include path
---
make-linux.mk | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -26,8 +26,8 @@ TIMESTAMP=$(shell date +"%Y%m%d%H%M")
# otherwise build into binary as done on Mac and Windows.
ONE_OBJS+=osdep/PortMapper.o
override DEFS+=-DZT_USE_MINIUPNPC
-MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2..*"' /usr/include/miniupnpc/miniupnpc.h && echo 1)
-#MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' /usr/include/miniupnpc/miniupnpc.h && echo 1)
+MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2..*"' $(STAGING_DIR)/usr/include/miniupnpc/miniupnpc.h && echo 1)
+#MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' $(STAGING_DIR)/usr/include/miniupnpc/miniupnpc.h && echo 1)
ifeq ($(MINIUPNPC_IS_NEW_ENOUGH),1)
override DEFS+=-DZT_USE_SYSTEM_MINIUPNPC
LDLIBS+=-lminiupnpc
@@ -35,7 +35,7 @@ else
override DEFS+=-DMINIUPNP_STATICLIB -DMINIUPNPC_SET_SOCKET_TIMEOUT -DMINIUPNPC_GET_SRC_ADDR -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DOS_STRING="\"Linux\"" -DMINIUPNPC_VERSION_STRING="\"2.0\"" -DUPNP_VERSION_STRING="\"UPnP/1.1\"" -DENABLE_STRNATPMPERR
ONE_OBJS+=ext/miniupnpc/connecthostport.o ext/miniupnpc/igd_desc_parse.o ext/miniupnpc/minisoap.o ext/miniupnpc/minissdpc.o ext/miniupnpc/miniupnpc.o ext/miniupnpc/miniwget.o ext/miniupnpc/minixml.o ext/miniupnpc/portlistingparse.o ext/miniupnpc/receivedata.o ext/miniupnpc/upnpcommands.o ext/miniupnpc/upnpdev.o ext/miniupnpc/upnperrors.o ext/miniupnpc/upnpreplyparse.o
endif
-ifeq ($(wildcard /usr/include/natpmp.h),)
+ifeq ($(wildcard $(STAGING_DIR)/usr/include/natpmp.h),)
ONE_OBJS+=ext/libnatpmp/natpmp.o ext/libnatpmp/getgateway.o
else
LDLIBS+=-lnatpmp

View File

@ -1,31 +0,0 @@
From 81a632c99b581790344729ad327eb473c4c05260 Mon Sep 17 00:00:00 2001
From: Moritz Warning <moritzwarning@web.de>
Date: Tue, 17 Sep 2024 15:36:36 +0200
Subject: [PATCH 2/5] remove PIE options
---
make-linux.mk | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -333,7 +333,7 @@ ifeq ($(ZT_CONTROLLER),1)
endif
# ARM32 hell -- use conservative CFLAGS
-ifeq ($(ZT_ARCHITECTURE),3)
+ifeq (0,3)
ifeq ($(shell if [ -e /usr/bin/dpkg ]; then dpkg --print-architecture; fi),armel)
override CFLAGS+=-march=armv5t -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm
override CXXFLAGS+=-march=armv5t -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm
@@ -360,8 +360,8 @@ ifeq ($(ZT_USE_ARM32_NEON_ASM_CRYPTO),1)
endif
# Position Independence
-override CFLAGS+=-fPIC -fPIE
-override CXXFLAGS+=-fPIC -fPIE
+#override CFLAGS+=-fPIC -fPIE
+#override CXXFLAGS+=-fPIC -fPIE
# Non-executable stack
override LDFLAGS+=-Wl,-z,noexecstack

View File

@ -1,20 +0,0 @@
From 71ed5b791fb0f7bfe1f564726fdc979b71313fbe Mon Sep 17 00:00:00 2001
From: Moritz Warning <moritzwarning@web.de>
Date: Tue, 17 Sep 2024 15:38:01 +0200
Subject: [PATCH 3/5] fix compilation for arm_cortex a7 neon
---
node/Constants.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/node/Constants.hpp
+++ b/node/Constants.hpp
@@ -123,7 +123,7 @@
#include <immintrin.h>
#endif
-#if (defined(__ARM_NEON) || defined(__ARM_NEON__) || defined(ZT_ARCH_ARM_HAS_NEON))
+#if (defined(__aarch64__) || defined(ZT_ARCH_ARM_HAS_NEON))
#if (defined(__APPLE__) && !defined(__LP64__)) || (defined(__ANDROID__) && defined(__arm__))
#ifdef ZT_ARCH_ARM_HAS_NEON
#undef ZT_ARCH_ARM_HAS_NEON

View File

@ -1,20 +0,0 @@
From d6197554b3f52ee9d8d81374141aa82014b4fc7b Mon Sep 17 00:00:00 2001
From: Moritz Warning <moritzwarning@web.de>
Date: Tue, 17 Sep 2024 15:38:34 +0200
Subject: [PATCH 4/5] add missing libatomic
---
make-linux.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -11,7 +11,7 @@ endif
INCLUDES?=-Irustybits/target -isystem ext -Iext/prometheus-cpp-lite-1.0/core/include -Iext-prometheus-cpp-lite-1.0/3rdparty/http-client-lite/include -Iext/prometheus-cpp-lite-1.0/simpleapi/include
DEFS?=
-LDLIBS?=
+LDLIBS?=-latomic
DESTDIR?=
EXTRA_DEPS?=

View File

@ -1,20 +0,0 @@
From 8e89af98ac00b1c9c019865faca7479fa0de6084 Mon Sep 17 00:00:00 2001
From: Moritz Warning <moritzwarning@web.de>
Date: Tue, 17 Sep 2024 21:26:08 +0200
Subject: [PATCH 5/5] remove noexecstack
---
make-linux.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -364,7 +364,7 @@ endif
#override CXXFLAGS+=-fPIC -fPIE
# Non-executable stack
-override LDFLAGS+=-Wl,-z,noexecstack
+#override LDFLAGS+=-Wl,-z,noexecstack
.PHONY: all
all: one