From 660c43b89cd0ad818e1b99128fee592f27c89224 Mon Sep 17 00:00:00 2001 From: xcf13363175 <13363175@qq.com> Date: Wed, 2 Oct 2024 20:04:25 +0800 Subject: [PATCH 01/88] Update Makefile --- lang/golang/golang/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/golang/golang/Makefile b/lang/golang/golang/Makefile index 219f61b384..4a489c7bdf 100644 --- a/lang/golang/golang/Makefile +++ b/lang/golang/golang/Makefile @@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk -GO_VERSION_MAJOR_MINOR:=1.22 -GO_VERSION_PATCH:=7 +GO_VERSION_MAJOR_MINOR:=1.23 +GO_VERSION_PATCH:=1 PKG_NAME:=golang PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH)) @@ -20,7 +20,7 @@ GO_SOURCE_URLS:=https://dl.google.com/go/ \ PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz PKG_SOURCE_URL:=$(GO_SOURCE_URLS) -PKG_HASH:=66432d87d85e0cfac3edffe637d5930fc4ddf5793313fe11e4a0f333023c879f +PKG_HASH:=6ee44e298379d146a5e5aa6b1c5b5d5f5d0a3365eabdd70741e6e21340ec3b0d PKG_MAINTAINER:=Jeffery To PKG_LICENSE:=BSD-3-Clause From d3f6a448c30d2ca6894457e28d4d69981d4914b9 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 5 Oct 2024 01:59:26 +0800 Subject: [PATCH 02/88] Revert "zerotier: referesh patches and merge other upstream changes" This reverts commit bbc0866a7be5cab43efeb078c251423ebdf27b3f. --- net/zerotier/Makefile | 1 - net/zerotier/files/etc/config/zerotier | 45 ++---- net/zerotier/files/etc/init.d/zerotier | 138 ++++++++++-------- .../files/etc/uci-defaults/80-zt-migration | 19 --- ...-fix-miniupnpc-natpmp-include-paths.patch} | 7 +- .../patches/0002-remove-PIE-options.patch | 18 ++- ...x-compilation-for-arm_cortex-a7-neon.patch | 9 +- .../patches/0004-add-missing-libatomic.patch | 5 +- .../patches/0005-remove-noexecstack.patch | 7 +- 9 files changed, 124 insertions(+), 125 deletions(-) delete mode 100644 net/zerotier/files/etc/uci-defaults/80-zt-migration rename net/zerotier/patches/{0001-fix-miniupnpc-natpmp-include-path.patch => 0001-fix-miniupnpc-natpmp-include-paths.patch} (89%) diff --git a/net/zerotier/Makefile b/net/zerotier/Makefile index bce1255421..b43e096320 100644 --- a/net/zerotier/Makefile +++ b/net/zerotier/Makefile @@ -71,7 +71,6 @@ define Package/zerotier/install $(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/ diff --git a/net/zerotier/files/etc/config/zerotier b/net/zerotier/files/etc/config/zerotier index 879fefe879..34b1ad347e 100644 --- a/net/zerotier/files/etc/config/zerotier +++ b/net/zerotier/files/etc/config/zerotier @@ -1,39 +1,20 @@ -config zerotier 'global' - # Sets whether ZeroTier is enabled or not +config zerotier sample_config 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.) + + # persistent configuration folder (for ZT controller mode) #option config_path '/etc/zerotier' - # Copy the contents of the persistent configuration directory to memory - # instead of linking it, this avoids writing to flash + # copy to RAM to prevent writing to flash (for ZT controller mode) #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' + #option port '9993' + + # path to the local.conf + #option local_conf '/etc/zerotier.conf' -# 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' + # Generate secret on first start + option secret '' + # Join a public network called Earth + list join '8056c2e21c000001' + #list join '' diff --git a/net/zerotier/files/etc/init.d/zerotier b/net/zerotier/files/etc/init.d/zerotier index 01aff425f3..aebdc7de0c 100755 --- a/net/zerotier/files/etc/init.d/zerotier +++ b/net/zerotier/files/etc/init.d/zerotier @@ -7,95 +7,117 @@ 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 +section_enabled() { + config_get_bool enabled "$1" 'enabled' 0 + [ $enabled -ne 0 ] } -start_service() { - config_load zerotier - local enabled port secret local_conf_path config_path copy_config_path +start_instance() { + local cfg="$1" + local port secret config_path local_conf copy_config_path 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 + if ! section_enabled "$cfg"; then echo "disabled in /etc/config/zerotier" - return + return 1 fi - # Remove existing link or folder - rm -rf "${CONFIG_PATH}" + config_get config_path $cfg 'config_path' + config_get port $cfg 'port' + config_get secret $cfg 'secret' + config_get local_conf $cfg 'local_conf' + config_get_bool copy_config_path $cfg 'copy_config_path' 0 - # 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 + path=${CONFIG_PATH}_$cfg + + # Remove existing link or folder + rm -rf $path + + # Create link or copy files from CONFIG_PATH to config_path + if [ -n "$config_path" -a "$config_path" != "$path" ]; then + # Create the config path to init and persist + if [ ! -d "$config_path" ]; then + echo "ZeroTier config_path does not exist: $config_path, create..." + mkdir -p $config_path fi - if [ ${copy_config_path} -eq 1 ]; then - cp -r "${config_path}" "${CONFIG_PATH}" + # ensure that the target exists + mkdir -p $(dirname $path) + + if [ "$copy_config_path" = "1" ]; then + cp -r $config_path $path else - ln -s "${config_path}" "${CONFIG_PATH}" + ln -s $config_path $path fi fi - mkdir -p "${CONFIG_PATH}"/networks.d - config_foreach join_network network + mkdir -p $path/networks.d - if [ -f "${local_conf_path}" ]; then - ln -s "${local_conf_path}" "${CONFIG_PATH}"/local.conf - fi + # link latest default config path to latest config path + rm -f $CONFIG_PATH + ln -s $path $CONFIG_PATH - if [ -n "${port}" ]; then - args="${args} -p${port}" + 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}" + if [ -z "$secret" -a ! -f $path/identity.secret ]; then + echo "Generate secret - please wait..." + local sf="/tmp/zt.$cfg.secret" + + zerotier-idtool generate "$sf" > /dev/null + [ $? -ne 0 ] && return 1 + + secret="$(cat $sf)" + rm "$sf" + + uci set zerotier.$cfg.secret="$secret" uci commit zerotier - echo "done." fi - if [ -n "${secret}" ]; then - echo "${secret}" > "${CONFIG_PATH}"/identity.secret + if [ -n "$secret" ]; then + echo "$secret" > $path/identity.secret # make sure there is not previous identity.public - rm -f "${CONFIG_PATH}"/identity.public + rm -f $path/identity.public fi + if [ -f "$local_conf" ]; then + ln -s "$local_conf" $path/local.conf + fi + + add_join() { + # an (empty) config file will cause ZT to join a network + touch $path/networks.d/$1.conf + } + + config_list_foreach $cfg 'join' add_join + procd_open_instance - procd_set_param command ${PROG} ${args} + procd_set_param command $PROG $args $path procd_set_param stderr 1 procd_set_param respawn procd_close_instance } +start_service() { + config_load 'zerotier' + config_foreach start_instance 'zerotier' +} + +stop_instance() { + local cfg="$1" + + # Remove existing networks + rm -f ${CONFIG_PATH}_${cfg}/networks.d/*.conf + + # Remove existing link or folder + rm -rf ${CONFIG_PATH}_${cfg} +} + stop_service() { - rm -rf "${CONFIG_PATH}" + config_load 'zerotier' + config_foreach stop_instance 'zerotier' + rm -f ${CONFIG_PATH} } reload_service() { diff --git a/net/zerotier/files/etc/uci-defaults/80-zt-migration b/net/zerotier/files/etc/uci-defaults/80-zt-migration deleted file mode 100644 index 1cfedb5838..0000000000 --- a/net/zerotier/files/etc/uci-defaults/80-zt-migration +++ /dev/null @@ -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 diff --git a/net/zerotier/patches/0001-fix-miniupnpc-natpmp-include-path.patch b/net/zerotier/patches/0001-fix-miniupnpc-natpmp-include-paths.patch similarity index 89% rename from net/zerotier/patches/0001-fix-miniupnpc-natpmp-include-path.patch rename to net/zerotier/patches/0001-fix-miniupnpc-natpmp-include-paths.patch index eeab33905f..a4a129ae3c 100644 --- a/net/zerotier/patches/0001-fix-miniupnpc-natpmp-include-path.patch +++ b/net/zerotier/patches/0001-fix-miniupnpc-natpmp-include-paths.patch @@ -1,8 +1,9 @@ -From ec02787ae7c5b6e906ab50bcebcd676d4219c812 Mon Sep 17 00:00:00 2001 +From f53004bd22365900a1dbb120dae62ce8b614d31d Mon Sep 17 00:00:00 2001 From: Moritz Warning -Date: Tue, 17 Sep 2024 14:17:08 +0200 -Subject: [PATCH 1/5] fix miniupnpc natpmp include path +Date: Mon, 6 May 2024 22:31:57 +0200 +Subject: [PATCH 1/5] fix miniupnpc/natpmp include paths +Signed-off-by: Moritz Warning --- make-linux.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/zerotier/patches/0002-remove-PIE-options.patch b/net/zerotier/patches/0002-remove-PIE-options.patch index 26e7e87481..dd240acebb 100644 --- a/net/zerotier/patches/0002-remove-PIE-options.patch +++ b/net/zerotier/patches/0002-remove-PIE-options.patch @@ -1,14 +1,24 @@ -From 81a632c99b581790344729ad327eb473c4c05260 Mon Sep 17 00:00:00 2001 +From c10b5ed4c6c44e36178b0a5a82da9e8eaa957008 Mon Sep 17 00:00:00 2001 From: Moritz Warning -Date: Tue, 17 Sep 2024 15:36:36 +0200 +Date: Mon, 6 May 2024 22:34:15 +0200 Subject: [PATCH 2/5] remove PIE options +Signed-off-by: Moritz Warning --- - make-linux.mk | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) + make-linux.mk | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) --- a/make-linux.mk +++ b/make-linux.mk +@@ -71,7 +71,7 @@ else + override CFLAGS+=-Wall -Wno-deprecated -pthread $(INCLUDES) -DNDEBUG $(DEFS) + CXXFLAGS?=-O3 -fstack-protector + override CXXFLAGS+=-Wall -Wno-deprecated -std=c++17 -pthread $(INCLUDES) -DNDEBUG $(DEFS) +- LDFLAGS?=-pie -Wl,-z,relro,-z,now ++ LDFLAGS?=-Wl,-z,relro,-z,now + ZT_CARGO_FLAGS=--release + endif + @@ -333,7 +333,7 @@ ifeq ($(ZT_CONTROLLER),1) endif diff --git a/net/zerotier/patches/0003-fix-compilation-for-arm_cortex-a7-neon.patch b/net/zerotier/patches/0003-fix-compilation-for-arm_cortex-a7-neon.patch index 14e6b46ea1..34b336196b 100644 --- a/net/zerotier/patches/0003-fix-compilation-for-arm_cortex-a7-neon.patch +++ b/net/zerotier/patches/0003-fix-compilation-for-arm_cortex-a7-neon.patch @@ -1,8 +1,11 @@ -From 71ed5b791fb0f7bfe1f564726fdc979b71313fbe Mon Sep 17 00:00:00 2001 +From fee674d5a5c7cc847d7e1925ddf41eea89d915c4 Mon Sep 17 00:00:00 2001 From: Moritz Warning -Date: Tue, 17 Sep 2024 15:38:01 +0200 -Subject: [PATCH 3/5] fix compilation for arm_cortex a7 neon +Date: Mon, 4 Jul 2022 00:10:52 +0200 +Subject: [PATCH 3/5] fix compilation for arm_cortex-a7+neon +Fixes "error: 'vrbitq_u8' was not declared in this scope" + +Signed-off-by: Rosen Penev --- node/Constants.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/zerotier/patches/0004-add-missing-libatomic.patch b/net/zerotier/patches/0004-add-missing-libatomic.patch index 68c033e96a..5b7cb80c28 100644 --- a/net/zerotier/patches/0004-add-missing-libatomic.patch +++ b/net/zerotier/patches/0004-add-missing-libatomic.patch @@ -1,8 +1,9 @@ -From d6197554b3f52ee9d8d81374141aa82014b4fc7b Mon Sep 17 00:00:00 2001 +From f8b4c4a045a9711c316a5c48b238c24cc0948da1 Mon Sep 17 00:00:00 2001 From: Moritz Warning -Date: Tue, 17 Sep 2024 15:38:34 +0200 +Date: Mon, 6 May 2024 22:35:41 +0200 Subject: [PATCH 4/5] add missing libatomic +Signed-off-by: Moritz Warning --- make-linux.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/zerotier/patches/0005-remove-noexecstack.patch b/net/zerotier/patches/0005-remove-noexecstack.patch index c4fb0f3fb5..769c70e1c2 100644 --- a/net/zerotier/patches/0005-remove-noexecstack.patch +++ b/net/zerotier/patches/0005-remove-noexecstack.patch @@ -1,8 +1,9 @@ -From 8e89af98ac00b1c9c019865faca7479fa0de6084 Mon Sep 17 00:00:00 2001 +From 2a5a279ac0192bc444cd1c3059169f576817d8b9 Mon Sep 17 00:00:00 2001 From: Moritz Warning -Date: Tue, 17 Sep 2024 21:26:08 +0200 +Date: Mon, 28 Aug 2023 09:48:28 +0200 Subject: [PATCH 5/5] remove noexecstack +The compilers for arm_cortex-a9 do not recognize this argument. --- make-linux.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) @@ -14,7 +15,7 @@ Subject: [PATCH 5/5] remove noexecstack # Non-executable stack -override LDFLAGS+=-Wl,-z,noexecstack -+#override LDFLAGS+=-Wl,-z,noexecstack ++# override LDFLAGS+=-Wl,-z,noexecstack .PHONY: all all: one From f33590430a47430d09a764aa7e4d2717a8068089 Mon Sep 17 00:00:00 2001 From: trli Date: Mon, 7 Oct 2024 21:39:21 +0800 Subject: [PATCH 03/88] update lxc --- utils/lxc/Makefile | 49 ++++++++++--------- .../lxc/patches/010-Remove-distro-check.patch | 44 ----------------- utils/lxc/patches/020-lxc-checkconfig.patch | 19 ++++--- .../025-remove-unsupported-option.patch | 21 +++++--- 4 files changed, 49 insertions(+), 84 deletions(-) delete mode 100644 utils/lxc/patches/010-Remove-distro-check.patch diff --git a/utils/lxc/Makefile b/utils/lxc/Makefile index 19fd00f5ec..1e51c0a2cb 100644 --- a/utils/lxc/Makefile +++ b/utils/lxc/Makefile @@ -9,22 +9,33 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lxc -PKG_VERSION:=4.0.12 -PKG_RELEASE:=$(AUTORELEASE) +PKG_VERSION:=6.0.2 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://linuxcontainers.org/downloads/lxc/ -PKG_HASH:=db242f8366fc63e8c7588bb2017b354173cf3c4b20abc18780debdc48b14d3ef +PKG_HASH:=1930aa10d892db8531d1353d15f7ebf5913e74a19e134423e4d074c07f2d6e8b PKG_MAINTAINER:=Marko Ratkaj PKG_LICENSE:=LGPL-2.1-or-later BSD-2-Clause GPL-2.0 - -PKG_FIXUP:=autoreconf -PKG_INSTALL:=1 -PKG_BUILD_PARALLEL:=1 -PKG_USE_MIPS16:=0 +PKG_LICENSE_FILES:=COPYING LICENSE.GPL2 LICENSE.LGPL2.1 +PKG_CPE_ID:=cpe:/a:linuxcontainers:lxc +PKG_BUILD_FLAGS:=no-mips16 include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/meson.mk + +MESON_ARGS += \ + -Db_lto=$(if $(findstring mips,$(CONFIG_ARCH)),false,true) \ + -Dwerror=false \ + -Dinit-script=sysvinit \ + -Dman=false \ + -Dapparmor=false \ + -Dselinux=false \ + -Dseccomp=$(if $(CONFIG_LXC_SECCOMP),true,false) \ + -Dexamples=false \ + -Db_pie=true \ + -Druntime-path=/var/run LXC_APPLETS_BIN += \ attach autostart cgroup copy config console create destroy device \ @@ -61,6 +72,10 @@ define Package/lxc-auto DEPENDS+=+lxc-start +lxc-stop endef +define Package/lxc-auto/postinst +[ -n "$${IPKG_INSTROOT}" ] || [ "$${PKG_UPGRADE}" = 1 ] || /etc/init.d/lxc-auto boot +endef + define Package/lxc-auto/description LXC is the userspace control package for Linux Containers, a lightweight virtual system mechanism sometimes described as "chroot on steroids". @@ -122,7 +137,7 @@ define Package/liblxc SECTION:=libs CATEGORY:=Libraries TITLE:=LXC userspace library - DEPENDS+= +libcap +libpthread +LXC_SECCOMP:libseccomp +libopenssl + DEPENDS+= +libcap +libpthread +LXC_SECCOMP:libseccomp +libopenssl +libdbus endef define Package/lxc-init @@ -131,17 +146,6 @@ define Package/lxc-init DEPENDS+= +liblxc endef -CONFIGURE_ARGS += \ - --disable-werror \ - --disable-rpath \ - --disable-doc \ - --disable-api-docs \ - --disable-apparmor \ - --disable-selinux \ - --$(if $(CONFIG_LXC_SECCOMP),en,dis)able-seccomp \ - --enable-capabilities \ - --disable-examples - ifdef CONFIG_USE_MIPS16 TARGET_CFLAGS += -minterlink-mips16 endif @@ -258,7 +262,6 @@ define GenPlugin $$(eval $$(call BuildPackage,lxc-$(1))) endef - $(eval $(call BuildPackage,lxc)) $(eval $(call BuildPackage,lxc-common)) $(eval $(call BuildPackage,lxc-hooks)) @@ -269,5 +272,5 @@ $(eval $(call BuildPackage,lxc-init)) $(eval $(call BuildPackage,lxc-auto)) $(eval $(call BuildPackage,lxc-unprivileged)) $(foreach u,$(LXC_APPLETS_BIN),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/bin"))) -$(foreach u,$(LXC_APPLETS_LIB),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/lib/lxc"))) -$(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u),,"/usr/bin"))) +$(foreach u,$(LXC_APPLETS_LIB),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/libexec/lxc"))) +$(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u),,"/usr/bin"))) \ No newline at end of file diff --git a/utils/lxc/patches/010-Remove-distro-check.patch b/utils/lxc/patches/010-Remove-distro-check.patch deleted file mode 100644 index 262a947541..0000000000 --- a/utils/lxc/patches/010-Remove-distro-check.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 9f550ca53801b2b9c6c1c7a4d02ad525c704b145 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Thu, 14 May 2020 13:40:53 +0200 -Subject: [PATCH] Remove distro check - -Signed-off-by: Robert Marko ---- ---- a/configure.ac -+++ b/configure.ac -@@ -79,34 +79,6 @@ esac - LT_INIT - AC_SUBST([LIBTOOL_DEPS]) - --# Detect the distribution. This is used for the default configuration and --# for some distro-specific build options. --AC_MSG_CHECKING([host distribution]) --AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, redhatenterpriseserver, oracle, centos, fedora, suse, gentoo, debian, arch, slackware, plamo, paldo, openmandriva, pardus, sparclinux, altlinux.])) --if type lsb_release >/dev/null 2>&1 && test "z$with_distro" = "z"; then -- with_distro=$(lsb_release -is) --fi --if test "z$with_distro" = "z"; then -- AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat") -- AC_CHECK_FILE(/etc/oracle-release,with_distro="oracle") -- AC_CHECK_FILE(/etc/sparclinux-release,with_distro="sparclinux") -- AC_CHECK_FILE(/etc/centos-release,with_distro="centos") -- AC_CHECK_FILE(/etc/fedora-release,with_distro="fedora") -- AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse") -- AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo") -- AC_CHECK_FILE(/etc/debian_version,with_distro="debian") -- AC_CHECK_FILE(/etc/arch-release,with_distro="arch") -- AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware") -- AC_CHECK_FILE(/etc/plamo-version,with_distro="plamo") -- AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware") -- AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="openmandriva") -- AC_CHECK_FILE(/etc/mandriva-release,with_distro="openmandriva") -- AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus") -- AC_CHECK_FILE(/etc/altlinux-release,with_distro="altlinux") -- AC_CHECK_FILE(/etc/pld-release,with_distro="pld") --fi --with_distro=$(echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]') -- - if test "z$with_distro" = "zforsparc"; then - with_distro="sparclinux" - fi diff --git a/utils/lxc/patches/020-lxc-checkconfig.patch b/utils/lxc/patches/020-lxc-checkconfig.patch index 682cf9ac84..145645da80 100644 --- a/utils/lxc/patches/020-lxc-checkconfig.patch +++ b/utils/lxc/patches/020-lxc-checkconfig.patch @@ -1,20 +1,19 @@ --- a/src/lxc/cmd/lxc-checkconfig.in +++ b/src/lxc/cmd/lxc-checkconfig.in -@@ -4,6 +4,17 @@ +@@ -7,6 +7,16 @@ export LANGUAGE=en # Allow environment variables to override config - : ${CONFIG:=/proc/config.gz} - : ${MODNAME:=configs} + : "${CONFIG:=/proc/config.gz}" + : "${MODNAME:=configs}" +: ${ZGREP:=zgrep} +: ${GUNZIP:=gunzip} + +if [ -z $(command -v $ZGREP) ] && ! [ -z $(command -v $GUNZIP) ] && [ -x $(command -v $GUNZIP) ] && [ -f $CONFIG ] && [ "$CONFIG" == "/proc/config.gz" ] ; then ++ CONFIG_NEW="/tmp/config-$(uname -r)" ++ $GUNZIP -c $CONFIG > $CONFIG_NEW ++ CONFIG=$CONFIG_NEW + -+ CONFIG_NEW="/tmp/config-$(uname -r)" -+ $GUNZIP -c $CONFIG > $CONFIG_NEW -+ CONFIG=$CONFIG_NEW -+ -+ GREP=grep ++ GREP=grep +fi - CAT="cat" - + GREP="grep" + \ No newline at end of file diff --git a/utils/lxc/patches/025-remove-unsupported-option.patch b/utils/lxc/patches/025-remove-unsupported-option.patch index 52492c4d3b..b869e13051 100644 --- a/utils/lxc/patches/025-remove-unsupported-option.patch +++ b/utils/lxc/patches/025-remove-unsupported-option.patch @@ -1,13 +1,16 @@ --- a/templates/lxc-download.in +++ b/templates/lxc-download.in -@@ -384,20 +384,7 @@ fi - # Unpack the rootfs - echo "Unpacking the rootfs" +@@ -380,26 +380,10 @@ if tar --version | grep -sq "bsdtar"; th + IS_BSD_TAR="true" + fi -EXCLUDES="" -excludelist=$(relevant_file excludes) -if [ -f "${excludelist}" ]; then - while read -r line; do +- if [ ${IS_BSD_TAR} = "true" ]; then +- line="^${line}" +- fi - EXCLUDES="${EXCLUDES} --exclude=${line}" - done < "${excludelist}" -fi @@ -17,8 +20,12 @@ -# is to use a function wrapper, but the latter can't be used here as the args -# are dynamic. We thus need to ignore the warning brought by shellcheck. -# shellcheck disable=SC2086 --tar --anchored ${EXCLUDES} --numeric-owner -xpJf "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}" -+tar --numeric-owner -xpJf "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}" - - mkdir -p "${LXC_ROOTFS}/dev/pts/" + if [ "${IS_BSD_TAR}" = "true" ]; then +- tar ${EXCLUDES} --numeric-owner -xpJf "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}" ++ tar --numeric-owner -xpJf "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}" + else +- tar --anchored ${EXCLUDES} --numeric-owner --xattrs-include='*' -xpJf "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}" ++ tar --numeric-owner --xattrs-include='*' -xpJf "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}" + fi + mkdir -p "${LXC_ROOTFS}/dev/pts/" \ No newline at end of file From 328bd0fe6bc18b7d66040c6d9b5c80877ec80a24 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 9 Oct 2024 13:42:56 +0800 Subject: [PATCH 04/88] mosdns: bump version --- net/mosdns/Makefile | 7 +-- .../patches/201-compatible-with-go1.20.patch | 50 ------------------- ...for-bad-request-in-ServeHTTP-handler.patch | 6 +-- ...-Fisher-Yates-shuffle-algorithm-to-r.patch | 8 +-- net/mosdns/patches/205-format-logtime.patch | 6 +-- 5 files changed, 8 insertions(+), 69 deletions(-) delete mode 100644 net/mosdns/patches/201-compatible-with-go1.20.patch diff --git a/net/mosdns/Makefile b/net/mosdns/Makefile index d0855f78ae..62d32d1991 100644 --- a/net/mosdns/Makefile +++ b/net/mosdns/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mosdns -PKG_VERSION:=5.3.1 +PKG_VERSION:=5.3.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/IrineSistiana/mosdns/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=7c8c795de794df52fd2b51214826aea9ebde0dcd0da78d8dda9cc5e4ab98cd80 +PKG_HASH:=1d7eeaa735cb48ed2d436797d7f2a82541699f74647cd293ee411a72cdc65f5f PKG_LICENSE:=GPL-3.0 PKG_LICENSE_FILE:=LICENSE @@ -19,12 +19,13 @@ PKG_MAINTAINER:=Tianling Shen PKG_BUILD_DEPENDS:=golang/host PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 +PKG_BUILD_FLAGS:=no-mips16 GO_PKG:=github.com/IrineSistiana/mosdns GO_PKG_LDFLAGS_X:=main.version=v$(PKG_VERSION) include $(INCLUDE_DIR)/package.mk -include ../../lang/golang/golang-package.mk +include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk define Package/mosdns SECTION:=net diff --git a/net/mosdns/patches/201-compatible-with-go1.20.patch b/net/mosdns/patches/201-compatible-with-go1.20.patch deleted file mode 100644 index 8f39741e22..0000000000 --- a/net/mosdns/patches/201-compatible-with-go1.20.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 329ba9ca89d25da58d1b51b8107f164beae816bb Mon Sep 17 00:00:00 2001 -From: sbwml -Date: Tue, 19 Sep 2023 21:15:12 +0800 -Subject: [PATCH 1/5] compatible with go1.20 - ---- - go.mod | 6 ++---- - go.sum | 4 ++-- - 2 files changed, 4 insertions(+), 6 deletions(-) - -diff --git a/go.mod b/go.mod -index 1839776..1b4cc4b 100644 ---- a/go.mod -+++ b/go.mod -@@ -1,8 +1,6 @@ - module github.com/IrineSistiana/mosdns/v5 - --go 1.21 -- --toolchain go1.21.1 -+go 1.20 - - require ( - github.com/IrineSistiana/go-bytes-pool v0.0.0-20230918115058-c72bd9761c57 -@@ -45,7 +43,7 @@ require ( - github.com/magiconair/properties v1.8.7 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect - github.com/mdlayher/netlink v1.7.2 // indirect -- github.com/mdlayher/socket v0.5.0 // indirect -+ github.com/mdlayher/socket v0.4.1 // indirect - github.com/onsi/ginkgo/v2 v2.13.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect -diff --git a/go.sum b/go.sum -index 41a59b2..ad95d6d 100644 ---- a/go.sum -+++ b/go.sum -@@ -173,8 +173,8 @@ github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvls - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= - github.com/mdlayher/netlink v1.7.2 h1:/UtM3ofJap7Vl4QWCPDGXY8d3GIY2UGSDbK+QWmY8/g= - github.com/mdlayher/netlink v1.7.2/go.mod h1:xraEF7uJbxLhc5fpHL4cPe221LI2bdttWlU+ZGLfQSw= --jackfan.us.kg/mdlayher/socket v0.5.0 h1:ilICZmJcQz70vrWVes1MFera4jGiWNocSkykwwoy3XI= --jackfan.us.kg/mdlayher/socket v0.5.0/go.mod h1:WkcBFfvyG8QENs5+hfQPl1X6Jpd2yeLIYgrGFmJiJxI= -+github.com/mdlayher/socket v0.4.1 h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U= -+github.com/mdlayher/socket v0.4.1/go.mod h1:cAqeGjoufqdxWkD7DkpyS+wcefOtmu5OQ8KuoJGIReA= - github.com/miekg/dns v1.1.56 h1:5imZaSeoRNvpM9SzWNhEcP9QliKiz20/dA2QabIGVnE= - github.com/miekg/dns v1.1.56/go.mod h1:cRm6Oo2C8TY9ZS/TqsSrseAcncm74lfK5G+ikN2SWWY= - github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= --- -2.42.0 \ No newline at end of file diff --git a/net/mosdns/patches/203-add-response-for-bad-request-in-ServeHTTP-handler.patch b/net/mosdns/patches/203-add-response-for-bad-request-in-ServeHTTP-handler.patch index bc3078f724..38b7974bfc 100644 --- a/net/mosdns/patches/203-add-response-for-bad-request-in-ServeHTTP-handler.patch +++ b/net/mosdns/patches/203-add-response-for-bad-request-in-ServeHTTP-handler.patch @@ -7,11 +7,9 @@ Subject: [PATCH 3/5] add response for bad request in ServeHTTP handler pkg/server/http_handler.go | 1 + 1 file changed, 1 insertion(+) -diff --git a/pkg/server/http_handler.go b/pkg/server/http_handler.go -index 5a41314..8f33b3f 100644 --- a/pkg/server/http_handler.go +++ b/pkg/server/http_handler.go -@@ -93,6 +93,7 @@ func (h *HttpHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { +@@ -93,6 +93,7 @@ func (h *HttpHandler) ServeHTTP(w http.R if err != nil { h.warnErr(req, "invalid request", err) w.WriteHeader(http.StatusBadRequest) @@ -19,5 +17,3 @@ index 5a41314..8f33b3f 100644 return } --- -2.42.0 \ No newline at end of file diff --git a/net/mosdns/patches/204-black_hole-apply-Fisher-Yates-shuffle-algorithm-to-r.patch b/net/mosdns/patches/204-black_hole-apply-Fisher-Yates-shuffle-algorithm-to-r.patch index 1de1ddba9c..fa18e86c1a 100644 --- a/net/mosdns/patches/204-black_hole-apply-Fisher-Yates-shuffle-algorithm-to-r.patch +++ b/net/mosdns/patches/204-black_hole-apply-Fisher-Yates-shuffle-algorithm-to-r.patch @@ -8,8 +8,6 @@ Subject: [PATCH 4/5] black_hole: apply Fisher-Yates shuffle algorithm to plugin/executable/black_hole/black_hole.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) -diff --git a/plugin/executable/black_hole/black_hole.go b/plugin/executable/black_hole/black_hole.go -index 775253d..f955019 100644 --- a/plugin/executable/black_hole/black_hole.go +++ b/plugin/executable/black_hole/black_hole.go @@ -27,6 +27,8 @@ import ( @@ -21,7 +19,7 @@ index 775253d..f955019 100644 ) const PluginType = "black_hole" -@@ -40,6 +42,7 @@ var _ sequence.Executable = (*BlackHole)(nil) +@@ -40,6 +42,7 @@ var _ sequence.Executable = (*BlackHole) type BlackHole struct { ipv4 []netip.Addr ipv6 []netip.Addr @@ -29,7 +27,7 @@ index 775253d..f955019 100644 } // QuickSetup format: [ipv4|ipv6] ... -@@ -65,9 +68,21 @@ func NewBlackHole(ips []string) (*BlackHole, error) { +@@ -65,9 +68,21 @@ func NewBlackHole(ips []string) (*BlackH return b, nil } @@ -51,5 +49,3 @@ index 775253d..f955019 100644 if r := b.Response(qCtx.Q()); r != nil { qCtx.SetResponse(r) } --- -2.42.0 \ No newline at end of file diff --git a/net/mosdns/patches/205-format-logtime.patch b/net/mosdns/patches/205-format-logtime.patch index 72355b4448..1628ad0419 100644 --- a/net/mosdns/patches/205-format-logtime.patch +++ b/net/mosdns/patches/205-format-logtime.patch @@ -7,8 +7,6 @@ Subject: [PATCH 5/5] format logtime mlog/logger.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) -diff --git a/mlog/logger.go b/mlog/logger.go -index 861f091..1508db0 100644 --- a/mlog/logger.go +++ b/mlog/logger.go @@ -21,9 +21,11 @@ package mlog @@ -24,7 +22,7 @@ index 861f091..1508db0 100644 ) type LogConfig struct { -@@ -64,10 +66,18 @@ func NewLogger(lc LogConfig) (*zap.Logger, error) { +@@ -64,10 +66,18 @@ func NewLogger(lc LogConfig) (*zap.Logge out = stderr } @@ -46,5 +44,3 @@ index 861f091..1508db0 100644 } // L is a global logger. --- -2.42.0 \ No newline at end of file From 1be790cfd9b6f3c8cbb226cbfb89b9e52c07e3d9 Mon Sep 17 00:00:00 2001 From: BROBIRD <7692707+BROBIRD@users.noreply.github.com> Date: Sat, 12 Oct 2024 00:28:11 +0800 Subject: [PATCH 05/88] haveged: Update to 1.9.19 (#862) --- utils/haveged/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/haveged/Makefile b/utils/haveged/Makefile index 05cdc59297..8b10ca8fb3 100644 --- a/utils/haveged/Makefile +++ b/utils/haveged/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=haveged -PKG_VERSION:=1.9.18 +PKG_VERSION:=1.9.19 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/jirka-h/haveged/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=b835fa02b52ee7d06276e028571cadcb14d08f5e5a4b5767adf81451f70561c7 +PKG_HASH:=acbb05776668657012273be9bb3310e3140b79959aa4538e4cca8d30d40c0b8f PKG_BUILD_DIR:=$(BUILD_DIR)/haveged-$(PKG_VERSION) PKG_LICENSE:=GPLv3 From c03cdcb3b900c349bc852ed545a44893e2f626f6 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 18 Oct 2024 11:33:43 +0800 Subject: [PATCH 06/88] v2raya: add package --- net/v2raya/Makefile | 87 +++++++++++ net/v2raya/files/v2raya.config | 44 ++++++ net/v2raya/files/v2raya.init | 75 +++++++++ net/v2raya/test.sh | 3 + net/xray-core/Makefile | 89 +++++++++++ net/xray-core/files/config.json.example | 144 ++++++++++++++++++ net/xray-core/files/vpoint_socks_vmess.json | 25 +++ net/xray-core/files/vpoint_vmess_freedom.json | 31 ++++ net/xray-core/files/xray.conf | 11 ++ net/xray-core/files/xray.init | 58 +++++++ net/xray-core/test.sh | 7 + 11 files changed, 574 insertions(+) create mode 100644 net/v2raya/Makefile create mode 100644 net/v2raya/files/v2raya.config create mode 100755 net/v2raya/files/v2raya.init create mode 100644 net/v2raya/test.sh create mode 100644 net/xray-core/Makefile create mode 100644 net/xray-core/files/config.json.example create mode 100644 net/xray-core/files/vpoint_socks_vmess.json create mode 100644 net/xray-core/files/vpoint_vmess_freedom.json create mode 100644 net/xray-core/files/xray.conf create mode 100755 net/xray-core/files/xray.init create mode 100644 net/xray-core/test.sh diff --git a/net/v2raya/Makefile b/net/v2raya/Makefile new file mode 100644 index 0000000000..ea2e2d26e9 --- /dev/null +++ b/net/v2raya/Makefile @@ -0,0 +1,87 @@ +# SPDX-License-Identifier: GPL-3.0-only +# +# Copyright (C) 2021 ImmortalWrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=v2rayA +PKG_VERSION:=2.2.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/v2rayA/v2rayA/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=2d52b8cc6fbd7264e53704684dd8ee56955852dbff324a45360d6ed1c923d8ba +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/service + +PKG_LICENSE:=AGPL-3.0-only +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Tianling Shen + +PKG_BUILD_DEPENDS:=golang/host +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=no-mips16 + +GO_PKG:=github.com/v2rayA/v2rayA +GO_PKG_LDFLAGS_X:= \ + $(GO_PKG)/conf.Version=$(PKG_VERSION) \ + $(GO_PKG)/core/iptables.TproxyNotSkipBr=true + +include $(INCLUDE_DIR)/package.mk +include ../../lang/golang/golang-package.mk + +TAR_OPTIONS+= --strip-components 1 +TAR_CMD=$(HOST_TAR) -C $(1)/.. $(TAR_OPTIONS) + +define Package/v2raya + TITLE:=A Linux web GUI client of Project V + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + DEPENDS:=$(GO_ARCH_DEPENDS) \ + +ca-bundle \ + +kmod-nft-tproxy \ + +xray-core + URL:=https://v2raya.org +endef + +define Package/v2raya/description + v2rayA is a V2Ray Linux client supporting global transparent proxy, + compatible with SS, SSR, Trojan(trojan-go), PingTunnel protocols. +endef + +define Package/v2raya/conffiles +/etc/v2raya/ +/etc/config/v2raya +endef + +WEB_FILE:=$(PKG_NAME)-web-$(PKG_VERSION).tar.gz +define Download/v2raya-web + URL:=https://github.com/v2rayA/v2rayA/releases/download/v$(PKG_VERSION)/ + URL_FILE:=web.tar.gz + FILE:=$(WEB_FILE) + HASH:=123123d3d6d393c065348355b47db45aa6c6af10c60d6320f564883cd93c556a +endef + +define Build/Prepare + $(call Build/Prepare/Default) + + ( \ + mkdir -p $(PKG_BUILD_DIR)/server/router/web ; \ + gzip -dc $(DL_DIR)/$(WEB_FILE) | $(HOST_TAR) -C $(PKG_BUILD_DIR)/server/router/web $(TAR_OPTIONS) ; \ + ) +endef + +define Package/v2raya/install + $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR)) + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/v2rayA $(1)/usr/bin/v2raya + + $(INSTALL_DIR) $(1)/etc/config/ + $(INSTALL_CONF) $(CURDIR)/files/v2raya.config $(1)/etc/config/v2raya + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) $(CURDIR)/files/v2raya.init $(1)/etc/init.d/v2raya +endef + +$(eval $(call Download,v2raya-web)) +$(eval $(call GoBinPackage,v2raya)) +$(eval $(call BuildPackage,v2raya)) diff --git a/net/v2raya/files/v2raya.config b/net/v2raya/files/v2raya.config new file mode 100644 index 0000000000..66b66b2438 --- /dev/null +++ b/net/v2raya/files/v2raya.config @@ -0,0 +1,44 @@ + +config v2raya 'config' + option enabled '0' + + # Listening address + option address '0.0.0.0:2017' + + # Make sure your IPv6 network works fine before you turn it on. + # Optional values: auto, on, off. + option ipv6_support 'auto' + + # Experimental feature. Make sure you have installed nftables. + # Optional values: auto, on, off. + option nftables_support 'auto' + + # Optional values: trace, debug, info, warn or error + option log_level 'info' + + # Maximum number of days to keep log files + option log_max_days '3' + + option log_disable_color '1' + + option log_disable_timestamp '0' + + # Executable v2ray binary path. Auto-detect if put it empty + option v2ray_bin '' + + # Additional v2ray config directory, files in it will be combined with config generated by v2rayA + option v2ray_confdir '' + + # The executable file to run in the transparent proxy life-cycle. + # v2rayA will pass in the --transparent-type (tproxy, redirect) + # and --stage (pre-start, post-start, pre-stop, post-stop) arguments. + option transparent_hook '' + + # The executable file to run in the v2ray-core life-cycle. + # v2rayA will pass in the --stage (pre-start, post-start, pre-stop, post-stop) argument. + option core_hook '' + + # The executable file to run in the v2ray-core life-cycle. + # v2rayA will pass in the --stage (pre-start, post-start, pre-stop, post-stop) argument. + option plugin_manager '' + diff --git a/net/v2raya/files/v2raya.init b/net/v2raya/files/v2raya.init new file mode 100755 index 0000000000..1e55a187e4 --- /dev/null +++ b/net/v2raya/files/v2raya.init @@ -0,0 +1,75 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2021 Tianling Shen + +USE_PROCD=1 +START=99 + +CONF="v2raya" +PROG="/usr/bin/v2raya" + +is_enabled() { + local enabled + config_get_bool enabled "$1" "$2" "${3:-0}" + if [ "$enabled" -eq "1" ]; then + return 0 + else + return 1 + fi +} + +append_env() { + procd_append_param env "V2RAYA_$(echo "$1" | tr "[a-z]" "[A-Z]")"="$2" +} + +append_env_arg() { + local value + config_get value "$1" "$2" $3 + [ -n "$value" ] && append_env "$2" "$value" +} + +append_env_bool() { + is_enabled "$1" "$2" && append_env "$2" "true" +} + +start_service() { + config_load "$CONF" + + is_enabled "config" "enabled" || return 1 + + procd_open_instance "$CONF" + procd_set_param command "$PROG" + procd_set_param env XDG_DATA_HOME="/usr/share" + + append_env "config" "/etc/v2raya" + append_env "log_file" "/var/log/v2raya/v2raya.log" + + append_env_arg "config" "address" "0.0.0.0:2017" + append_env_arg "config" "ipv6_support" "auto" + append_env_arg "config" "nftables_support" "auto" + append_env_arg "config" "log_level" "info" + append_env_arg "config" "log_max_days" "3" + append_env_arg "config" "v2ray_bin" + append_env_arg "config" "v2ray_confdir" + append_env_arg "config" "transparent_hook" + append_env_arg "config" "core_hook" + append_env_arg "config" "plugin_manager" + append_env_bool "config" "log_disable_color" + append_env_bool "config" "log_disable_timestamp" + + procd_set_param limits core="unlimited" + procd_set_param limits nofile="1000000 1000000" + procd_set_param respawn + procd_set_param stdout 1 + procd_set_param stderr 1 + + procd_close_instance +} + +reload_service() { + stop + start +} + +service_triggers() { + procd_add_reload_trigger "$CONF" +} diff --git a/net/v2raya/test.sh b/net/v2raya/test.sh new file mode 100644 index 0000000000..2c53d5fe14 --- /dev/null +++ b/net/v2raya/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +v2raya --version | grep "$PKG_VERSION" diff --git a/net/xray-core/Makefile b/net/xray-core/Makefile new file mode 100644 index 0000000000..01ee70be2c --- /dev/null +++ b/net/xray-core/Makefile @@ -0,0 +1,89 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=xray-core +PKG_VERSION:=24.9.30 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/XTLS/Xray-core/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=0771120ddbf866fba44f2e8978bcc20f3843663f5726bd8db9e03e1a27e1212a + +PKG_MAINTAINER:=Tianling Shen +PKG_LICENSE:=MPL-2.0 +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DIR:=$(BUILD_DIR)/Xray-core-$(PKG_VERSION) +PKG_BUILD_DEPENDS:=golang/host +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=no-mips16 + +GO_PKG:=github.com/xtls/xray-core +GO_PKG_BUILD_PKG:=github.com/xtls/xray-core/main +GO_PKG_LDFLAGS_X:= \ + $(GO_PKG)/core.build=OpenWrt \ + $(GO_PKG)/core.version=$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../../lang/golang/golang-package.mk + +define Package/xray/template + TITLE:=A platform for building proxies to bypass network restrictions + SECTION:=net + CATEGORY:=Network + URL:=https://xtls.github.io +endef + +define Package/xray-core + $(call Package/xray/template) + DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle +endef + +define Package/xray-example + $(call Package/xray/template) + TITLE+= (example configs) + DEPENDS:=xray-core + PKGARCH:=all +endef + +define Package/xray/description + Xray, Penetrates Everything. It helps you to build your own computer network. + It secures your network connections and thus protects your privacy. +endef + +define Package/xray-core/description + $(call Package/xray/description) +endef + +define Package/xray-example/description + $(call Package/xray/description) + + This includes example configuration files for xray-core. +endef + +define Package/xray-core/conffiles +/etc/xray/ +/etc/config/xray +endef + +define Package/xray-core/install + $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR)) + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/main $(1)/usr/bin/xray + + $(INSTALL_DIR) $(1)/etc/xray/ + $(INSTALL_DATA) $(CURDIR)/files/config.json.example $(1)/etc/xray/ + + $(INSTALL_DIR) $(1)/etc/config/ + $(INSTALL_CONF) $(CURDIR)/files/xray.conf $(1)/etc/config/xray + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) $(CURDIR)/files/xray.init $(1)/etc/init.d/xray +endef + +define Package/xray-example/install + $(INSTALL_DIR) $(1)/etc/xray/ + $(INSTALL_DATA) $(CURDIR)/files/vpoint_socks_vmess.json $(1)/etc/xray/ + $(INSTALL_DATA) $(CURDIR)/files/vpoint_vmess_freedom.json $(1)/etc/xray/ +endef + +$(eval $(call BuildPackage,xray-core)) +$(eval $(call BuildPackage,xray-example)) diff --git a/net/xray-core/files/config.json.example b/net/xray-core/files/config.json.example new file mode 100644 index 0000000000..710bb1bec2 --- /dev/null +++ b/net/xray-core/files/config.json.example @@ -0,0 +1,144 @@ +// Config file of Xray. This file follows standard JSON format, with comments support. +// Uncomment entries below to satisfy your needs. Also read our manual for more detail at +// https://xtls.github.io/en/config/ +{ + "log": { + // By default, Xray writes access log to stdout. + // "access": "/path/to/access/log/file", + + // By default, Xray write error log to stdout. + // "error": "/path/to/error/log/file", + + // Log level, one of "debug", "info", "warning", "error", "none" + "loglevel": "warning" + }, + // List of inbound proxy configurations. + "inbounds": [{ + // Port to listen on. You may need root access if the value is less than 1024. + "port": 1080, + + // IP address to listen on. Change to "0.0.0.0" to listen on all network interfaces. + "listen": "127.0.0.1", + + // Tag of the inbound proxy. May be used for routing. + "tag": "socks-inbound", + + // Protocol name of inbound proxy. + "protocol": "socks", + + // Settings of the protocol. Varies based on protocol. + "settings": { + "auth": "noauth", + "udp": false, + "ip": "127.0.0.1" + }, + + // Enable sniffing on TCP connection. + "sniffing": { + "enabled": true, + // Target domain will be overriden to the one carried by the connection, if the connection is HTTP or HTTPS. + "destOverride": ["http", "tls"] + } + }], + // List of outbound proxy configurations. + "outbounds": [{ + // Protocol name of the outbound proxy. + "protocol": "freedom", + + // Settings of the protocol. Varies based on protocol. + "settings": {}, + + // Tag of the outbound. May be used for routing. + "tag": "direct" + },{ + "protocol": "blackhole", + "settings": {}, + "tag": "blocked" + }], + + // Transport is for global transport settings. If you have multiple transports with same settings + // (say mKCP), you may put it here, instead of in each individual inbound/outbounds. + //"transport": {}, + + // Routing controls how traffic from inbounds are sent to outbounds. + "routing": { + "domainStrategy": "IPOnDemand", + "rules":[ + { + // Blocks access to private IPs. Remove this if you want to access your router. + "type": "field", + "ip": ["geoip:private"], + "outboundTag": "blocked" + }, + { + // Blocks major ads. + "type": "field", + "domain": ["geosite:category-ads"], + "outboundTag": "blocked" + } + ] + }, + + // Dns settings for domain resolution. + "dns": { + // Static hosts, similar to hosts file. + "hosts": { + // Match v2ray.com to another domain on CloudFlare. This domain will be used when querying IPs for v2ray.com. + "domain:v2ray.com": "www.vicemc.net", + + // The following settings help to eliminate DNS poisoning in mainland China. + // It is safe to comment these out if this is not the case for you. + "domain:github.io": "pages.github.com", + "domain:wikipedia.org": "www.wikimedia.org", + "domain:shadowsocks.org": "electronicsrealm.com" + }, + "servers": [ + "1.1.1.1", + { + "address": "114.114.114.114", + "port": 53, + // List of domains that use this DNS first. + "domains": [ + "geosite:cn" + ] + }, + "8.8.8.8", + "localhost" + ] + }, + + // Policy controls some internal behavior of how Xray handles connections. + // It may be on connection level by user levels in 'levels', or global settings in 'system.' + "policy": { + // Connection policys by user levels + "levels": { + "0": { + "uplinkOnly": 0, + "downlinkOnly": 0 + } + }, + "system": { + "statsInboundUplink": false, + "statsInboundDownlink": false, + "statsOutboundUplink": false, + "statsOutboundDownlink": false + } + }, + + // Stats enables internal stats counter. + // This setting can be used together with Policy and Api. + //"stats":{}, + + // Api enables gRPC APIs for external programs to communicate with Xray instance. + //"api": { + //"tag": "api", + //"services": [ + // "HandlerService", + // "LoggerService", + // "StatsService" + //] + //}, + + // You may add other entries to the configuration, but they will not be recognized by Xray. + "other": {} +} diff --git a/net/xray-core/files/vpoint_socks_vmess.json b/net/xray-core/files/vpoint_socks_vmess.json new file mode 100644 index 0000000000..789cd270af --- /dev/null +++ b/net/xray-core/files/vpoint_socks_vmess.json @@ -0,0 +1,25 @@ +{ + "log": { + "loglevel": "warning" + }, + "inbounds": [{ + "port": 1080, + "listen": "127.0.0.1", + "protocol": "socks", + "settings": { + "auth": "noauth", + "udp": false, + "ip": "127.0.0.1" + } + }], + "outbounds": [{ + "protocol": "freedom", + "settings": {}, + "tag": "direct" + }], + "policy": { + "levels": { + "0": {"uplinkOnly": 0} + } + } +} diff --git a/net/xray-core/files/vpoint_vmess_freedom.json b/net/xray-core/files/vpoint_vmess_freedom.json new file mode 100644 index 0000000000..41c7e30fa6 --- /dev/null +++ b/net/xray-core/files/vpoint_vmess_freedom.json @@ -0,0 +1,31 @@ +{ + "inbounds": [{ + "port": 10086, + "protocol": "vmess", + "settings": { + "clients": [ + { + "id": "23ad6b10-8d1a-40f7-8ad0-e3e35cd38297", + "level": 1 + } + ] + } + }], + "outbounds": [{ + "protocol": "freedom", + "settings": {} + },{ + "protocol": "blackhole", + "settings": {}, + "tag": "blocked" + }], + "routing": { + "rules": [ + { + "type": "field", + "ip": ["geoip:private"], + "outboundTag": "blocked" + } + ] + } +} diff --git a/net/xray-core/files/xray.conf b/net/xray-core/files/xray.conf new file mode 100644 index 0000000000..362fbac06d --- /dev/null +++ b/net/xray-core/files/xray.conf @@ -0,0 +1,11 @@ + +config xray 'enabled' + option enabled '0' + +config xray 'config' + option confdir '/etc/xray' + list conffiles '/etc/xray/config.json' + option datadir '/usr/share/v2ray' + option dialer '' + option format 'json' + diff --git a/net/xray-core/files/xray.init b/net/xray-core/files/xray.init new file mode 100755 index 0000000000..7e4b8a7dbd --- /dev/null +++ b/net/xray-core/files/xray.init @@ -0,0 +1,58 @@ +#!/bin/sh /etc/rc.common + +USE_PROCD=1 +START=99 + +CONF="xray" +PROG="/usr/bin/xray" + +start_service() { + config_load "$CONF" + + local enabled + config_get_bool enabled "enabled" "enabled" "0" + [ "$enabled" -eq "1" ] || return 1 + + local confdir + local conffiles + local datadir + local dialer + local format + + config_get confdir "config" "confdir" + config_get conffiles "config" "conffiles" + config_get datadir "config" "datadir" "/usr/share/xray" + config_get dialer "config" "dialer" + config_get format "config" "format" "json" + + procd_open_instance "$CONF" + procd_set_param command "$PROG" run + [ -n "$confdir" ] && procd_append_param command -confdir "$confdir" + [ -n "$conffiles" ] && { + for i in $conffiles + do + procd_append_param command -config "$i" + done + } + [ -n "$format" ] && procd_append_param command -format "$format" + [ -n "$dialer" ] && procd_set_param env XRAY_BROWSER_DIALER="$dialer" + procd_set_param env XRAY_LOCATION_ASSET="$datadir" + procd_set_param file $conffiles + + procd_set_param limits core="unlimited" + procd_set_param limits nofile="1000000 1000000" + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_set_param respawn + + procd_close_instance +} + +reload_service() { + stop + start +} + +service_triggers() { + procd_add_reload_trigger "$CONF" +} diff --git a/net/xray-core/test.sh b/net/xray-core/test.sh new file mode 100644 index 0000000000..8fcce26fe8 --- /dev/null +++ b/net/xray-core/test.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +case "$1" in + "xray-core") + xray version 2>&1 | grep "${2#*v}" + ;; +esac From 07ee39846d77288137052ad3b5087e569d2607d3 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 18 Oct 2024 11:40:15 +0800 Subject: [PATCH 07/88] sing-box: add package --- net/sing-box/Makefile | 143 ++++++++++++++++++++++++++++++++++++++++++ net/tcping/Makefile | 46 ++++++++++++++ 2 files changed, 189 insertions(+) create mode 100644 net/sing-box/Makefile create mode 100644 net/tcping/Makefile diff --git a/net/sing-box/Makefile b/net/sing-box/Makefile new file mode 100644 index 0000000000..d921c889c0 --- /dev/null +++ b/net/sing-box/Makefile @@ -0,0 +1,143 @@ +# +# This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=sing-box +PKG_VERSION:=1.10.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/SagerNet/sing-box/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=7ec6bfe18522f34c0c53aad7b2de2e1967f66c4091baf5674acecd78f0b81aac + +PKG_LICENSE:=GPL-3.0-or-later +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=golang/host +PKG_BUILD_PARALLEL:=1 +PKG_USE_MIPS16:=0 +PKG_BUILD_FLAGS:=no-mips16 + +GO_PKG:=github.com/sagernet/sing-box +GO_PKG_BUILD_PKG:=$(GO_PKG)/cmd/sing-box +GO_PKG_LDFLAGS_X:=$(GO_PKG)/constant.Version=v$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk + +define Package/$(PKG_NAME) + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + TITLE:=The universal proxy platform. + URL:=https://sing-box.sagernet.org + DEPENDS:=$(GO_ARCH_DEPENDS) \ + +ca-bundle \ + +kmod-inet-diag \ + +kmod-netlink-diag \ + +kmod-tun +endef + +define Package/$(PKG_NAME)/description + Sing-box is a universal proxy platform which supports hysteria, SOCKS, + Shadowsocks, ShadowTLS, Tor, trojan, VLess, VMess, WireGuard and so on. +endef + +GO_PKG_TARGET_VARS:=$(filter-out CGO_ENABLED=%,$(GO_PKG_TARGET_VARS)) CGO_ENABLED=1 + +define Package/$(PKG_NAME)/config + menu "Customizing build tags" + depends on PACKAGE_sing-box + + config SING_BOX_WITH_ACME + bool "Build with ACME TLS certificate issuer support" + default n + + config SING_BOX_WITH_CLASH_API + bool "Build with Clash API support (EXPERIMENTAL!!!)" + default y + + config SING_BOX_WITH_DHCP + bool "Build with DHCP support" + default y + + config SING_BOX_WITH_ECH + bool "Build with TLS ECH extension support" + default y + + config SING_BOX_WITH_GRPC + bool "Build with standard gRPC support" + default n + help + sing-box has better performance gun-lite gRPC built-in by default. + This standard gRPC has better compatibility but poor performance. + + config SING_BOX_WITH_GVISOR + bool "Build with gVisor support" + default y + + config SING_BOX_WITH_QUIC + bool "Build with QUIC support" + default y + help + Required by HTTP3 DNS transports, Naive inbound, + Hysteria inbound / outbound, and v2ray QUIC transport. + + config SING_BOX_WITH_REALITY_SERVER + bool "Build with reality TLS server support" + default n + + config SING_BOX_WITH_UTLS + bool "Build with uTLS support" + default y + + config SING_BOX_WITH_V2RAY_API + bool "Build with V2Ray API support (EXPERIMENTAL!!!)" + default n + + config SING_BOX_WITH_WIREGUARD + bool "Build with WireGuard support" + default y + + endmenu +endef + +PKG_CONFIG_DEPENDS:= \ + CONFIG_SING_BOX_WITH_ACME \ + CONFIG_SING_BOX_WITH_CLASH_API \ + CONFIG_SING_BOX_WITH_DHCP \ + CONFIG_SING_BOX_WITH_ECH \ + CONFIG_SING_BOX_WITH_GRPC \ + CONFIG_SING_BOX_WITH_GVISOR \ + CONFIG_SING_BOX_WITH_QUIC \ + CONFIG_SING_BOX_WITH_REALITY_SERVER \ + CONFIG_SING_BOX_WITH_UTLS \ + CONFIG_SING_BOX_WITH_V2RAY_API \ + CONFIG_SING_BOX_WITH_WIREGUARD + +GO_PKG_TAGS:=$(subst $(space),$(comma),$(strip \ + $(if $(CONFIG_SING_BOX_WITH_ACME),with_acme) \ + $(if $(CONFIG_SING_BOX_WITH_CLASH_API),with_clash_api) \ + $(if $(CONFIG_SING_BOX_WITH_DHCP),with_dhcp) \ + $(if $(CONFIG_SING_BOX_WITH_ECH),with_ech) \ + $(if $(CONFIG_SING_BOX_WITH_GRPC),with_grpc) \ + $(if $(CONFIG_SING_BOX_WITH_GVISOR),with_gvisor) \ + $(if $(CONFIG_SING_BOX_WITH_QUIC),with_quic) \ + $(if $(CONFIG_SING_BOX_WITH_REALITY_SERVER),with_reality_server) \ + $(if $(CONFIG_SING_BOX_WITH_UTLS),with_utls) \ + $(if $(CONFIG_SING_BOX_WITH_V2RAY_API),with_v2ray_api) \ + $(if $(CONFIG_SING_BOX_WITH_WIREGUARD),with_wireguard) \ +)) + +define Package/$(PKG_NAME)/conffiles +endef + +define Package/$(PKG_NAME)/install + $(call GoPackage/Package/Install/Bin,$(1)) +endef + +$(eval $(call GoBinPackage,sing-box)) +$(eval $(call BuildPackage,sing-box)) diff --git a/net/tcping/Makefile b/net/tcping/Makefile new file mode 100644 index 0000000000..9d69985d61 --- /dev/null +++ b/net/tcping/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2014 OpenWrt-dist +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + + +PKG_NAME:=tcping +PKG_VERSION:=0.3 +PKG_RELEASE:=1 + +PKG_LICENSE:=GPL-2.0-only +PKG_LICENSE_FILES:=license.txt + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/Lienol/tcping +PKG_MIRROR_HASH:=79414cd8e1d124422a36b8fe36a1f296b7d9bde99807b2c90ad81bbd65e200e0 +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=db9101834732dac9aaa59dbb7fb9c74612dbf723 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/tcping + SECTION:=net + CATEGORY:=Network + TITLE:=tcping measures the latency of a tcp-connection + URL:=https://github.com/jlyo/tcping +endef + +define Package/tcping/description +endef + +define Package/tcping/conffiles +endef + +define Package/tcping/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tcping $(1)/usr/sbin +endef + +$(eval $(call BuildPackage,tcping)) From 5e161cbd025ca84ffff895d9e620fa555e575c1a Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 18 Oct 2024 11:49:34 +0800 Subject: [PATCH 08/88] dns2tcp: add package --- net/chinadns-ng/Makefile | 82 ++++++++++++++++++++++++++ net/chinadns-ng/update.sh | 27 +++++++++ net/dns2socks/Makefile | 53 +++++++++++++++++ net/dns2tcp/Makefile | 42 +++++++++++++ net/microsocks/Makefile | 47 +++++++++++++++ net/microsocks/files/microsocks.config | 14 +++++ net/microsocks/files/microsocks.init | 74 +++++++++++++++++++++++ 7 files changed, 339 insertions(+) create mode 100644 net/chinadns-ng/Makefile create mode 100644 net/chinadns-ng/update.sh create mode 100644 net/dns2socks/Makefile create mode 100644 net/dns2tcp/Makefile create mode 100644 net/microsocks/Makefile create mode 100644 net/microsocks/files/microsocks.config create mode 100755 net/microsocks/files/microsocks.init diff --git a/net/chinadns-ng/Makefile b/net/chinadns-ng/Makefile new file mode 100644 index 0000000000..89e76fcb71 --- /dev/null +++ b/net/chinadns-ng/Makefile @@ -0,0 +1,82 @@ +# SPDX-License-Identifier: GPL-3.0-only +# +# Copyright (C) 2023 ImmortalWrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=chinadns-ng +PKG_VERSION:=2024.10.14 +PKG_RELEASE:=1 + +ifeq ($(ARCH),aarch64) + PKG_SOURCE_URL_FILE:=$(PKG_NAME)+wolfssl_noasm@aarch64-linux-musl@generic+v8a@fast+lto + PKG_HASH:=914e8b66805b1804f6688dfcda3b67c7c45e5fc5e05afff4837450f8b67a8372 +else ifeq ($(ARCH),arm) + # Referred to golang/golang-values.mk + ARM_CPU_FEATURES:=$(word 2,$(subst +,$(space),$(call qstrip,$(CONFIG_CPU_TYPE)))) + ifeq ($(ARM_CPU_FEATURES),) + PKG_SOURCE_URL_FILE:=$(PKG_NAME)+wolfssl@arm-linux-musleabi@generic+v5t+soft_float@fast+lto + PKG_HASH:=9adfe309a41f21156cc5597333c42c36bc9e4e42eb1a71d18b92c39aed0340b2 + else ifneq ($(filter $(ARM_CPU_FEATURES),vfp vfpv2),) + PKG_SOURCE_URL_FILE:=$(PKG_NAME)+wolfssl@arm-linux-musleabi@generic+v6+soft_float@fast+lto + PKG_HASH:=4881e4dc20a1a4b21bc0cc3c378da8d8004274929e5900d5246aece230eea4f8 + else + PKG_SOURCE_URL_FILE:=$(PKG_NAME)+wolfssl@arm-linux-musleabihf@generic+v7a@fast+lto + PKG_HASH:=5a47e56ef6fac90d22eabc766ffb817cb15fa3875b03ea2a4cd8a684b25b401a + endif +else ifeq ($(ARCH),i386) + ifneq ($(CONFIG_TARGET_x86_geode)$(CONFIG_TARGET_x86_legacy),) + PKG_SOURCE_URL_FILE:=$(PKG_NAME)+wolfssl@i386-linux-musl@i686@fast+lto + PKG_HASH:=f29853387f51bdb4a993504a31933ece538f99365f3f3b46794caa75a3b653ba + else + PKG_SOURCE_URL_FILE:=$(PKG_NAME)+wolfssl@i386-linux-musl@pentium4@fast+lto + PKG_HASH:=279415d9fab1e49bb4bf819270da0d57a9dcdc078cbd4b725b0b7cf3c52d2aba + endif +else ifeq ($(ARCH),mips) + PKG_SOURCE_URL_FILE:=$(PKG_NAME)+wolfssl@mips-linux-musl@mips32+soft_float@fast+lto + PKG_HASH:=b57f9ba76ff4a7c52d1cfbe75de47f6f0e8a1bf8f2a293a39c10b5d94c99cc0f +else ifeq ($(ARCH),mipsel) + ifeq ($(CONFIG_HAS_FPU),) + PKG_SOURCE_URL_FILE:=$(PKG_NAME)+wolfssl@mipsel-linux-musl@mips32+soft_float@fast+lto + PKG_HASH:=f0ca46e7ca83711ae24a6c0d7c71400d994dc7289cae599412fd8e654b198f3e + else + PKG_SOURCE_URL_FILE:=$(PKG_NAME)+wolfssl@mipsel-linux-musl@mips32@fast+lto + PKG_HASH:=48eecd536e1f4cb7d3fa44cdc23d996acfbc75004d8e16b405a7ee148523696e + endif +else ifeq ($(ARCH),x86_64) + PKG_SOURCE_URL_FILE:=$(PKG_NAME)+wolfssl@x86_64-linux-musl@x86_64@fast+lto + PKG_HASH:=6928e28f1c6c41099b6ce8ab1ce38a98cc9da75ff9533f8644f67be455463d0e +else + PKG_SOURCE_URL_FILE:=dummy + PKG_HASH:=dummy +endif + +PKG_SOURCE:=$(subst $(PKG_NAME),$(PKG_NAME)-$(PKG_VERSION),$(PKG_SOURCE_URL_FILE)) +PKG_SOURCE_URL:=https://github.com/zfl9/chinadns-ng/releases/download/$(PKG_VERSION)/ + +PKG_LICENSE:=AGPL-3.0-only +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Tianling Shen + +include $(INCLUDE_DIR)/package.mk + +PKG_UNPACK:=: + +define Package/chinadns-ng + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE:=ChinaDNS next generation, refactoring with epoll and ipset. + URL:=https://github.com/zfl9/chinadns-ng + DEPENDS:=@(aarch64||arm||i386||mips||mipsel||x86_64) +endef + +define Build/Compile +endef + +define Package/chinadns-ng/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(DL_DIR)/$(PKG_SOURCE) $(1)/usr/bin/chinadns-ng +endef + +$(eval $(call BuildPackage,chinadns-ng)) diff --git a/net/chinadns-ng/update.sh b/net/chinadns-ng/update.sh new file mode 100644 index 0000000000..85c99d71d7 --- /dev/null +++ b/net/chinadns-ng/update.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -x + +function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; } + +export CURDIR="$(cd "$(dirname $0)"; pwd)" + +TAG_INFO="$(curl -H "Authorization: $GITHUB_TOKEN" -sL "https://api.github.com/repos/zfl9/chinadns-ng/releases/latest")" +[ -n "$TAG_INFO" ] || exit 1 + +VERSION="$(jq -r ".tag_name" <<< "$TAG_INFO")" +PKG_VERSION="$(awk -F "PKG_VERSION:=" '{print $2}' "$CURDIR/Makefile" | xargs)" +[ "$PKG_VERSION" != "$VERSION" ] || exit 0 + +for i in $(jq -r '.assets[].browser_download_url | select(contains("chinadns-ng%2B"))' <<< "$TAG_INFO"); do + i="$(urldecode "$i")" + + arch="$(awk -F '@' '{printf "%s@%s", $2, $3}' <<< "$i")" + line="$(sed -n "/PKG_SOURCE_URL_FILE:=.*$arch@/=" "$CURDIR/Makefile")" + [ -n "$line" ] || continue + + sha256="$(curl -fsSL "$i" | sha256sum | awk '{print $1}')" || exit 1 + sed -i "$((line + 1))s/PKG_HASH:=.*/PKG_HASH:=$sha256/" "$CURDIR/Makefile" +done + +sed -i "s,PKG_VERSION:=.*,PKG_VERSION:=$VERSION,g" "$CURDIR/Makefile" diff --git a/net/dns2socks/Makefile b/net/dns2socks/Makefile new file mode 100644 index 0000000000..2030c8ac2e --- /dev/null +++ b/net/dns2socks/Makefile @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: GPL-3.0-only +# +# Copyright (C) 2021 ImmortalWrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=dns2socks +PKG_VERSION:=2.1 +PKG_RELEASE:=2 + +PKG_SOURCE:=SourceCode.zip +PKG_SOURCE_URL:=@SF/dns2socks +PKG_SOURCE_DATE:=2020-02-18 +PKG_HASH:=406b5003523577d39da66767adfe54f7af9b701374363729386f32f6a3a995f4 + +PKG_MAINTAINER:=ghostmaker +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +include $(INCLUDE_DIR)/package.mk + +UNZIP_CMD:=unzip -q -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE) + +define Package/dns2socks + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE:=DNS to SOCKS or HTTP proxy + URL:=http://dns2socks.sourceforge.net/ + DEPENDS:=+libpthread +endef + +define Package/dns2socks/description + This is a command line utility to resolve DNS requests via + a SOCKS tunnel like Tor or a HTTP proxy. +endef + +define Build/Compile + $(TARGET_CC) \ + $(TARGET_CFLAGS) \ + $(TARGET_CPPFLAGS) \ + $(FPIC) \ + -o $(PKG_BUILD_DIR)/DNS2SOCKS/dns2socks \ + $(PKG_BUILD_DIR)/DNS2SOCKS/DNS2SOCKS.c \ + $(TARGET_LDFLAGS) -pthread +endef + +define Package/dns2socks/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/DNS2SOCKS/dns2socks $(1)/usr/bin/dns2socks +endef + +$(eval $(call BuildPackage,dns2socks)) diff --git a/net/dns2tcp/Makefile b/net/dns2tcp/Makefile new file mode 100644 index 0000000000..7c793de0b9 --- /dev/null +++ b/net/dns2tcp/Makefile @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: GPL-3.0-only +# +# Copyright (C) 2022 ImmortalWrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=dns2tcp +PKG_VERSION:=1.1.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/zfl9/dns2tcp/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=5e8c6302a1d32c16ae7d4b8e39cd9aad1f2d7e68fe18813e76cb1e48ec5940d2 + +PKG_MAINTAINER:=Tianling Shen +PKG_LICENSE:=AGPL-3.0-only +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=no-mips16 gc-sections lto + +include $(INCLUDE_DIR)/package.mk + +define Package/dns2tcp + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE:=utility to convert dns query from udp to tcp + URL:=https://github.com/zfl9/dns2tcp +endef + +TARGET_CFLAGS+= $(FPIC) +MAKE_FLAGS+= \ + CFLAGS="-std=c99 $(TARGET_CFLAGS)" \ + EVCFLAGS="$(TARGET_CFLAGS)" + +define Package/dns2tcp/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dns2tcp $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,dns2tcp)) diff --git a/net/microsocks/Makefile b/net/microsocks/Makefile new file mode 100644 index 0000000000..79eea2e6af --- /dev/null +++ b/net/microsocks/Makefile @@ -0,0 +1,47 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=microsocks +PKG_VERSION:=1.0.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/rofl0r/microsocks/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=130127a87f55870f18fbe47a64d9b9533020e2900802d36a0f6fd2b074313deb + +PKG_MAINTAINER:=Mateusz Korniak +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=COPYING + +PKG_BUILD_FLAGS:=lto + +include $(INCLUDE_DIR)/package.mk + +define Package/microsocks + SECTION:=net + SUBMENU:=Web Servers/Proxies + CATEGORY:=Network + TITLE:=SOCKS5 TCP/IP only proxy +endef + +define Package/microsocks/description + Low resource SOCKS5 proxy. + Supports only SOCKS5 protocol and forwarding only TCP/IP connections. +endef + +define Package/microsocks/conffiles +/etc/config/microsocks +endef + +TARGET_LDFLAGS+= -Wl,--gc-sections,--as-needed + +define Package/microsocks/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/microsocks $(1)/usr/bin + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/microsocks.config $(1)/etc/config/microsocks + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/microsocks.init $(1)/etc/init.d/microsocks +endef + +$(eval $(call BuildPackage,microsocks)) diff --git a/net/microsocks/files/microsocks.config b/net/microsocks/files/microsocks.config new file mode 100644 index 0000000000..1993510dbe --- /dev/null +++ b/net/microsocks/files/microsocks.config @@ -0,0 +1,14 @@ + +config microsocks 'config' + option enabled '0' + option bindaddr '' + option listenip '::' + option port '1080' + option user '' + option password '' + # Boolean, must be used together with user/pass + option auth_once '0' + # Boolean, auto setup firewall rule so you can access it from Internet + option internet_access '0' + option quiet '1' + diff --git a/net/microsocks/files/microsocks.init b/net/microsocks/files/microsocks.init new file mode 100755 index 0000000000..364c9d3c64 --- /dev/null +++ b/net/microsocks/files/microsocks.init @@ -0,0 +1,74 @@ +#!/bin/sh /etc/rc.common + +USE_PROCD=1 +START=95 + +CONF="microsocks" + +start_service() { + config_load "$CONF" + + local _enabled + config_get_bool _enabled "config" "enabled" "0" + [ "$_enabled" -eq "1" ] || return 1 + + local _port _listenip _bindaddr + local _user _password + local _auth_once _internet_access + local _quiet + + config_get _port "config" "port" + config_get _listenip "config" "listenip" + config_get _bindaddr "config" "bindaddr" + config_get _user "config" "user" + config_get _password "config" "password" + config_get_bool _auth_once "config" "auth_once" 0 + config_get_bool _internet_access "config" "internet_access" 0 + config_get_bool _quiet "config" "quiet" 0 + + procd_open_instance "$CONF" + procd_set_param command /usr/bin/microsocks + [ -z "$_port" ] || procd_append_param command -p "${_port}" + [ -z "$_listenip" ] || procd_append_param command -i "${_listenip}" + [ -z "$_bindaddr" ] || procd_append_param command -b "${_bindaddr}" + [ -z "$_user" ] || procd_append_param command -u "${_user}" + [ -z "$_password" ] || procd_append_param command -P "${_password}" + [ "$_auth_once" -eq "0" ] || procd_append_param command -1 + [ "$_quiet" -eq "0" ] || procd_append_param command -q + + procd_set_param limits core="unlimited" + procd_set_param limits nofile="1000000 1000000" + procd_set_param respawn + procd_set_param stderr 1 + # TODO: Make it dependable on some verbose/debug config setting? + # procd_set_param stdout 1 + + [ "$_internet_access" -eq "0" ] || { + procd_open_data + json_add_array firewall + json_add_object "" + json_add_string type rule + json_add_string name "Allow-access-microsocks-at-$_port" + json_add_string src "*" + json_add_string dest_port "$_port" + json_add_string proto tcp + json_add_string target ACCEPT + json_close_object + json_close_array + procd_close_data + } + + procd_close_instance +} + +service_started() { + procd_set_config_changed firewall +} + +service_stopped() { + procd_set_config_changed firewall +} + +service_triggers() { + procd_add_reload_trigger "$CONF" +} From 4bdec02759b662bd87411bc10633e37bf9504fdd Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 18 Oct 2024 16:14:51 +0800 Subject: [PATCH 09/88] ddns-go: add package --- net/alist/Makefile | 88 +++++++++++++++++++++++++ net/alist/files/alist.config | 38 +++++++++++ net/alist/files/alist.init | 113 +++++++++++++++++++++++++++++++++ net/alist/test.sh | 3 + net/ddns-go/Makefile | 68 ++++++++++++++++++++ net/ddns-go/files/ddns-go.conf | 8 +++ net/ddns-go/files/ddns-go.init | 47 ++++++++++++++ net/lucky/Makefile | 79 +++++++++++++++++++++++ utils/cpulimit/Makefile | 35 ++++++++++ 9 files changed, 479 insertions(+) create mode 100644 net/alist/Makefile create mode 100644 net/alist/files/alist.config create mode 100644 net/alist/files/alist.init create mode 100644 net/alist/test.sh create mode 100644 net/ddns-go/Makefile create mode 100644 net/ddns-go/files/ddns-go.conf create mode 100644 net/ddns-go/files/ddns-go.init create mode 100644 net/lucky/Makefile create mode 100644 utils/cpulimit/Makefile diff --git a/net/alist/Makefile b/net/alist/Makefile new file mode 100644 index 0000000000..58c7ffc600 --- /dev/null +++ b/net/alist/Makefile @@ -0,0 +1,88 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2023 ImmortalWrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=alist +PKG_VERSION:=3.35.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/alist-org/alist/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=e349a178cd41fff9b668e9d8df9ff1b407b7f6d6fd3dbb2f8a7ca9d0d5ecad55 + +PKG_LICENSE:=AGPL-3.0-only +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Tianling Shen + +PKG_BUILD_DEPENDS:=golang/host +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=no-mips16 + +GO_PKG:=github.com/alist-org/alist/v3 +GO_PKG_LDFLAGS_X:= \ + $(GO_PKG)/internal/conf.Version=$(PKG_VERSION) \ + $(GO_PKG)/internal/conf.WebVersion=$(PKG_VERSION) +ifeq ($(filter aarch64 x86_64, $(ARCH)),) + GO_PKG_EXCLUDES:=drivers/lark +endif + +include $(INCLUDE_DIR)/package.mk +include ../../lang/golang/golang-package.mk + +define Package/alist + SECTION:=net + CATEGORY:=Network + TITLE:=A file list program that supports multiple storage + URL:=https://alist.nn.ci + DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle +fuse-utils +endef + +define Package/alist/description + A file list program that supports multiple storage, and supports + web browsing and webdav, powered by gin and Solidjs. +endef + +define Package/alist/conffiles +/etc/alist/ +/etc/config/alist +endef + +WEB_VERSION:=3.35.0 +WEB_FILE:=$(PKG_NAME)-web-$(WEB_VERSION).tar.gz +define Download/alist-web + URL:=https://github.com/alist-org/alist-web/releases/download/$(WEB_VERSION)/ + URL_FILE:=dist.tar.gz + FILE:=$(WEB_FILE) + HASH:=940608c2b9f64cf585ad4d241545e5f1e59e5f6e54ef8ea2c9c3a29998313fc7 +endef + +define Build/Prepare + $(call Build/Prepare/Default) + + ( \ + mkdir -p $(PKG_BUILD_DIR)/public ; \ + gzip -dc $(DL_DIR)/$(WEB_FILE) | $(HOST_TAR) -C $(PKG_BUILD_DIR)/public $(TAR_OPTIONS) ; \ + ) +endef + +ifneq ($(CONFIG_USE_MUSL),) + TARGET_CFLAGS += -D_LARGEFILE64_SOURCE +endif + +define Package/alist/install + $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR)) + + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/alist $(1)/usr/bin/ + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) $(CURDIR)/files/alist.config $(1)/etc/config/alist + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(CURDIR)/files/alist.init $(1)/etc/init.d/alist +endef + +$(eval $(call Download,alist-web)) +$(eval $(call GoBinPackage,alist)) +$(eval $(call BuildPackage,alist)) diff --git a/net/alist/files/alist.config b/net/alist/files/alist.config new file mode 100644 index 0000000000..519036655e --- /dev/null +++ b/net/alist/files/alist.config @@ -0,0 +1,38 @@ + +config alist 'config' + option enabled '0' + option debug '0' + + # listen + option listen_addr '0.0.0.0' + option listen_http_port '5244' + option listen_https_port '-1' + option listen_force_https '0' + option listen_cert_file '' + option listen_key_file '' + option listen_unix_file '' + option listen_unix_file_perm '' + + # site + option site_url '' + option site_cdn '' + option site_login_expire '48' + option site_max_connections '0' + option site_tls_insecure '0' + + # database + option db_type 'sqlite3' + option db_host '' + option db_port '0' + option db_user '' + option db_pass '' + option db_name '' + option db_table_prefix 'x_' + option db_ssl_mode '' + + # log + option log_enable '1' + option log_max_size '5' + option log_max_backups '1' + option log_max_age '15' + diff --git a/net/alist/files/alist.init b/net/alist/files/alist.init new file mode 100644 index 0000000000..a06e4e165d --- /dev/null +++ b/net/alist/files/alist.init @@ -0,0 +1,113 @@ +#!/bin/sh /etc/rc.common + +USE_PROCD=1 +START=99 + +CONF="alist" +PROG="/usr/bin/alist" +CONF_DIR="/etc/$CONF" +RUN_DIR="/var/run/$CONF" + +uci_json_add_boolean() { + local enabled + config_get_bool enabled "${4:-config}" "$2" "${3:-0}" + json_add_boolean "$1" "$enabled" +} + +uci_json_add_int() { + local value + config_get value "${4:-config}" "$2" "${3:-0}" + json_add_int "$1" "$value" +} + +uci_json_add_string() { + local value + config_get value "${4:-config}" "$2" $3 + json_add_string "$1" "$value" +} + +start_service() { + config_load "$CONF" + + local enabled + config_get_bool enabled "config" "enabled" "0" + [ "$enabled" -eq "1" ] || return 1 + + local jwt_secret + jwt_secret="$(jsonfilter -qi "$CONF_DIR/config.json" -e "@.jwt_secret")" + [ -n "$jwt_secret" ] || jwt_secret="$(tr -cd "a-zA-Z0-9" < "/dev/urandom" | head -c16)" + + mkdir -p "$CONF_DIR" + mkdir -p "$RUN_DIR" + + json_init + json_add_boolean "force" "1" + uci_json_add_string "site_url" "site_url" + uci_json_add_string "cdn" "site_cdn" + json_add_string "jwt_secret" "$jwt_secret" + uci_json_add_int "token_expires_in" "site_login_expire" "48" + json_add_object "database" + uci_json_add_string "type" "db_type" "sqlite3" + uci_json_add_string "host" "db_host" + uci_json_add_int "port" "db_port" + uci_json_add_string "user" "db_user" + uci_json_add_string "password" "db_pass" + uci_json_add_string "name" "db_name" + json_add_string "db_file" "$CONF_DIR/data.db" + uci_json_add_string "table_prefix" "db_table_prefix" "x_" + uci_json_add_string "ssl_mode" "db_ssl_mode" + json_close_object + json_add_object "scheme" + uci_json_add_string "address" "listen_addr" "0.0.0.0" + uci_json_add_int "http_port" "listen_http_port" "5244" + uci_json_add_int "https_port" "listen_https_port" "-1" + uci_json_add_boolean "force_https" "listen_force_https" + uci_json_add_string "cert_file" "listen_cert_file" + uci_json_add_string "key_file" "listen_key_file" + uci_json_add_string "unix_file" "listen_unix_file" + uci_json_add_string "unix_file_perm" "listen_unix_file_perm" + json_close_object + json_add_string "temp_dir" "$RUN_DIR/temp" + json_add_string "bleve_dir" "$CONF_DIR/bleve" + json_add_object "log" + uci_json_add_boolean "enable" "log_enable" "1" + json_add_string "name" "$RUN_DIR/log/alist.log" + uci_json_add_int "max_size" "log_max_size" "5" + uci_json_add_int "max_backups" "log_max_backups" "1" + uci_json_add_int "max_age" "log_max_age" "15" + json_add_boolean "compress" "0" + json_close_object + json_add_int "delayed_start" "0" + uci_json_add_int "max_connections" "site_max_connections" + uci_json_add_boolean "tls_insecure_skip_verify" "site_tls_insecure" + json_dump > "$CONF_DIR/config.json" + + local db_type + config_get db_type "config" "db_type" "sqlite3" + [ "$db_type" != "sqlite3" -o -e "$CONF_DIR/data.db" ] || "$PROG" --data "$CONF_DIR" admin set "password" 2>"/dev/null" + + procd_open_instance + procd_set_param command "$PROG" + procd_append_param command server + procd_append_param command --data "$CONF_DIR" + procd_append_param command --no-prefix + + local debug + config_get_bool debug "config" "debug" "0" + [ "$debug" -eq "0" ] || procd_append_param command --debug + + procd_set_param limits core="unlimited" + procd_set_param limits nofile="1000000 1000000" + procd_set_param respawn + [ "$debug" -eq "0" ] || procd_set_param stderr 1 + + procd_close_instance +} + +stop_service() { + rm -rf "$RUN_DIR" +} + +service_triggers() { + procd_add_reload_trigger "$CONF" +} diff --git a/net/alist/test.sh b/net/alist/test.sh new file mode 100644 index 0000000000..efcb07e4c9 --- /dev/null +++ b/net/alist/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +alist version | grep "$PKG_VERSION" diff --git a/net/ddns-go/Makefile b/net/ddns-go/Makefile new file mode 100644 index 0000000000..5b6e028358 --- /dev/null +++ b/net/ddns-go/Makefile @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2023 ImmortalWrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ddns-go +PKG_VERSION:=6.7.0 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/jeessy2/ddns-go/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=02e850e10fef76fef41102f11fa5c606d77cab876056618d36663e1869496353 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Tianling Shen + +PKG_BUILD_DEPENDS:=golang/host +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=no-mips16 + +GO_PKG:=github.com/jeessy2/ddns-go/v6 +GO_PKG_LDFLAGS_X:=main.version=$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../../lang/golang/golang-package.mk + +define Package/ddns-go + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE:=Simple and easy-to-use Dynamic DNS client + URL:=https://github.com/jeessy2/ddns-go + DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle + USERID:=ddns-go:ddns-go +endef + +define Package/ddns-go/description + A simple and easy-to-use Dynamic DNS client with IPv6 support. + Supported backend: + - Alidns + - Baidu Cloud + - CloudFlare + - DnsPod + - GoDaddy Domains + - Google Domains + - Huawei Cloud + - Porkbun + - Custom callback +endef + +define Package/ddns-go/conffiles +/etc/config/ddns-go +/etc/ddns-go/config.yaml +endef + +define Package/ddns-go/install + $(call GoPackage/Package/Install/Bin,$(1)) + + $(INSTALL_DIR) $(1)/etc/config/ + $(INSTALL_CONF) $(CURDIR)/files/ddns-go.conf $(1)/etc/config/ddns-go + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) $(CURDIR)/files/ddns-go.init $(1)/etc/init.d/ddns-go +endef + +$(eval $(call GoBinPackage,ddns-go)) +$(eval $(call BuildPackage,ddns-go)) diff --git a/net/ddns-go/files/ddns-go.conf b/net/ddns-go/files/ddns-go.conf new file mode 100644 index 0000000000..a6e6bee0eb --- /dev/null +++ b/net/ddns-go/files/ddns-go.conf @@ -0,0 +1,8 @@ + +config ddns-go 'config' + option enabled '0' + option listen '[::]:9876' + option ttl '300' + option noweb '0' + option insecure '0' + diff --git a/net/ddns-go/files/ddns-go.init b/net/ddns-go/files/ddns-go.init new file mode 100644 index 0000000000..8e9bde66a4 --- /dev/null +++ b/net/ddns-go/files/ddns-go.init @@ -0,0 +1,47 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2023 ImmortalWrt.org + +START=99 +USE_PROCD=1 + +CONF="ddns-go" +YAML="/etc/$CONF/config.yaml" +PROG="/usr/bin/$CONF" + +start_service() { + config_load "$CONF" + + local enabled + config_get_bool enabled "config" "enabled" "0" + [ "$enabled" -eq "1" ] || return 1 + + local listen ttl dns noweb insecure + config_get listen "config" "listen" "[::]:9876" + config_get ttl "config" "ttl" "300" + config_get dns "config" "dns" + config_get_bool noweb "config" "noweb" "0" + config_get_bool insecure "config" "insecure" "0" + + [ -d "${YAML%/*}" ] || mkdir -p "${YAML%/*}" + touch "$YAML" + chown ddns-go "$YAML" + + procd_open_instance "$CONF" + procd_set_param command "$PROG" + procd_append_param command -c "$YAML" + procd_append_param command -l "$listen" + procd_append_param command -f "$ttl" + [ -z "$dns" ] || procd_append_param command -dns "$dns" + [ "$noweb" -eq "0" ] || procd_append_param command -noweb + [ "$insecure" -eq "0" ] || procd_append_param command -skipVerify + + procd_set_param respawn + procd_set_param stderr 1 + procd_set_param user ddns-go + + procd_close_instance +} + +service_triggers() { + procd_add_reload_trigger "$CONF" +} diff --git a/net/lucky/Makefile b/net/lucky/Makefile new file mode 100644 index 0000000000..68898edb88 --- /dev/null +++ b/net/lucky/Makefile @@ -0,0 +1,79 @@ +# SPDX-License-Identifier: GPL-3.0-only +# +# Copyright (C) 2021-2022 sirpdboy +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=lucky +PKG_VERSION:=2.10.8 +PKG_RELEASE:=1 + +ifeq ($(ARCH),mipsel) + LUCKY_ARCH:=mipsle_softfloat +endif +ifeq ($(ARCH),mips) + LUCKY_ARCH:=mips_softfloat +endif +ifeq ($(ARCH),arm) + LUCKY_ARCH:=armv5 +endif +ifeq ($(BOARD),kirkwood) + LUCKY_ARCH:=armv5 +endif +ifeq ($(ARCH),armv7) + LUCKY_ARCH:=armv7 +endif +ifeq ($(ARCH),aarch64) + LUCKY_ARCH:=arm64 +endif +ifeq ($(ARCH),arm64) + LUCKY_ARCH:=arm64 +endif +ifeq ($(ARCH),armv8) + LUCKY_ARCH:=arm64 +endif +ifeq ($(ARCH),i386) + LUCKY_ARCH:=i386 +endif +ifeq ($(ARCH),x86_64) + LUCKY_ARCH:=x86_64 +endif + +PKG_LICENSE:=GPL-3.0-only +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=GDY666 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=3626928d4a45ae606856b834614e45997b5da235 + +include $(INCLUDE_DIR)/package.mk + +define Package/$(PKG_NAME) + SECTION:=net + CATEGORY:=Network + TITLE:=Lucky dynamic domain name ddns-go service, socat,frp + DEPENDS:=@(i386||x86_64||arm||aarch64||mipsel||mips) + URL:=https://github.com/gdy666/lucky +endef + +define Package/$(PKG_NAME)/description + Main functions of Lucky: dynamic domain name ddns-go service, socat,reverse proxy ,wake on lan +endef + +define Build/Prepare + [ ! -f $(PKG_BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION)_Linux_$(LUCKY_ARCH).tar.gz ] && wget https://github.com/gdy666/lucky/releases/download/v$(PKG_VERSION)/$(PKG_NAME)_$(PKG_VERSION)_Linux_$(LUCKY_ARCH).tar.gz -O $(PKG_BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION)_Linux_$(LUCKY_ARCH).tar.gz + tar -xzvf $(PKG_BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION)_Linux_$(LUCKY_ARCH).tar.gz -C $(PKG_BUILD_DIR) +endef + +define Build/Compile +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lucky $(1)/usr/bin/lucky +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/utils/cpulimit/Makefile b/utils/cpulimit/Makefile new file mode 100644 index 0000000000..ae81e249e7 --- /dev/null +++ b/utils/cpulimit/Makefile @@ -0,0 +1,35 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=cpulimit +PKG_VERSION:=0.3.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/denji/cpulimit/tar.gz/$(PKG_VERSION)? +PKG_HASH:=0c61d394407fdd0547b53e6435ecb817d2e3ba914b48aa9f48ccf42c8278d3a6 + +PKG_BUILD_PARALLEL:=1 +PKG_LICENSE_FILES:=LICENSE + +MAKE_PATH:=src + +include $(INCLUDE_DIR)/package.mk + +define Package/cpulimit + SECTION:=utils + CATEGORY:=Utilities + TITLE:=CPU usage limiter + URL:=https://github.com/denji/cpulimit +endef + +define Package/cpulimit/description + Cpulimit is a tool which limits the CPU usage of a process + (expressed in percentage, not in CPU time). +endef + +define Package/cpulimit/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/cpulimit $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,cpulimit)) From 741eb4376c1a78fd27c8a89ac8a0a14da0c527a9 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 19 Oct 2024 18:22:59 +0800 Subject: [PATCH 10/88] rust: update to 1.80.1 --- lang/rust/Makefile | 9 +- .../0001-Update-xz2-and-use-it-static.patch | 4 +- ...dling-of-bootstrap-cache-path-option.patch | 47 -------- .../0003-bump-libc-deps-to-0.2.146.patch | 8 +- ...0004-Use-an-helper-to-move-the-files.patch | 108 ------------------ lang/rust/rust-values.mk | 4 +- 6 files changed, 13 insertions(+), 167 deletions(-) delete mode 100644 lang/rust/patches/0002-correct-the-handling-of-bootstrap-cache-path-option.patch delete mode 100644 lang/rust/patches/0004-Use-an-helper-to-move-the-files.patch diff --git a/lang/rust/Makefile b/lang/rust/Makefile index f33d490458..0afa39ca85 100644 --- a/lang/rust/Makefile +++ b/lang/rust/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rust -PKG_VERSION:=1.78.0 -PKG_RELEASE:=2 +PKG_VERSION:=1.80.1 +PKG_RELEASE:=1 -PKG_SOURCE:=rustc-$(PKG_VERSION)-src.tar.xz +PKG_SOURCE:=rustc-$(PKG_VERSION)-src.tar.gz PKG_SOURCE_URL:=https://static.rust-lang.org/dist/ -PKG_HASH:=8065824f0255faa3901db8206e6f9423f6f8c07cec28bc6f2797c6c948310ece +PKG_HASH:=2c0b8f643942dcb810cbcc50f292564b1b6e44db5d5f45091153996df95d2dc4 HOST_BUILD_DIR:=$(BUILD_DIR)/host/rustc-$(PKG_VERSION)-src PKG_MAINTAINER:=Luca Barbato @@ -19,7 +19,6 @@ PKG_LICENSE_FILES:=LICENSE-APACHE LICENSE-MIT PKG_HOST_ONLY:=1 PKG_BUILD_FLAGS:=no-mips16 -PKG_USE_MIPS16:=0 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk diff --git a/lang/rust/patches/0001-Update-xz2-and-use-it-static.patch b/lang/rust/patches/0001-Update-xz2-and-use-it-static.patch index fe10529bc6..4971f3ff2c 100644 --- a/lang/rust/patches/0001-Update-xz2-and-use-it-static.patch +++ b/lang/rust/patches/0001-Update-xz2-and-use-it-static.patch @@ -9,7 +9,7 @@ Subject: [PATCH] Update xz2 and use it static --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml -@@ -61,7 +61,7 @@ tar = "0.4" +@@ -62,7 +62,7 @@ tar = "0.4" termcolor = "1.4" toml = "0.5" walkdir = "2.4" @@ -17,4 +17,4 @@ Subject: [PATCH] Update xz2 and use it static +xz2 = { version = "0.1", features = ["static"] } # Dependencies needed by the build-metrics feature - sysinfo = { version = "0.30", optional = true } + sysinfo = { version = "0.30", default-features = false, optional = true } diff --git a/lang/rust/patches/0002-correct-the-handling-of-bootstrap-cache-path-option.patch b/lang/rust/patches/0002-correct-the-handling-of-bootstrap-cache-path-option.patch deleted file mode 100644 index 99c8038c4c..0000000000 --- a/lang/rust/patches/0002-correct-the-handling-of-bootstrap-cache-path-option.patch +++ /dev/null @@ -1,47 +0,0 @@ -From bd479113d38aa453cbad9d9f5ca9c5fc8903b0cf Mon Sep 17 00:00:00 2001 -From: onur-ozkan -Date: Thu, 11 Apr 2024 14:57:10 +0300 -Subject: [PATCH] correct the handling of `bootstrap-cache-path` option - -This change makes `build.bootstrap-cache-path` option to be configurable with -`./configure` script, so it can be used like `./configure --bootstrap-cache-path=demo`. - -Signed-off-by: onur-ozkan ---- - config.example.toml | 2 +- - src/bootstrap/configure.py | 4 +++- - 2 files changed, 4 insertions(+), 2 deletions(-) - ---- a/config.example.toml -+++ b/config.example.toml -@@ -302,7 +302,7 @@ - - # Set the bootstrap/download cache path. It is useful when building rust - # repeatedly in a CI invironment. --# bootstrap-cache-path = /shared/cache -+#bootstrap-cache-path = /path/to/shared/cache - - # Enable a build of the extended Rust tool set which is not only the compiler - # but also tools such as Cargo. This will also produce "combined installers" ---- a/src/bootstrap/configure.py -+++ b/src/bootstrap/configure.py -@@ -152,9 +152,9 @@ v("default-linker", "rust.default-linker - # (others are conditionally saved). - o("manage-submodules", "build.submodules", "let the build manage the git submodules") - o("full-bootstrap", "build.full-bootstrap", "build three compilers instead of two (not recommended except for testing reproducible builds)") --o("bootstrap-cache-path", "build.bootstrap-cache-path", "use provided path for the bootstrap cache") - o("extended", "build.extended", "build an extended rust tool set") - -+v("bootstrap-cache-path", None, "use provided path for the bootstrap cache") - v("tools", None, "List of extended tools will be installed") - v("codegen-backends", None, "List of codegen backends to build") - v("build", "build.build", "GNUs ./configure syntax LLVM build triple") -@@ -359,6 +359,8 @@ def apply_args(known_args, option_checki - set('target.{}.llvm-filecheck'.format(build_triple), value, config) - elif option.name == 'tools': - set('build.tools', value.split(','), config) -+ elif option.name == 'bootstrap-cache-path': -+ set('build.bootstrap-cache-path', value, config) - elif option.name == 'codegen-backends': - set('rust.codegen-backends', value.split(','), config) - elif option.name == 'host': diff --git a/lang/rust/patches/0003-bump-libc-deps-to-0.2.146.patch b/lang/rust/patches/0003-bump-libc-deps-to-0.2.146.patch index d2589d8552..06ffb70a31 100644 --- a/lang/rust/patches/0003-bump-libc-deps-to-0.2.146.patch +++ b/lang/rust/patches/0003-bump-libc-deps-to-0.2.146.patch @@ -1,7 +1,7 @@ This patch bumps all libc dependencies and checksums to 0.2.147, which includes the fix for musl 1.2.4. ---- a/vendor/elasticlunr-rs/Cargo.lock -+++ b/vendor/elasticlunr-rs/Cargo.lock +--- a/vendor/elasticlunr-rs-3.0.2/Cargo.lock ++++ b/vendor/elasticlunr-rs-3.0.2/Cargo.lock @@ -555,9 +555,9 @@ checksum = "e2abad23fbc42b3700f2f279844d [[package]] @@ -14,8 +14,8 @@ This patch bumps all libc dependencies and checksums to 0.2.147, which includes [[package]] name = "lindera" ---- a/vendor/libffi/Cargo.lock -+++ b/vendor/libffi/Cargo.lock +--- a/vendor/libffi-3.2.0/Cargo.lock ++++ b/vendor/libffi-3.2.0/Cargo.lock @@ -10,9 +10,9 @@ checksum = "50d30906286121d95be3d479533b [[package]] diff --git a/lang/rust/patches/0004-Use-an-helper-to-move-the-files.patch b/lang/rust/patches/0004-Use-an-helper-to-move-the-files.patch deleted file mode 100644 index 227b79d209..0000000000 --- a/lang/rust/patches/0004-Use-an-helper-to-move-the-files.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 4db00fe229f08b06feeee552ae53af9f49c25048 Mon Sep 17 00:00:00 2001 -From: Luca Barbato -Date: Fri, 10 May 2024 16:38:19 +0200 -Subject: [PATCH] Use an helper to move the files - -In case the source is not in the same filesystem. ---- - src/bootstrap/src/core/build_steps/dist.rs | 6 ++++-- - src/bootstrap/src/core/download.rs | 6 +++--- - src/bootstrap/src/utils/helpers.rs | 15 +++++++++++++++ - src/bootstrap/src/utils/tarball.rs | 4 ++-- - 4 files changed, 24 insertions(+), 7 deletions(-) - ---- a/src/bootstrap/src/core/build_steps/dist.rs -+++ b/src/bootstrap/src/core/build_steps/dist.rs -@@ -26,7 +26,9 @@ use crate::core::build_steps::tool::{sel - use crate::core::builder::{Builder, Kind, RunConfig, ShouldRun, Step}; - use crate::core::config::TargetSelection; - use crate::utils::channel; --use crate::utils::helpers::{exe, is_dylib, output, t, target_supports_cranelift_backend, timeit}; -+use crate::utils::helpers::{ -+ exe, is_dylib, move_file, output, t, target_supports_cranelift_backend, timeit, -+}; - use crate::utils::tarball::{GeneratedTarball, OverlayKind, Tarball}; - use crate::{Compiler, DependencyType, Mode, LLVM_TOOLS}; - -@@ -1993,7 +1995,7 @@ impl Step for Extended { - builder.run(&mut cmd); - - if !builder.config.dry_run() { -- t!(fs::rename(exe.join(&filename), distdir(builder).join(&filename))); -+ t!(move_file(exe.join(&filename), distdir(builder).join(&filename))); - } - } - } ---- a/src/bootstrap/src/core/download.rs -+++ b/src/bootstrap/src/core/download.rs -@@ -12,7 +12,7 @@ use build_helper::ci::CiEnv; - use xz2::bufread::XzDecoder; - - use crate::core::config::RustfmtMetadata; --use crate::utils::helpers::{check_run, exe, program_out_of_date}; -+use crate::utils::helpers::{check_run, exe, move_file, program_out_of_date}; - use crate::{core::build_steps::llvm::detect_llvm_sha, utils::helpers::hex_encode}; - use crate::{t, Config}; - -@@ -209,7 +209,7 @@ impl Config { - None => panic!("no protocol in {url}"), - } - t!( -- std::fs::rename(&tempfile, dest_path), -+ move_file(&tempfile, dest_path), - format!("failed to rename {tempfile:?} to {dest_path:?}") - ); - } -@@ -313,7 +313,7 @@ impl Config { - if src_path.is_dir() && dst_path.exists() { - continue; - } -- t!(fs::rename(src_path, dst_path)); -+ t!(move_file(src_path, dst_path)); - } - let dst_dir = dst.join(directory_prefix); - if dst_dir.exists() { ---- a/src/bootstrap/src/utils/helpers.rs -+++ b/src/bootstrap/src/utils/helpers.rs -@@ -150,6 +150,21 @@ pub fn symlink_dir(config: &Config, orig - } - } - -+/// Rename a file if from and to are in the same filesystem or -+/// copy and remove the file otherwise -+pub fn move_file, Q: AsRef>(from: P, to: Q) -> io::Result<()> { -+ match fs::rename(&from, &to) { -+ // FIXME: Once `ErrorKind::CrossesDevices` is stabilized use -+ // if e.kind() == io::ErrorKind::CrossesDevices { -+ #[cfg(unix)] -+ Err(e) if e.raw_os_error() == Some(libc::EXDEV) => { -+ std::fs::copy(&from, &to)?; -+ std::fs::remove_file(&from) -+ } -+ r => r, -+ } -+} -+ - pub fn forcing_clang_based_tests() -> bool { - if let Some(var) = env::var_os("RUSTBUILD_FORCE_CLANG_BASED_TESTS") { - match &var.to_string_lossy().to_lowercase()[..] { ---- a/src/bootstrap/src/utils/tarball.rs -+++ b/src/bootstrap/src/utils/tarball.rs -@@ -6,7 +6,7 @@ use std::{ - use crate::core::builder::Builder; - use crate::core::{build_steps::dist::distdir, builder::Kind}; - use crate::utils::channel; --use crate::utils::helpers::t; -+use crate::utils::helpers::{move_file, t}; - - #[derive(Copy, Clone)] - pub(crate) enum OverlayKind { -@@ -269,7 +269,7 @@ impl<'a> Tarball<'a> { - // name, not "image". We rename the image directory just before passing - // into rust-installer. - let dest = self.temp_dir.join(self.package_name()); -- t!(std::fs::rename(&self.image_dir, &dest)); -+ t!(move_file(&self.image_dir, &dest)); - - self.run(|this, cmd| { - let distdir = distdir(this.builder); diff --git a/lang/rust/rust-values.mk b/lang/rust/rust-values.mk index 534aaa02a0..d423d0a87f 100644 --- a/lang/rust/rust-values.mk +++ b/lang/rust/rust-values.mk @@ -52,7 +52,9 @@ endif # ARM Logic ifeq ($(ARCH),arm) - ifeq ($(CONFIG_arm_v7),y) + ifeq ($(CONFIG_arm_v6)$(CONFIG_arm_v7),) + RUSTC_TARGET_ARCH:=$(subst arm,armv5te,$(RUSTC_TARGET_ARCH)) + else ifeq ($(CONFIG_arm_v7),y) RUSTC_TARGET_ARCH:=$(subst arm,armv7,$(RUSTC_TARGET_ARCH)) endif From d1705362d3fc614cfbf678e362eb59bec423f9e9 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 19 Oct 2024 18:29:48 +0800 Subject: [PATCH 11/88] minieap: add package --- net/minieap/Makefile | 50 +++++++++++++++++ net/minieap/patches/001-enable-gbconv.patch | 13 +++++ .../002-disable-hdd-serial-query.patch | 12 ++++ .../patches/003-remove-systemctl.patch | 11 ++++ net/sysuh3c/Makefile | 33 +++++++++++ net/sysuh3c/files/sysuh3c.config | 6 ++ net/sysuh3c/files/sysuh3c.defaults | 11 ++++ net/sysuh3c/files/sysuh3c.init | 43 +++++++++++++++ net/sysuh3c/patches/100-gcc-10.patch | 25 +++++++++ utils/phicomm-k3screenctrl/Makefile | 55 +++++++++++++++++++ .../files/k3screenctrl.config | 9 +++ .../files/k3screenctrl.init | 19 +++++++ 12 files changed, 287 insertions(+) create mode 100644 net/minieap/Makefile create mode 100644 net/minieap/patches/001-enable-gbconv.patch create mode 100644 net/minieap/patches/002-disable-hdd-serial-query.patch create mode 100644 net/minieap/patches/003-remove-systemctl.patch create mode 100644 net/sysuh3c/Makefile create mode 100755 net/sysuh3c/files/sysuh3c.config create mode 100755 net/sysuh3c/files/sysuh3c.defaults create mode 100755 net/sysuh3c/files/sysuh3c.init create mode 100644 net/sysuh3c/patches/100-gcc-10.patch create mode 100644 utils/phicomm-k3screenctrl/Makefile create mode 100644 utils/phicomm-k3screenctrl/files/k3screenctrl.config create mode 100644 utils/phicomm-k3screenctrl/files/k3screenctrl.init diff --git a/net/minieap/Makefile b/net/minieap/Makefile new file mode 100644 index 0000000000..230b73a23f --- /dev/null +++ b/net/minieap/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2016 Openwrt.org +# Copyright (C) 2021 ImmortalWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=minieap +PKG_VERSION:=0.93 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/updateing/minieap/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=752cec83f453ab2b44503156e0a84a82c475b9a231f45d407b6b7eb75de60f68 + +PKG_LICENSE:=GPL-3.0 +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/minieap + SECTION:=net + CATEGORY:=Network + SUBMENU:=Campus Network + TITLE:=Extendable 802.1x client + URL:=https://github.com/updateing/minieap +endef + +define Package/minieap/description + Extendable 802.1x client with Ruijie v3 (v4) plugin. +endef + +define Package/minieap/conffiles +/etc/minieap.conf +endef + +define Package/minieap/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/minieap.conf $(1)/etc/minieap.conf + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/sbin/minieap $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,minieap)) diff --git a/net/minieap/patches/001-enable-gbconv.patch b/net/minieap/patches/001-enable-gbconv.patch new file mode 100644 index 0000000000..bc9cd49799 --- /dev/null +++ b/net/minieap/patches/001-enable-gbconv.patch @@ -0,0 +1,13 @@ +--- a/config.mk ++++ b/config.mk +@@ -17,8 +17,8 @@ PLUGIN_MODULES += if_impl_sockraw + # PLUGIN_MODULES += ifaddrs + + ENABLE_DEBUG := false +-ENABLE_ICONV := true +-ENABLE_GBCONV := false ++ENABLE_ICONV := false ++ENABLE_GBCONV := true + STATIC_BUILD := false + + # If your platform has iconv_* integrated into libc, change to false diff --git a/net/minieap/patches/002-disable-hdd-serial-query.patch b/net/minieap/patches/002-disable-hdd-serial-query.patch new file mode 100644 index 0000000000..d4072618d8 --- /dev/null +++ b/net/minieap/patches/002-disable-hdd-serial-query.patch @@ -0,0 +1,12 @@ +--- a/packet_plugin/rjv3/packet_plugin_rjv3_priv.c ++++ b/packet_plugin/rjv3/packet_plugin_rjv3_priv.c +@@ -132,7 +132,8 @@ static void rjv3_set_hdd_serial(uint8_t* serial_buf, char* fake_serial) { + memmove(serial_buf, fake_serial, strnlen(fake_serial, MAX_PROP_LEN)); + return; + } +-#ifdef __linux__ ++ PR_WARN("请使用 --fake-serial 选项手动指定硬盘序列号"); ++#if 0 + FILE* _fp = fopen("/etc/mtab", "r"); + char _line_buf[MAX_LINE_LEN] = {0}; + char* _line_buf_dev, *_line_buf_mountpoint; diff --git a/net/minieap/patches/003-remove-systemctl.patch b/net/minieap/patches/003-remove-systemctl.patch new file mode 100644 index 0000000000..b72027b3e7 --- /dev/null +++ b/net/minieap/patches/003-remove-systemctl.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -87,7 +87,7 @@ install: minieap minieap.1.gz minieap.service + install -m 644 minieap.1.gz $(DESTDIR)$(PREFIX)/share/man/man1/ + install -d $(DESTDIR)$(SYSTEMDDIR)/system/ + install -m 644 minieap.service $(DESTDIR)$(SYSTEMDDIR)/system/ +- -systemctl enable minieap ++ # -systemctl enable minieap + + .PHONY: uninstall + uninstall: diff --git a/net/sysuh3c/Makefile b/net/sysuh3c/Makefile new file mode 100644 index 0000000000..20c45d41ce --- /dev/null +++ b/net/sysuh3c/Makefile @@ -0,0 +1,33 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=sysuh3c +PKG_RELEASE:=2 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/haswelliris/h3c.git +PKG_SOURCE_DATE:=2019-03-01 +PKG_SOURCE_VERSION:=8a3e0b5a9a5d989e7d8b2105d09a394c3663e016 +PKG_MIRROR_HASH:=693fd9f81242edb3459a1298f4c850984e59fb44ef6fb4a40fdfcdd3c14acfdb + +PKG_LICENSE:=GPL-3.0 +PKG_LICENSE_FILES:=LICENSE + +include $(INCLUDE_DIR)/package.mk + +define Package/sysuh3c + SECTION:=net + CATEGORY:=Network + SUBMENU:=Campus Network + TITLE:=H3C client +endef + +define Package/sysuh3c/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/h3c $(1)/usr/sbin/sysuh3c + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/sysuh3c.config $(1)/etc/config/sysuh3c + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/sysuh3c.init $(1)/etc/init.d/sysuh3c +endef + +$(eval $(call BuildPackage,sysuh3c)) diff --git a/net/sysuh3c/files/sysuh3c.config b/net/sysuh3c/files/sysuh3c.config new file mode 100755 index 0000000000..d9fa605944 --- /dev/null +++ b/net/sysuh3c/files/sysuh3c.config @@ -0,0 +1,6 @@ + +config login + option blockstartup '1' + option enable '0' + option method 'xor' + diff --git a/net/sysuh3c/files/sysuh3c.defaults b/net/sysuh3c/files/sysuh3c.defaults new file mode 100755 index 0000000000..1d0d7e003c --- /dev/null +++ b/net/sysuh3c/files/sysuh3c.defaults @@ -0,0 +1,11 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@sysuh3c[-1] + add ucitrack sysuh3c + set ucitrack.@sysuh3c[-1].init=sysuh3c + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +exit 0 diff --git a/net/sysuh3c/files/sysuh3c.init b/net/sysuh3c/files/sysuh3c.init new file mode 100755 index 0000000000..71dbbc9fc4 --- /dev/null +++ b/net/sysuh3c/files/sysuh3c.init @@ -0,0 +1,43 @@ +#!/bin/sh /etc/rc.common +START=70 + +run_h3c() +{ + local enable + config_get_bool enable $1 enable + + if [ "$enable" == 1 ]; then + local username + local password + local method + local ifname + local blockstartup + + config_get username $1 username + config_get password $1 password + config_get method $1 method + config_get ifname $1 ifname + config_get_bool blockstartup $1 blockstartup + + if [ "$blockstartup" == 1 ]; then + while ! sysuh3c -u $username -p $password -i $ifname -m $method ; do + echo sysuh3c: process exited unexpectedly, restarting.. + sleep 1 + done + else + sleep 5 + sysuh3c -u $username -p $password -i $ifname -m $method & + fi + fi +} + +start() +{ + config_load sysuh3c + config_foreach run_h3c login +} + +stop() +{ + killall sysuh3c >/dev/null 2>&1 +} diff --git a/net/sysuh3c/patches/100-gcc-10.patch b/net/sysuh3c/patches/100-gcc-10.patch new file mode 100644 index 0000000000..ae29184137 --- /dev/null +++ b/net/sysuh3c/patches/100-gcc-10.patch @@ -0,0 +1,25 @@ +--- a/h3c.h ++++ b/h3c.h +@@ -120,19 +120,19 @@ + #define MD5_XOR 0 + #define MD5_MD5 1 + +-struct eapol { ++extern struct eapol { + unsigned char version; + unsigned char type; + unsigned short length; + }__attribute__ ((packed)) eapol; + +-struct eap { ++extern struct eap { + unsigned char code; + unsigned char id; + unsigned short length; + }__attribute__ ((packed)) eap; + +-struct packet { ++extern struct packet { + struct ether_header eth_header; + struct eapol eapol_header; + struct eap eap_header; diff --git a/utils/phicomm-k3screenctrl/Makefile b/utils/phicomm-k3screenctrl/Makefile new file mode 100644 index 0000000000..982a67af34 --- /dev/null +++ b/utils/phicomm-k3screenctrl/Makefile @@ -0,0 +1,55 @@ +# SPDX-License-Identifier: GPL-3.0-only +# +# Copyright (C) 2021 ImmortalWrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=phicomm-k3screenctrl +PKG_RELEASE:=2 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/lwz322/k3screenctrl.git +PKG_SOURCE_DATE:=2020-09-18 +PKG_SOURCE_VERSION:=d8896cfad4bdf39f58999f9420807f986300bada +PKG_MIRROR_HASH:=348ddd828c309559a5b4afb34cfea19051b742c8918f22bc3be3e6f161421708 + +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Hamster Tian + +PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS+= -D_GNU_SOURCE + +define Package/phicomm-k3screenctrl + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=@(TARGET_bcm53xx_DEVICE_phicomm-k3||TARGET_bcm53xx_generic_DEVICE_phicomm_k3) \ + +@KERNEL_DEVMEM +@BUSYBOX_CONFIG_ARPING +bc +bash +curl +coreutils +coreutils-od +jq + TITLE:=LCD screen controller on PHICOMM K3 + URL:=https://github.com/lwz322/k3screenctrl.git +endef + +define Package/phicomm-k3screenctrl/description + K3 Screen Controller (k3screenctrl) is a program utilizing + the LCD screen on PHICOMM K3 to display some stats. +endef + +define Package/phicomm-k3screenctrl/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/k3screenctrl $(1)/usr/bin/k3screenctrl + + $(INSTALL_DIR) $(1)/lib/k3screenctrl $(1)/lib/k3screenctrl/oui + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/*.sh $(1)/lib/k3screenctrl/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/lib/k3screenctrl/oui/oui.txt $(1)/lib/k3screenctrl/oui/ + + $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d + $(INSTALL_CONF) $(CURDIR)/files/k3screenctrl.config $(1)/etc/config/k3screenctrl + $(INSTALL_BIN) $(CURDIR)/files/k3screenctrl.init $(1)/etc/init.d/k3screenctrl +endef + +$(eval $(call BuildPackage,phicomm-k3screenctrl)) diff --git a/utils/phicomm-k3screenctrl/files/k3screenctrl.config b/utils/phicomm-k3screenctrl/files/k3screenctrl.config new file mode 100644 index 0000000000..30a23818f9 --- /dev/null +++ b/utils/phicomm-k3screenctrl/files/k3screenctrl.config @@ -0,0 +1,9 @@ + +config general + option screen_time '30' + option refresh_time '2' + option pawd_hide '1' + option psk_hide '1' + option showmore '1' + option city_checkip '0' + option update_time '0' \ No newline at end of file diff --git a/utils/phicomm-k3screenctrl/files/k3screenctrl.init b/utils/phicomm-k3screenctrl/files/k3screenctrl.init new file mode 100644 index 0000000000..4ae1a98d62 --- /dev/null +++ b/utils/phicomm-k3screenctrl/files/k3screenctrl.init @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common + +START=99 +STOP=99 + +SCRIPTS_BASE=/lib/k3screenctrl/ +TEMP_DIR=/tmp/k3screenctrl + +start() { + mkdir -p $TEMP_DIR + mkdir -p $TEMP_DIR/device_speed + m=$(uci get k3screenctrl.@general[0].screen_time) && [ $m -lt 10 ] && m=10 + d=$(uci get k3screenctrl.@general[0].refresh_time) && [ $d -lt 1 ] && d=1 + /usr/bin/k3screenctrl -m $m -d $d & +} + +stop() { + killall k3screenctrl +} \ No newline at end of file From fff92666f3ccedea3d47fbf5c05306b13e7bc9e9 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 19 Oct 2024 18:41:33 +0800 Subject: [PATCH 12/88] daed: add package --- net/dae/Makefile | 131 +++++++++++++++++ net/dae/files/dae.config | 7 + net/dae/files/dae.init | 56 +++++++ net/dae/test.sh | 7 + net/daed/Makefile | 162 +++++++++++++++++++++ net/daed/files/daed.config | 7 + net/daed/files/daed.init | 46 ++++++ net/daed/test.sh | 7 + net/dufs/Makefile | 54 +++++++ net/dufs/files/dufs.config | 40 +++++ net/dufs/files/dufs.init | 106 ++++++++++++++ utils/filebrowser/Makefile | 71 +++++++++ utils/filebrowser/files/filebrowser.config | 7 + utils/filebrowser/files/filebrowser.init | 46 ++++++ 14 files changed, 747 insertions(+) create mode 100644 net/dae/Makefile create mode 100644 net/dae/files/dae.config create mode 100644 net/dae/files/dae.init create mode 100644 net/dae/test.sh create mode 100644 net/daed/Makefile create mode 100644 net/daed/files/daed.config create mode 100644 net/daed/files/daed.init create mode 100644 net/daed/test.sh create mode 100644 net/dufs/Makefile create mode 100644 net/dufs/files/dufs.config create mode 100644 net/dufs/files/dufs.init create mode 100644 utils/filebrowser/Makefile create mode 100644 utils/filebrowser/files/filebrowser.config create mode 100644 utils/filebrowser/files/filebrowser.init diff --git a/net/dae/Makefile b/net/dae/Makefile new file mode 100644 index 0000000000..a69da14cf0 --- /dev/null +++ b/net/dae/Makefile @@ -0,0 +1,131 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2023 ImmortalWrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=dae +PKG_VERSION:=0.6.0 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip +PKG_SOURCE_URL:=https://github.com/daeuniverse/dae/releases/download/v$(PKG_VERSION)/dae-full-src.zip? +PKG_HASH:=e4ab51493f7a65402b468c38647e79cfa669203b5295a616b7f8c1416d8f1bbe + +PKG_LICENSE:=AGPL-3.0-only +PKG_LICENSE_FILE:=LICENSE +PKG_MAINTAINER:=Tianling Shen + +PKG_BUILD_DEPENDS:=golang/host bpf-headers +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=no-mips16 + +GO_PKG:=github.com/daeuniverse/dae +GO_PKG_LDFLAGS_X:= \ + $(GO_PKG)/cmd.Version=$(PKG_VERSION) \ + $(GO_PKG)/common/consts.MaxMatchSetLen_=64 +GO_PKG_TAGS:=trace + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/bpf.mk +include ../../lang/golang/golang-package.mk + +UNZIP_CMD:=unzip -q -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE) + +define Package/dae/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + URL:=https://github.com/daeuniverse/dae +endef + +define Package/dae + $(call Package/dae/Default) + TITLE:=A lightweight and high-performance transparent proxy solution + # You need enable KERNEL_DEBUG_INFO_BTF and KERNEL_BPF_EVENTS + DEPENDS:=$(GO_ARCH_DEPENDS) $(BPF_DEPENDS) \ + +ca-bundle +kmod-sched-core +kmod-sched-bpf +kmod-xdp-sockets-diag \ + +kmod-veth +endef + +define Package/dae-geoip + $(call Package/dae/Default) + TITLE:=geoip for dae + DEPENDS:=+dae +v2ray-geoip + PKGARCH:=all +endef + +define Package/dae-geosite + $(call Package/dae/Default) + TITLE:=geosite for dae + DEPENDS:=+dae +v2ray-geosite + PKGARCH:=all +endef + +define Package/dae/description + dae, means goose, is a lightweight and high-performance transparent + proxy solution. + + In order to improve the traffic diversion performance as much as possible, + dae runs the transparent proxy and traffic diversion suite in the linux + kernel by eBPF. Therefore, we have the opportunity to make the direct + traffic bypass the forwarding by proxy application and achieve true direct + traffic through. Under such a magic trick, there is almost no performance + loss and additional resource consumption for direct traffic. +endef + +define Package/dae/conffiles +/etc/dae/config.dae +/etc/config/dae +endef + +DAE_CFLAGS:= \ + -O2 -Wall -Werror \ + -DMAX_MATCH_SET_LEN=64 \ + -I$(BPF_HEADERS_DIR)/tools/lib \ + -I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/asm/mach-generic + +define Build/Compile + ( \ + export \ + $(GO_GENERAL_BUILD_CONFIG_VARS) \ + $(GO_PKG_BUILD_CONFIG_VARS) \ + $(GO_PKG_BUILD_VARS) \ + BPF_CLANG="$(CLANG)" \ + BPF_STRIP_FLAG="-strip=$(LLVM_STRIP)" \ + BPF_CFLAGS="$(DAE_CFLAGS)" \ + BPF_TARGET="bpfel,bpfeb" \ + BPF_TRACE_TARGET="$(GO_ARCH)" ; \ + go generate $(PKG_BUILD_DIR)/control/control.go ; \ + go generate $(PKG_BUILD_DIR)/trace/trace.go ; \ + $(call GoPackage/Build/Compile) ; \ + ) +endef + +define Package/dae/install + $(call GoPackage/Package/Install/Bin,$(1)) + + $(INSTALL_DIR) $(1)/etc/dae/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/example.dae $(1)/etc/dae/ + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) $(CURDIR)/files/dae.config $(1)/etc/config/dae + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(CURDIR)/files/dae.init $(1)/etc/init.d/dae +endef + +define Package/dae-geoip/install + $(INSTALL_DIR) $(1)/usr/share/dae + $(LN) ../v2ray/geoip.dat $(1)/usr/share/dae/geoip.dat +endef + +define Package/dae-geosite/install + $(INSTALL_DIR) $(1)/usr/share/dae + $(LN) ../v2ray/geosite.dat $(1)/usr/share/dae/geosite.dat +endef + +$(eval $(call GoBinPackage,dae)) +$(eval $(call BuildPackage,dae)) +$(eval $(call BuildPackage,dae-geoip)) +$(eval $(call BuildPackage,dae-geosite)) diff --git a/net/dae/files/dae.config b/net/dae/files/dae.config new file mode 100644 index 0000000000..7575e2f390 --- /dev/null +++ b/net/dae/files/dae.config @@ -0,0 +1,7 @@ + +config dae 'config' + option enabled '0' + option config_file '/etc/dae/config.dae' + option log_maxbackups '1' + option log_maxsize '1' + diff --git a/net/dae/files/dae.init b/net/dae/files/dae.init new file mode 100644 index 0000000000..f1471f3325 --- /dev/null +++ b/net/dae/files/dae.init @@ -0,0 +1,56 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2023 Tianling Shen + +USE_PROCD=1 +START=99 + +extra_command "hot_reload" "Hot-reload service" + +CONF="dae" +PROG="/usr/bin/dae" +LOG_DIR="/var/log/dae" + +start_service() { + config_load "$CONF" + + local enabled + config_get_bool enabled "config" "enabled" "0" + [ "$enabled" -eq "1" ] || return 1 + + local config_file + config_get config_file "config" "config_file" "/etc/dae/config.dae" + + "$PROG" validate -c "$config_file" || return 1 + + local log_maxbackups log_maxsize + config_get log_maxbackups "config" "log_maxbackups" "1" + config_get log_maxsize "config" "log_maxsize" "1" + + procd_open_instance "$CONF" + procd_set_param command "$PROG" run + procd_append_param command --config "$config_file" + procd_append_param command --disable-timestamp + procd_append_param command --logfile "$LOG_DIR/dae.log" + procd_append_param command --logfile-maxbackups "$log_maxbackups" + procd_append_param command --logfile-maxsize "$log_maxsize" + + procd_set_param limits core="unlimited" + procd_set_param limits nofile="1000000 1000000" + procd_set_param respawn + # procd_set_param stdout 1 + procd_set_param stderr 1 + + procd_close_instance +} + +stop_service() { + rm -rf "$LOG_DIR" +} + +service_triggers() { + procd_add_reload_trigger "$CONF" +} + +hot_reload() { + /etc/init.d/dae running && "$PROG" reload "$(cat /var/run/dae.pid)" +} diff --git a/net/dae/test.sh b/net/dae/test.sh new file mode 100644 index 0000000000..3348120bc3 --- /dev/null +++ b/net/dae/test.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +case "$1" in + "dae") + dae --version | grep "$PKG_VERSION" + ;; +esac diff --git a/net/daed/Makefile b/net/daed/Makefile new file mode 100644 index 0000000000..e64b8fe3ed --- /dev/null +++ b/net/daed/Makefile @@ -0,0 +1,162 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2023 ImmortalWrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=daed +PKG_VERSION=0.6.0 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/daeuniverse/daed.git +PKG_SOURCE_VERSION:=v$(PKG_VERSION) +PKG_MIRROR_HASH:=0063975b373c0375bf44c8d28818f861127a97917e4e5ff416b59590ce7cffde + +PKG_LICENSE:=AGPL-3.0-only MIT +PKG_LICENSE_FILES:=LICENSE wing/LICENSE +PKG_MAINTAINER:=Tianling Shen + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/wing +PKG_BUILD_DEPENDS:=golang/host bpf-headers +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=no-mips16 + +GO_PKG:=github.com/daeuniverse/dae-wing +GO_PKG_LDFLAGS:= \ + -X '$(GO_PKG)/db.AppDescription=$(PKG_NAME) is a integration solution of dae, API and UI.' +GO_PKG_LDFLAGS_X= \ + $(GO_PKG)/db.AppName=$(PKG_NAME) \ + $(GO_PKG)/db.AppVersion=$(PKG_VERSION) +GO_PKG_TAGS:=embedallowed,trace + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/bpf.mk +include ../../lang/golang/golang-package.mk + +TAR_CMD=$(HOST_TAR) -C $(BUILD_DIR)/ $(TAR_OPTIONS) + +define Package/daed/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + URL:=https://github.com/daeuniverse/daed +endef + +define Package/daed + $(call Package/daed/Default) + TITLE:=A Modern Dashboard For dae + # You need enable KERNEL_DEBUG_INFO_BTF and KERNEL_BPF_EVENTS + DEPENDS:=$(GO_ARCH_DEPENDS) $(BPF_DEPENDS) \ + +ca-bundle +kmod-sched-core +kmod-sched-bpf +kmod-xdp-sockets-diag \ + +kmod-veth +endef + +define Package/daed-geoip + $(call Package/daed/Default) + TITLE:=geoip for daed + DEPENDS:=+daed +v2ray-geoip + PKGARCH:=all +endef + +define Package/daed-geosite + $(call Package/daed/Default) + TITLE:=geosite for daed + DEPENDS:=+daed +v2ray-geosite + PKGARCH:=all +endef + +define Package/daed/description + daed is a backend of dae, provides a method to bundle arbitrary + frontend, dae and geodata into one binary. +endef + +define Package/daed/conffiles +/etc/daed/wing.db +/etc/config/daed +endef + +WEB_FILE:=$(PKG_NAME)-web-$(PKG_VERSION).zip +define Download/daed-web + URL:=https://github.com/daeuniverse/daed/releases/download/v$(PKG_VERSION) + URL_FILE:=web.zip + FILE:=$(WEB_FILE) + HASH:=f8a5f28643c990408f7b6d324b4cc8b5e7445e6255689a5f10f5545be033c1ad +endef + +define Build/Prepare + $(call Build/Prepare/Default) + + ( \ + mkdir -p $(PKG_BUILD_DIR)/webrender ; \ + unzip -q -d $(PKG_BUILD_DIR)/webrender/ $(DL_DIR)/$(WEB_FILE) ; \ + find $(PKG_BUILD_DIR)/webrender/web -type f -size +4k ! -name "*.gz" ! -name "*.woff" ! -name "*.woff2" -exec sh -c '\ + gzip -9 -k "{}"; \ + if [ "$$$$(stat -c %s "{}")" -lt "$$$$(stat -c %s "{}.gz")" ]; then \ + rm "{}.gz"; \ + else \ + rm "{}"; \ + fi' \ + ";" ; \ + ) +endef + +DAE_CFLAGS:= \ + -O2 -Wall -Werror \ + -DMAX_MATCH_SET_LEN=64 \ + -I$(BPF_HEADERS_DIR)/tools/lib \ + -I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/asm/mach-generic + +ifneq ($(CONFIG_USE_MUSL),) + TARGET_CFLAGS += -D_LARGEFILE64_SOURCE +endif + +define Build/Compile + ( \ + pushd $(PKG_BUILD_DIR) ; \ + export \ + $(GO_GENERAL_BUILD_CONFIG_VARS) \ + $(GO_PKG_BUILD_CONFIG_VARS) \ + $(GO_PKG_BUILD_VARS); \ + go generate ./... ; \ + cd dae-core ; \ + export \ + BPF_CLANG="$(CLANG)" \ + BPF_STRIP_FLAG="-strip=$(LLVM_STRIP)" \ + BPF_CFLAGS="$(DAE_CFLAGS)" \ + BPF_TARGET="bpfel,bpfeb" \ + BPF_TRACE_TARGET="$(GO_ARCH)" ; \ + go generate control/control.go ; \ + go generate trace/trace.go ; \ + popd ; \ + $(call GoPackage/Build/Compile) ; \ + ) +endef + +define Package/daed/install + $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR)) + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dae-wing $(1)/usr/bin/daed + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) $(CURDIR)/files/daed.config $(1)/etc/config/daed + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(CURDIR)/files/daed.init $(1)/etc/init.d/daed +endef + +define Package/daed-geoip/install + $(INSTALL_DIR) $(1)/usr/share/daed + $(LN) ../v2ray/geoip.dat $(1)/usr/share/daed/geoip.dat +endef + +define Package/daed-geosite/install + $(INSTALL_DIR) $(1)/usr/share/daed + $(LN) ../v2ray/geosite.dat $(1)/usr/share/daed/geosite.dat +endef + +$(eval $(call Download,daed-web)) +$(eval $(call GoBinPackage,daed)) +$(eval $(call BuildPackage,daed)) +$(eval $(call BuildPackage,daed-geoip)) +$(eval $(call BuildPackage,daed-geosite)) diff --git a/net/daed/files/daed.config b/net/daed/files/daed.config new file mode 100644 index 0000000000..ff61f36391 --- /dev/null +++ b/net/daed/files/daed.config @@ -0,0 +1,7 @@ + +config daed 'config' + option enabled '0' + option listen_addr '0.0.0.0:2023' + option log_maxbackups '1' + option log_maxsize '5' + diff --git a/net/daed/files/daed.init b/net/daed/files/daed.init new file mode 100644 index 0000000000..baa72884ee --- /dev/null +++ b/net/daed/files/daed.init @@ -0,0 +1,46 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2023 Tianling Shen + +USE_PROCD=1 +START=99 + +CONF="daed" +PROG="/usr/bin/daed" +LOG="/var/log/daed/daed.log" + +start_service() { + config_load "$CONF" + + local enabled + config_get_bool enabled "config" "enabled" "0" + [ "$enabled" -eq "1" ] || return 1 + + local listen_addr log_maxbackups log_maxsize + config_get listen_addr "config" "listen_addr" "0.0.0.0:2023" + config_get log_maxbackups "config" "log_maxbackups" "1" + config_get log_maxsize "config" "log_maxsize" "5" + + procd_open_instance "$CONF" + procd_set_param command "$PROG" run + procd_append_param command --config "/etc/daed/" + procd_append_param command --listen "$listen_addr" + procd_append_param command --logfile "$LOG" + procd_append_param command --logfile-maxbackups "$log_maxbackups" + procd_append_param command --logfile-maxsize "$log_maxsize" + + procd_set_param limits core="unlimited" + procd_set_param limits nofile="1000000 1000000" + procd_set_param respawn + # procd_set_param stdout 1 + procd_set_param stderr 1 + + procd_close_instance +} + +stop_service() { + rm -f "$LOG" +} + +service_triggers() { + procd_add_reload_trigger "$CONF" +} diff --git a/net/daed/test.sh b/net/daed/test.sh new file mode 100644 index 0000000000..891cd5631d --- /dev/null +++ b/net/daed/test.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +case "$1" in + "daed") + daed --version | grep "$PKG_VERSION" + ;; +esac diff --git a/net/dufs/Makefile b/net/dufs/Makefile new file mode 100644 index 0000000000..bcd455714d --- /dev/null +++ b/net/dufs/Makefile @@ -0,0 +1,54 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2024 ImmortalWrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=dufs +PKG_VERSION:=0.42.0 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/sigoden/dufs/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=76439a01c142d6a378912930de4b74821aa2fef54ccfb7dbb00d6ea3b1a0ab4c + +PKG_MAINTAINER:=Tianling Shen +PKG_LICENSE:=Apache-2.0 MIT +PKG_LICENSE_FILES:=LICENSE-APACHE LICENSE-MIT + +PKG_BUILD_DEPENDS:=rust/host +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk +include ../../lang/rust/rust-package.mk + +define Package/dufs + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + TITLE:=A distinctive utility file server + URL:=https://github.com/sigoden/dufs + DEPENDS:=$(RUST_ARCH_DEPENDS) @!(i386||mips64) +liblzma +endef + +define Package/dufs/description + Dufs is a distinctive utility file server that supports static + serving, uploading, searching, accessing control, webdav... +endef + +define Package/dufs/conffiles +/etc/config/dufs +endef + +define Package/dufs/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/dufs $(1)/usr/bin/ + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) $(CURDIR)/files/dufs.config $(1)/etc/config/dufs + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(CURDIR)/files/dufs.init $(1)/etc/init.d/dufs +endef + +$(eval $(call RustBinPackage,dufs)) +$(eval $(call BuildPackage,dufs)) diff --git a/net/dufs/files/dufs.config b/net/dufs/files/dufs.config new file mode 100644 index 0000000000..5f27697715 --- /dev/null +++ b/net/dufs/files/dufs.config @@ -0,0 +1,40 @@ + +config dufs 'config' + option enabled '0' + + # Specify bind address or unix socket + option bind '' + # Specify port to listen on + option port '5000' + # Specify a (URL) path prefix + option path_prefix '' + # Path to an SSL/TLS certificate to serve with HTTPS + option tls_cert '' + # Path to the SSL/TLS certificate's private key + option tls_key '' + # Enable CORS, sets `Access-Control-Allow-Origin: *` + option enable_cors '0' + # Allow access from Internet + option internet '0' + + # Specific path to serve + option serve_path '/mnt' + # Add auth roles, e.g. user:pass@/dir1:rw,/dir2 + list auth '' + # Hide paths from directory listings, e.g. tmp,*.log,*.lock + option hidden '' + # Allow all operations + option allow_all '0' + # Allow upload files/folders + option allow_upload '0' + # Allow delete files/folders + option allow_delete '0' + # Allow search files/folders + option allow_search '0' + # Allow symlink to files/folders outside root directory + option allow_symlink '0' + # Allow zip archive generation + option allow_archive '0' + # Set zip compress level [possible values: none, low, medium, high] + option compress '' + diff --git a/net/dufs/files/dufs.init b/net/dufs/files/dufs.init new file mode 100644 index 0000000000..e615a1aabf --- /dev/null +++ b/net/dufs/files/dufs.init @@ -0,0 +1,106 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2024 Tianling Shen + +START=99 +USE_PROCD=1 + +CONF="dufs" +PROG="/usr/bin/dufs" + +is_enabled() { + local enabled + config_get_bool enabled "$1" "$2" "${3:-0}" + if [ "$enabled" -eq "1" ]; then + return 0 + else + return 1 + fi +} + +append_param() { + procd_append_param command "$1" $2 +} + +append_param_arg() { + local value + config_get value "$1" "$2" $3 + [ -n "$value" ] && append_param "--${2//_/-}" "$value" +} + +append_param_bool() { + is_enabled "$1" "$2" && append_param "--${2//_/-}" +} + +start_service() { + config_load "$CONF" + + is_enabled "config" "enabled" || return 1 + + procd_open_instance "$CONF" + procd_set_param command "$PROG" + + append_param_arg "config" "bind" + append_param_arg "config" "port" "5000" + append_param_arg "config" "path_prefix" + append_param_arg "config" "tls_cert" + append_param_arg "config" "tls_key" + append_param_bool "config" "enable_cors" + + local auth_roles + config_get auth_roles "config" "auth" + [ -z "$auth_roles" ] || config_list_foreach "config" "auth" "append_param '--auth'" + + append_param_arg "config" "hidden" + append_param_bool "config" "allow_all" + append_param_bool "config" "allow_upload" + append_param_bool "config" "allow_delete" + append_param_bool "config" "allow_search" + append_param_bool "config" "allow_symlink" + append_param_bool "config" "allow_archive" + append_param_arg "config" "compress" + + append_param "--render-index" + append_param "--render-try-index" + + local serve_path + config_get serve_path "config" "serve_path" "/mnt" + append_param "$serve_path" + + procd_set_param limits core="unlimited" + procd_set_param limits nofile="1000000 1000000" + procd_set_param respawn + procd_set_param stderr 1 + + local internet + config_get_bool internet "config" "internet" "0" + if [ "$internet" -eq "1" ]; then + local listen_port + config_get listen_port "config" "port" "5000" + procd_open_data + json_add_array firewall + json_add_object "" + json_add_string type rule + json_add_string name "Allow-access-dufs-at-$listen_port" + json_add_string src "*" + json_add_string dest_port "$listen_port" + json_add_string proto tcp + json_add_string target ACCEPT + json_close_object + json_close_array + procd_close_data + fi + + procd_close_instance +} + +service_started() { + procd_set_config_changed firewall +} + +service_stopped() { + procd_set_config_changed firewall +} + +service_triggers() { + procd_add_reload_trigger "$CONF" +} diff --git a/utils/filebrowser/Makefile b/utils/filebrowser/Makefile new file mode 100644 index 0000000000..81d7b8f552 --- /dev/null +++ b/utils/filebrowser/Makefile @@ -0,0 +1,71 @@ +# SPDX-License-Identifier: GPL-3.0-only +# +# Copyright (C) 2021 ImmortalWrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=filebrowser +PKG_VERSION:=2.28.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/filebrowser/filebrowser/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=5e8c5b57783976f454ee7f23df9c36b9566648b7b443287a7f2089771628695d + +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Tianling Shen + +PKG_BUILD_DEPENDS:=golang/host node/host +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=no-mips16 + +GO_PKG:=github.com/filebrowser/filebrowser/v2 +GO_PKG_LDFLAGS_X:= \ + $(GO_PKG)/version.CommitSHA=$(PKG_VERSION) \ + $(GO_PKG)/version.Version=v$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../../lang/golang/golang-package.mk + +define Package/filebrowser + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Web File Browser + URL:=https://github.com/filebrowser/filebrowser + DEPENDS:=$(GO_ARCH_DEPENDS) +endef + +define Package/filebrowser/description + filebrowser provides a file managing interface within a specified directory + and it can be used to upload, delete, preview, rename and edit your files. + It allows the creation of multiple users and each user can have its own directory. + It can be used as a standalone app or as a middleware. +endef + +define Package/filebrowser/conffiles +/etc/filebrowser/ +/etc/config/filebrowser +endef + +define Build/Compile + ( \ + pushd "$(PKG_BUILD_DIR)/frontend" ; \ + npm ci; \ + NODE_OPTIONS=--openssl-legacy-provider npm run build ; \ + popd ; \ + $(call GoPackage/Build/Compile) ; \ + ) +endef + +define Package/filebrowser/install + $(call GoPackage/Package/Install/Bin,$(1)) + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) $(CURDIR)/files/filebrowser.config $(1)/etc/config/filebrowser + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(CURDIR)/files/filebrowser.init $(1)/etc/init.d/filebrowser +endef + +$(eval $(call GoBinPackage,filebrowser)) +$(eval $(call BuildPackage,filebrowser)) diff --git a/utils/filebrowser/files/filebrowser.config b/utils/filebrowser/files/filebrowser.config new file mode 100644 index 0000000000..9624e3df69 --- /dev/null +++ b/utils/filebrowser/files/filebrowser.config @@ -0,0 +1,7 @@ +config filebrowser 'config' + option enabled '0' + option listen_port '8989' + option root_path '/' + option base_url '' + option disable_exec '1' + diff --git a/utils/filebrowser/files/filebrowser.init b/utils/filebrowser/files/filebrowser.init new file mode 100644 index 0000000000..f081277d59 --- /dev/null +++ b/utils/filebrowser/files/filebrowser.init @@ -0,0 +1,46 @@ +#!/bin/sh /etc/rc.common + +USE_PROCD=1 +START=99 + +CONF="filebrowser" +PROG="/usr/bin/filebrowser" +DB_PATH="/etc/filebrowser/database.db" + +start_service() { + config_load "$CONF" + + local enabled + config_get_bool enabled "config" "enabled" "0" + [ "$enabled" -eq "1" ] || return 1 + + mkdir -p "${DB_PATH%/*}" + + local listen_port root_path base_url disable_exec + config_get listen_port "config" "listen_port" "8989" + config_get root_path "config" "root_path" "/mnt/" + config_get base_url "config" "base_url" + config_get_bool disable_exec "config" "disable_exec" "1" + + procd_open_instance + procd_set_param command "$PROG" + procd_append_param command --database "$DB_PATH" + procd_append_param command --address "[::]" + procd_append_param command --port "$listen_port" + procd_append_param command --root "$root_path" + [ -z "$base_url" ] || procd_append_param command --baseurl "$base_url" + [ "$disable_exec" = "0" ] || procd_append_param command --disable-exec + + procd_set_param limits core="unlimited" + procd_set_param limits nofile="1000000 1000000" + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_set_param respawn + + procd_close_instance + +} + +service_triggers() { + procd_add_reload_trigger "$CONF" +} From a504021ebb53a27ec50c5bc7503cfd22be633d24 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 20 Oct 2024 13:50:19 +0800 Subject: [PATCH 13/88] xray-core: revert to 1.8.24 --- net/xray-core/Makefile | 55 ++++++------------------------------------ 1 file changed, 8 insertions(+), 47 deletions(-) diff --git a/net/xray-core/Makefile b/net/xray-core/Makefile index 01ee70be2c..a853ac7bce 100644 --- a/net/xray-core/Makefile +++ b/net/xray-core/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xray-core -PKG_VERSION:=24.9.30 +PKG_VERSION:=1.8.24 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/XTLS/Xray-core/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=0771120ddbf866fba44f2e8978bcc20f3843663f5726bd8db9e03e1a27e1212a +PKG_HASH:=86e3e388c77cda4d8457a607356416c201c1f18bbed53f0a9e76a228508ff298 PKG_MAINTAINER:=Tianling Shen PKG_LICENSE:=MPL-2.0 @@ -15,75 +15,36 @@ PKG_LICENSE_FILES:=LICENSE PKG_BUILD_DIR:=$(BUILD_DIR)/Xray-core-$(PKG_VERSION) PKG_BUILD_DEPENDS:=golang/host PKG_BUILD_PARALLEL:=1 +PKG_USE_MIPS16:=0 PKG_BUILD_FLAGS:=no-mips16 GO_PKG:=github.com/xtls/xray-core -GO_PKG_BUILD_PKG:=github.com/xtls/xray-core/main +GO_PKG_LDFLAGS:=-s -w +GO_PKG_BUILD_PKG:=$(GO_PKG)/main GO_PKG_LDFLAGS_X:= \ $(GO_PKG)/core.build=OpenWrt \ $(GO_PKG)/core.version=$(PKG_VERSION) include $(INCLUDE_DIR)/package.mk -include ../../lang/golang/golang-package.mk +include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk -define Package/xray/template +define Package/xray-core TITLE:=A platform for building proxies to bypass network restrictions SECTION:=net CATEGORY:=Network URL:=https://xtls.github.io -endef - -define Package/xray-core - $(call Package/xray/template) DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle endef -define Package/xray-example - $(call Package/xray/template) - TITLE+= (example configs) - DEPENDS:=xray-core - PKGARCH:=all -endef - -define Package/xray/description +define Package/xray-core/description Xray, Penetrates Everything. It helps you to build your own computer network. It secures your network connections and thus protects your privacy. endef -define Package/xray-core/description - $(call Package/xray/description) -endef - -define Package/xray-example/description - $(call Package/xray/description) - - This includes example configuration files for xray-core. -endef - -define Package/xray-core/conffiles -/etc/xray/ -/etc/config/xray -endef - define Package/xray-core/install $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR)) $(INSTALL_DIR) $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/main $(1)/usr/bin/xray - - $(INSTALL_DIR) $(1)/etc/xray/ - $(INSTALL_DATA) $(CURDIR)/files/config.json.example $(1)/etc/xray/ - - $(INSTALL_DIR) $(1)/etc/config/ - $(INSTALL_CONF) $(CURDIR)/files/xray.conf $(1)/etc/config/xray - $(INSTALL_DIR) $(1)/etc/init.d/ - $(INSTALL_BIN) $(CURDIR)/files/xray.init $(1)/etc/init.d/xray -endef - -define Package/xray-example/install - $(INSTALL_DIR) $(1)/etc/xray/ - $(INSTALL_DATA) $(CURDIR)/files/vpoint_socks_vmess.json $(1)/etc/xray/ - $(INSTALL_DATA) $(CURDIR)/files/vpoint_vmess_freedom.json $(1)/etc/xray/ endef $(eval $(call BuildPackage,xray-core)) -$(eval $(call BuildPackage,xray-example)) From c4eec2a9f9192f65b26329b914a0358505fee3af Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 22 Oct 2024 17:53:01 +0800 Subject: [PATCH 14/88] tailscale: bump to v1.76.1 --- net/tailscale/Makefile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/net/tailscale/Makefile b/net/tailscale/Makefile index 95a6dd3156..3e751b4393 100644 --- a/net/tailscale/Makefile +++ b/net/tailscale/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tailscale -PKG_VERSION:=1.70.0 +PKG_VERSION:=1.76.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/tailscale/tailscale/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=8429728708f9694534489daa0a30af58be67f25742597940e7613793275c738f +PKG_HASH:=ce87e52fd4e8e52540162a2529c5d73f5f76c6679147a7887058865c9e01ec36 PKG_MAINTAINER:=Jan Pavlinec PKG_LICENSE:=BSD-3-Clause @@ -49,7 +49,6 @@ define Package/tailscale/description endef define Package/tailscale/conffiles -/etc/config/tailscale /etc/tailscale/ endef @@ -57,8 +56,6 @@ define Package/tailscale/install $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/tailscaled $(1)/usr/sbin $(LN) tailscaled $(1)/usr/sbin/tailscale - $(INSTALL_BIN) ./files//tailscale.init $(1)/etc/init.d/tailscale - $(INSTALL_DATA) ./files//tailscale.conf $(1)/etc/config/tailscale endef $(eval $(call BuildPackage,tailscale)) From 982dbed1f750a58cc059ac837d9205a0fe94b9cc Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 27 Oct 2024 05:08:10 +0800 Subject: [PATCH 15/88] xray-core: update to 24.10.16 --- net/xray-core/Makefile | 4 +- net/xray-core/files/config.json.example | 144 ------------------ net/xray-core/files/vpoint_socks_vmess.json | 25 --- net/xray-core/files/vpoint_vmess_freedom.json | 31 ---- net/xray-core/files/xray.conf | 11 -- net/xray-core/files/xray.init | 58 ------- net/xray-core/test.sh | 7 - 7 files changed, 2 insertions(+), 278 deletions(-) delete mode 100644 net/xray-core/files/config.json.example delete mode 100644 net/xray-core/files/vpoint_socks_vmess.json delete mode 100644 net/xray-core/files/vpoint_vmess_freedom.json delete mode 100644 net/xray-core/files/xray.conf delete mode 100755 net/xray-core/files/xray.init delete mode 100644 net/xray-core/test.sh diff --git a/net/xray-core/Makefile b/net/xray-core/Makefile index a853ac7bce..3758b997af 100644 --- a/net/xray-core/Makefile +++ b/net/xray-core/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xray-core -PKG_VERSION:=1.8.24 +PKG_VERSION:=24.10.16 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/XTLS/Xray-core/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=86e3e388c77cda4d8457a607356416c201c1f18bbed53f0a9e76a228508ff298 +PKG_HASH:=2964cf0cc7cb1b631591cc49c49160d1a478d2f83e4f0a1081e0bc6cc38d8725 PKG_MAINTAINER:=Tianling Shen PKG_LICENSE:=MPL-2.0 diff --git a/net/xray-core/files/config.json.example b/net/xray-core/files/config.json.example deleted file mode 100644 index 710bb1bec2..0000000000 --- a/net/xray-core/files/config.json.example +++ /dev/null @@ -1,144 +0,0 @@ -// Config file of Xray. This file follows standard JSON format, with comments support. -// Uncomment entries below to satisfy your needs. Also read our manual for more detail at -// https://xtls.github.io/en/config/ -{ - "log": { - // By default, Xray writes access log to stdout. - // "access": "/path/to/access/log/file", - - // By default, Xray write error log to stdout. - // "error": "/path/to/error/log/file", - - // Log level, one of "debug", "info", "warning", "error", "none" - "loglevel": "warning" - }, - // List of inbound proxy configurations. - "inbounds": [{ - // Port to listen on. You may need root access if the value is less than 1024. - "port": 1080, - - // IP address to listen on. Change to "0.0.0.0" to listen on all network interfaces. - "listen": "127.0.0.1", - - // Tag of the inbound proxy. May be used for routing. - "tag": "socks-inbound", - - // Protocol name of inbound proxy. - "protocol": "socks", - - // Settings of the protocol. Varies based on protocol. - "settings": { - "auth": "noauth", - "udp": false, - "ip": "127.0.0.1" - }, - - // Enable sniffing on TCP connection. - "sniffing": { - "enabled": true, - // Target domain will be overriden to the one carried by the connection, if the connection is HTTP or HTTPS. - "destOverride": ["http", "tls"] - } - }], - // List of outbound proxy configurations. - "outbounds": [{ - // Protocol name of the outbound proxy. - "protocol": "freedom", - - // Settings of the protocol. Varies based on protocol. - "settings": {}, - - // Tag of the outbound. May be used for routing. - "tag": "direct" - },{ - "protocol": "blackhole", - "settings": {}, - "tag": "blocked" - }], - - // Transport is for global transport settings. If you have multiple transports with same settings - // (say mKCP), you may put it here, instead of in each individual inbound/outbounds. - //"transport": {}, - - // Routing controls how traffic from inbounds are sent to outbounds. - "routing": { - "domainStrategy": "IPOnDemand", - "rules":[ - { - // Blocks access to private IPs. Remove this if you want to access your router. - "type": "field", - "ip": ["geoip:private"], - "outboundTag": "blocked" - }, - { - // Blocks major ads. - "type": "field", - "domain": ["geosite:category-ads"], - "outboundTag": "blocked" - } - ] - }, - - // Dns settings for domain resolution. - "dns": { - // Static hosts, similar to hosts file. - "hosts": { - // Match v2ray.com to another domain on CloudFlare. This domain will be used when querying IPs for v2ray.com. - "domain:v2ray.com": "www.vicemc.net", - - // The following settings help to eliminate DNS poisoning in mainland China. - // It is safe to comment these out if this is not the case for you. - "domain:github.io": "pages.github.com", - "domain:wikipedia.org": "www.wikimedia.org", - "domain:shadowsocks.org": "electronicsrealm.com" - }, - "servers": [ - "1.1.1.1", - { - "address": "114.114.114.114", - "port": 53, - // List of domains that use this DNS first. - "domains": [ - "geosite:cn" - ] - }, - "8.8.8.8", - "localhost" - ] - }, - - // Policy controls some internal behavior of how Xray handles connections. - // It may be on connection level by user levels in 'levels', or global settings in 'system.' - "policy": { - // Connection policys by user levels - "levels": { - "0": { - "uplinkOnly": 0, - "downlinkOnly": 0 - } - }, - "system": { - "statsInboundUplink": false, - "statsInboundDownlink": false, - "statsOutboundUplink": false, - "statsOutboundDownlink": false - } - }, - - // Stats enables internal stats counter. - // This setting can be used together with Policy and Api. - //"stats":{}, - - // Api enables gRPC APIs for external programs to communicate with Xray instance. - //"api": { - //"tag": "api", - //"services": [ - // "HandlerService", - // "LoggerService", - // "StatsService" - //] - //}, - - // You may add other entries to the configuration, but they will not be recognized by Xray. - "other": {} -} diff --git a/net/xray-core/files/vpoint_socks_vmess.json b/net/xray-core/files/vpoint_socks_vmess.json deleted file mode 100644 index 789cd270af..0000000000 --- a/net/xray-core/files/vpoint_socks_vmess.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "log": { - "loglevel": "warning" - }, - "inbounds": [{ - "port": 1080, - "listen": "127.0.0.1", - "protocol": "socks", - "settings": { - "auth": "noauth", - "udp": false, - "ip": "127.0.0.1" - } - }], - "outbounds": [{ - "protocol": "freedom", - "settings": {}, - "tag": "direct" - }], - "policy": { - "levels": { - "0": {"uplinkOnly": 0} - } - } -} diff --git a/net/xray-core/files/vpoint_vmess_freedom.json b/net/xray-core/files/vpoint_vmess_freedom.json deleted file mode 100644 index 41c7e30fa6..0000000000 --- a/net/xray-core/files/vpoint_vmess_freedom.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "inbounds": [{ - "port": 10086, - "protocol": "vmess", - "settings": { - "clients": [ - { - "id": "23ad6b10-8d1a-40f7-8ad0-e3e35cd38297", - "level": 1 - } - ] - } - }], - "outbounds": [{ - "protocol": "freedom", - "settings": {} - },{ - "protocol": "blackhole", - "settings": {}, - "tag": "blocked" - }], - "routing": { - "rules": [ - { - "type": "field", - "ip": ["geoip:private"], - "outboundTag": "blocked" - } - ] - } -} diff --git a/net/xray-core/files/xray.conf b/net/xray-core/files/xray.conf deleted file mode 100644 index 362fbac06d..0000000000 --- a/net/xray-core/files/xray.conf +++ /dev/null @@ -1,11 +0,0 @@ - -config xray 'enabled' - option enabled '0' - -config xray 'config' - option confdir '/etc/xray' - list conffiles '/etc/xray/config.json' - option datadir '/usr/share/v2ray' - option dialer '' - option format 'json' - diff --git a/net/xray-core/files/xray.init b/net/xray-core/files/xray.init deleted file mode 100755 index 7e4b8a7dbd..0000000000 --- a/net/xray-core/files/xray.init +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh /etc/rc.common - -USE_PROCD=1 -START=99 - -CONF="xray" -PROG="/usr/bin/xray" - -start_service() { - config_load "$CONF" - - local enabled - config_get_bool enabled "enabled" "enabled" "0" - [ "$enabled" -eq "1" ] || return 1 - - local confdir - local conffiles - local datadir - local dialer - local format - - config_get confdir "config" "confdir" - config_get conffiles "config" "conffiles" - config_get datadir "config" "datadir" "/usr/share/xray" - config_get dialer "config" "dialer" - config_get format "config" "format" "json" - - procd_open_instance "$CONF" - procd_set_param command "$PROG" run - [ -n "$confdir" ] && procd_append_param command -confdir "$confdir" - [ -n "$conffiles" ] && { - for i in $conffiles - do - procd_append_param command -config "$i" - done - } - [ -n "$format" ] && procd_append_param command -format "$format" - [ -n "$dialer" ] && procd_set_param env XRAY_BROWSER_DIALER="$dialer" - procd_set_param env XRAY_LOCATION_ASSET="$datadir" - procd_set_param file $conffiles - - procd_set_param limits core="unlimited" - procd_set_param limits nofile="1000000 1000000" - procd_set_param stdout 1 - procd_set_param stderr 1 - procd_set_param respawn - - procd_close_instance -} - -reload_service() { - stop - start -} - -service_triggers() { - procd_add_reload_trigger "$CONF" -} diff --git a/net/xray-core/test.sh b/net/xray-core/test.sh deleted file mode 100644 index 8fcce26fe8..0000000000 --- a/net/xray-core/test.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -case "$1" in - "xray-core") - xray version 2>&1 | grep "${2#*v}" - ;; -esac From b99b66aea3236e292e98faf388c860c1d09f95e4 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 27 Oct 2024 05:47:13 +0800 Subject: [PATCH 16/88] frpc: add anonymous proxy config support --- net/frp/Makefile | 69 ++++++++++++++-------------- net/frp/files/frpc.config | 23 ++++++++++ net/frp/files/frpc.init | 80 +++++++++++++++++++++++++++++++++ net/frp/files/frpc.uci-defaults | 19 ++++++++ net/frp/files/frps.config | 16 +++++++ net/frp/files/frps.init | 78 ++++++++++++++++++++++++++++++++ net/frp/test.sh | 3 ++ 7 files changed, 254 insertions(+), 34 deletions(-) create mode 100644 net/frp/files/frpc.config create mode 100644 net/frp/files/frpc.init create mode 100644 net/frp/files/frpc.uci-defaults create mode 100644 net/frp/files/frps.config create mode 100644 net/frp/files/frps.init create mode 100644 net/frp/test.sh diff --git a/net/frp/Makefile b/net/frp/Makefile index fd4edf8174..1e9c62242f 100644 --- a/net/frp/Makefile +++ b/net/frp/Makefile @@ -1,68 +1,69 @@ -# -# Copyright (C) 2019 Xingwang Liao -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - include $(TOPDIR)/rules.mk PKG_NAME:=frp -PKG_VERSION:=0.53.2 +PKG_VERSION:=0.51.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/fatedier/frp/tar.gz/v${PKG_VERSION}? -PKG_HASH:=ff2a4f04e7732bc77730304e48f97fdd062be2b142ae34c518ab9b9d7a3b32ec +PKG_HASH:=83032399773901348c660d41c967530e794ab58172ccd070db89d5e50d915fef +PKG_MAINTAINER:=Richard Yu PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE -PKG_MAINTAINER:=Xingwang Liao -PKG_BUILD_DEPENDS:=golang/host upx/host +PKG_BUILD_DEPENDS:=golang/host PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 +PKG_BUILD_FLAGS:=no-mips16 GO_PKG:=github.com/fatedier/frp GO_PKG_BUILD_PKG:=github.com/fatedier/frp/cmd/... -GO_PKG_LDFLAGS:=-s -w - include $(INCLUDE_DIR)/package.mk include ../../lang/golang/golang-package.mk -define frp/templates +define Package/frp/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/$(2) $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/frp/$(2).d/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/conf/$(2)_full.ini $(1)/etc/frp/$(2).d/ + $(INSTALL_DIR) $(1)/etc/config/ + $(INSTALL_CONF) ./files/$(2).config $(1)/etc/config/$(2) + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) ./files/$(2).init $(1)/etc/init.d/$(2) + + if [ -r ./files/$(2).uci-defaults ]; then \ + $(INSTALL_DIR) $(1)/etc/uci-defaults; \ + $(INSTALL_DATA) ./files/$(2).uci-defaults $(1)/etc/uci-defaults/$(2); \ + fi +endef + +define Package/frp/template define Package/$(1) - TITLE:=A fast reverse proxy ($(1)) - URL:=https://github.com/fatedier/frp SECTION:=net CATEGORY:=Network SUBMENU:=Web Servers/Proxies - DEPENDS:=$$(GO_ARCH_DEPENDS) + TITLE:=$(1) - fast reverse proxy $(2) + URL:=https://github.com/fatedier/frp + DEPENDS:=$(GO_ARCH_DEPENDS) endef define Package/$(1)/description - frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall - to the internet. As of now, it supports tcp & udp, as well as http and https protocols, - where requests can be forwarded to internal services by domain name. + $(1) is a fast reverse proxy $(2) to help you expose a local server behind + a NAT or firewall to the internet. + endef - This package contains the $(1). + define Package/$(1)/conffiles +/etc/config/$(1) endef define Package/$(1)/install - $$(call GoPackage/Package/Install/Bin,$$(PKG_INSTALL_DIR)) - - $$(INSTALL_DIR) $$(1)/usr/bin - $$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/ - - $(STAGING_DIR_HOST)/bin/upx --lzma --best $$(1)/usr/bin/$(1) || true + $(call Package/frp/install,$$(1),$(1)) endef endef -FRP_COMPONENTS:=frpc frps - -$(foreach component,$(FRP_COMPONENTS), \ - $(eval $(call frp/templates,$(component))) \ - $(eval $(call GoBinPackage,$(component))) \ - $(eval $(call BuildPackage,$(component))) \ -) +$(eval $(call Package/frp/template,frpc,client)) +$(eval $(call Package/frp/template,frps,server)) +$(eval $(call BuildPackage,frpc)) +$(eval $(call BuildPackage,frps)) diff --git a/net/frp/files/frpc.config b/net/frp/files/frpc.config new file mode 100644 index 0000000000..492e224fff --- /dev/null +++ b/net/frp/files/frpc.config @@ -0,0 +1,23 @@ +config init + option stdout 1 + option stderr 1 + option user frpc + option group frpc + option respawn 1 +# OS environments pass to frp for config file template, see +# https://github.com/fatedier/frp#configuration-file-template +# list env 'ENV_NAME=value' +# Config files include in temporary config file. +# list conf_inc '/etc/frp/frpc.d/frpc_full.ini' + +config conf 'common' + option server_addr 127.0.0.1 + option server_port 7000 +# List options with name="_" will be directly appended to config file +# list _ '# Key-A=Value-A' + +config conf 'ssh' + option type tcp + option local_ip 127.0.0.1 + option local_port 22 + option remote_port 6000 diff --git a/net/frp/files/frpc.init b/net/frp/files/frpc.init new file mode 100644 index 0000000000..68fe43c4e0 --- /dev/null +++ b/net/frp/files/frpc.init @@ -0,0 +1,80 @@ +#!/bin/sh /etc/rc.common + +START=99 +USE_PROCD=1 + +NAME=frpc +PROG=/usr/bin/$NAME + +_err() { + echo "$*" >&2 + logger -p daemon.err -t "$NAME" "$*" +} + +config_cb() { + [ $# -eq 0 ] && return + + local type="$1" + local name="$2" + if [ "$type" = "conf" ]; then + echo "[$name]" >> "$conf_file" + option_cb() { + local option="$1" + local value="$2" + [ "$option" = "name" ] && \ + sed -i "s/$CONFIG_SECTION/$value/g" "$conf_file" || \ + echo "$option = $value" >> "$conf_file"; + } + list_cb() { + local name="$1" + local value="$2" + [ "$name" = "_" ] && echo "$value" >> "$conf_file" + } + else + [ "$type" = "init" ] && init_cfg="$name" + option_cb() { return 0; } + list_cb() { return 0; } + fi +} + +service_triggers() +{ + procd_add_reload_trigger "$NAME" +} + +start_service() { + local init_cfg=" " + local conf_file="/var/etc/$NAME.ini" + + > "$conf_file" + config_load "$NAME" + + local stdout stderr user group respawn env conf_inc + uci_validate_section "$NAME" init "$init_cfg" \ + 'stdout:bool:1' \ + 'stderr:bool:1' \ + 'user:string' \ + 'group:string' \ + 'respawn:bool:1' \ + 'env:list(string)' \ + 'conf_inc:list(string)' + + local err=$? + [ $err -ne 0 ] && { + _err "uci_validate_section returned $err" + return 1 + } + + [ -n "$conf_inc" ] && config_list_foreach "$init_cfg" conf_inc cat >> "$conf_file" + + procd_open_instance + procd_set_param command "$PROG" -c "$conf_file" + procd_set_param file $conf_file + procd_set_param stdout $stdout + procd_set_param stderr $stderr + [ -n "$user" ] && procd_set_param user "$user" + [ -n "$group" ] && procd_set_param group "$group" + [ $respawn -eq 1 ] && procd_set_param respawn + [ -n "$env" ] && config_list_foreach "$init_cfg" env "procd_append_param env" + procd_close_instance +} diff --git a/net/frp/files/frpc.uci-defaults b/net/frp/files/frpc.uci-defaults new file mode 100644 index 0000000000..4883a2d8c6 --- /dev/null +++ b/net/frp/files/frpc.uci-defaults @@ -0,0 +1,19 @@ +#!/bin/sh + +. /lib/functions.sh + +upgrade() { + local section=$1 + local name + [ "$section" != "common" ] || return 0 + config_get name $section name + if [ -z "$name" ]; then + uci_set frpc "$section" name "$section" + uci_commit frpc + fi +} + +config_load frpc +config_foreach upgrade conf + +exit 0 diff --git a/net/frp/files/frps.config b/net/frp/files/frps.config new file mode 100644 index 0000000000..ae0bffc2f2 --- /dev/null +++ b/net/frp/files/frps.config @@ -0,0 +1,16 @@ +config init + option stdout 1 + option stderr 1 + option user frps + option group frps + option respawn 1 +# OS environments pass to frp for config file template, see +# https://github.com/fatedier/frp#configuration-file-template +# list env 'ENV_NAME=value' +# Config files include in temporary config file. +# list conf_inc '/etc/frp/frps.d/frps_full.ini' + +config conf 'common' + option bind_port 7000 +# List options with name="_" will be directly appended to config file +# list _ '# Key-A=Value-A' diff --git a/net/frp/files/frps.init b/net/frp/files/frps.init new file mode 100644 index 0000000000..38f714fb1b --- /dev/null +++ b/net/frp/files/frps.init @@ -0,0 +1,78 @@ +#!/bin/sh /etc/rc.common + +START=99 +USE_PROCD=1 + +NAME=frps +PROG=/usr/bin/$NAME + +_err() { + echo "$*" >&2 + logger -p daemon.err -t "$NAME" "$*" +} + +config_cb() { + [ $# -eq 0 ] && return + + local type="$1" + local name="$2" + if [ "$type" = "conf" ]; then + echo "[$name]" >> "$conf_file" + option_cb() { + local option="$1" + local value="$2" + echo "$option = $value" >> "$conf_file" + } + list_cb() { + local name="$1" + local value="$2" + [ "$name" = "_" ] && echo "$value" >> "$conf_file" + } + else + [ "$type" = "init" ] && init_cfg="$name" + option_cb() { return 0; } + list_cb() { return 0; } + fi +} + +service_triggers() +{ + procd_add_reload_trigger "$NAME" +} + +start_service() { + local init_cfg=" " + local conf_file="/var/etc/$NAME.ini" + + > "$conf_file" + config_load "$NAME" + + local stdout stderr user group respawn env conf_inc + uci_validate_section "$NAME" init "$init_cfg" \ + 'stdout:bool:1' \ + 'stderr:bool:1' \ + 'user:string' \ + 'group:string' \ + 'respawn:bool:1' \ + 'env:list(string)' \ + 'conf_inc:list(string)' + + local err=$? + [ $err -ne 0 ] && { + _err "uci_validate_section returned $err" + return 1 + } + + [ -n "$conf_inc" ] && config_list_foreach "$init_cfg" conf_inc cat >> "$conf_file" + + procd_open_instance + procd_set_param command "$PROG" -c "$conf_file" + procd_set_param file $conf_file + procd_set_param stdout $stdout + procd_set_param stderr $stderr + [ -n "$user" ] && procd_set_param user "$user" + [ -n "$group" ] && procd_set_param group "$group" + [ $respawn -eq 1 ] && procd_set_param respawn + [ -n "$env" ] && config_list_foreach "$init_cfg" env "procd_append_param env" + procd_close_instance +} diff --git a/net/frp/test.sh b/net/frp/test.sh new file mode 100644 index 0000000000..1436d02d3b --- /dev/null +++ b/net/frp/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +$1 -v 2>&1 | grep -F "$PKG_VERSION" From 058f961c237563c38a503f99e1a22bbe93e2635c Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 28 Oct 2024 23:17:20 +0800 Subject: [PATCH 17/88] ddns-scripts: bump version --- net/ddns-scripts/Makefile | 1082 +++++++++++------ net/ddns-scripts/files/ddns.config | 9 - net/ddns-scripts/files/ddns.defaults | 201 --- net/ddns-scripts/files/etc/config/ddns | 32 + .../hotplug.d/iface/ddns} | 0 .../files/{ddns.init => etc/init.d/ddns} | 4 - net/ddns-scripts/files/update_route53_v1.sh | 97 -- net/ddns-scripts/files/usr/bin/ddns.sh | 172 +++ .../lib/ddns}/dynamic_dns_functions.sh | 316 ++--- .../lib/ddns}/dynamic_dns_lucihelper.sh | 8 +- .../{ => usr/lib/ddns}/dynamic_dns_updater.sh | 100 +- .../lib/ddns}/update_cloudflare_com_v4.sh | 58 +- .../files/usr/lib/ddns/update_cnkuai_cn.sh | 86 ++ .../lib/ddns/update_digitalocean_com_v2.sh | 40 + .../files/usr/lib/ddns/update_dnspod_cn.sh | 137 +++ .../lib/ddns}/update_freedns_42_pl.sh | 2 +- .../files/usr/lib/ddns/update_gandi_net.sh | 48 + .../files/usr/lib/ddns/update_gcp_v1.sh | 272 +++++ .../lib/ddns}/update_godaddy_com_v1.sh | 0 .../usr/lib/ddns/update_huaweicloud_com.sh | 152 +++ .../files/usr/lib/ddns/update_luadns_v1.sh | 191 +++ .../{ => usr/lib/ddns}/update_no-ip_com.sh | 4 +- .../files/usr/lib/ddns/update_ns1_com.sh | 77 ++ .../{ => usr/lib/ddns}/update_nsupdate.sh | 4 +- .../files/usr/lib/ddns/update_one_com.sh | 142 +++ .../files/usr/lib/ddns/update_pdns.sh | 63 + .../files/usr/lib/ddns/update_porkbun_v3.sh | 162 +++ .../files/usr/lib/ddns/update_route53_v1.sh | 96 ++ .../files/usr/lib/ddns/update_transip_nl.sh | 134 ++ .../usr/share/ddns/default/3322.org.json | 6 + .../ddns/default/afraid.org-basicauth.json | 9 + .../ddns/default/afraid.org-keyauth.json | 9 + .../ddns/default/afraid.org-v2-basic.json | 9 + .../ddns/default/afraid.org-v2-token.json | 9 + .../usr/share/ddns/default/all-inkl.com.json | 9 + .../usr/share/ddns/default/bind-nsupdate.json | 9 + .../usr/share/ddns/default/changeip.com.json | 7 + .../ddns/default/cloud.google.com-v1.json | 10 + .../share/ddns/default/cloudflare.com-v4.json | 9 + .../usr/share/ddns/default/cnkuai.cn.json | 9 + .../share/ddns/default/core-networks.de.json | 11 + .../usr/share/ddns/default/ddnss.de.json | 7 + .../files/usr/share/ddns/default/ddo.jp.json | 6 + .../usr/share/ddns/default/desec.io.json | 11 + .../usr/share/ddns/default/dhis.org.json | 9 + .../ddns/default/digitalocean.com-v2.json | 9 + .../share/ddns/default/dnsdynamic.org.json | 7 + .../usr/share/ddns/default/dnsever.com.json | 6 + .../usr/share/ddns/default/dnsexit.com.json | 6 + .../usr/share/ddns/default/dnshome.de.json | 9 + .../share/ddns/default/dnsmadeeasy.com.json | 7 + .../usr/share/ddns/default/dnsmax.com.json | 6 + .../usr/share/ddns/default/dnsomatic.com.json | 7 + .../usr/share/ddns/default/dnspark.com.json | 7 + .../usr/share/ddns/default/dnspod.cn.json | 9 + .../files/usr/share/ddns/default/do.de.json | 11 + .../usr/share/ddns/default/domopoli.de.json | 7 + .../usr/share/ddns/default/duckdns.org.json | 11 + .../usr/share/ddns/default/duiadns.net.json | 9 + .../files/usr/share/ddns/default/dy.fi.json | 7 + .../files/usr/share/ddns/default/dyn.com.json | 11 + .../usr/share/ddns/default/dyndns.it.json | 7 + .../usr/share/ddns/default/dyndns.org.json | 11 + .../usr/share/ddns/default/dynu.com.json | 9 + .../usr/share/ddns/default/dynv6.com.json | 11 + .../usr/share/ddns/default/easydns.com.json | 11 + .../usr/share/ddns/default/freedns.42.pl.json | 6 + .../usr/share/ddns/default/gandi.net.json | 9 + .../share/ddns/default/godaddy.com-v1.json | 9 + .../files/usr/share/ddns/default/goip.de.json | 9 + .../usr/share/ddns/default/google.com.json | 11 + .../files/usr/share/ddns/default/he.net.json | 11 + .../usr/share/ddns/default/hosting.de.json | 11 + .../share/ddns/default/huaweicloud.com.json | 9 + .../share/ddns/default/infomaniak.com.json | 11 + .../files/usr/share/ddns/default/inwx.de.json | 11 + .../usr/share/ddns/default/ipnodns.ru.json | 7 + .../usr/share/ddns/default/joker.com.json | 7 + .../usr/share/ddns/default/loopia.se.json | 11 + .../usr/share/ddns/default/luadns.com-v1.json | 9 + .../usr/share/ddns/default/moniker.com.json | 7 + .../usr/share/ddns/default/mydns.jp.json | 9 + .../ddns/default/myonlineportal.net.json | 11 + .../ddns/default/mythic-beasts.com-v2.json | 9 + .../share/ddns/default/mythic-beasts.com.json | 9 + .../usr/share/ddns/default/namecheap.com.json | 6 + .../files/usr/share/ddns/default/njal.la.json | 9 + .../usr/share/ddns/default/no-ip.com.json | 10 + .../usr/share/ddns/default/no-ip.pl.json | 9 + .../usr/share/ddns/default/now-dns.com.json | 11 + .../files/usr/share/ddns/default/ns1.com.json | 9 + .../usr/share/ddns/default/nsupdate.info.json | 11 + .../files/usr/share/ddns/default/one.com.json | 6 + .../usr/share/ddns/default/opendns.com.json | 7 + .../usr/share/ddns/default/oray.com.json | 6 + .../files/usr/share/ddns/default/ovh.com.json | 11 + .../files/usr/share/ddns/default/pdns.json | 9 + .../share/ddns/default/porkbun.com-v3.json | 9 + .../usr/share/ddns/default/regfish.de.json | 11 + .../usr/share/ddns/default/route53-v1.json | 9 + .../share/ddns/default/schokokeks.org.json | 7 + .../usr/share/ddns/default/selfhost.de.json | 7 + .../usr/share/ddns/default/servercow.de.json | 11 + .../usr/share/ddns/default/simply.com.json | 11 + .../share/ddns/default/sitelutions.com.json | 7 + .../usr/share/ddns/default/spdyn.de.json | 11 + .../usr/share/ddns/default/strato.com.json | 11 + .../usr/share/ddns/default/system-ns.com.json | 8 + .../usr/share/ddns/default/thatip.com.json | 6 + .../usr/share/ddns/default/transip.nl.json | 9 + .../usr/share/ddns/default/twodns.de.json | 6 + .../usr/share/ddns/default/udmedia.de.json | 9 + .../usr/share/ddns/default/variomedia.de.json | 11 + .../usr/share/ddns/default/xlhost.de.json | 7 + .../usr/share/ddns/default/zoneedit.com.json | 6 + net/ddns-scripts/files/usr/share/ddns/list | 69 ++ net/ddns-scripts/samples/ddns.config_sample | 5 + net/ddns-scripts/samples/slaac_sample.sh | 59 + net/ddns-scripts/samples/update_sample.sh | 2 +- 119 files changed, 3670 insertions(+), 907 deletions(-) mode change 100755 => 100644 net/ddns-scripts/Makefile delete mode 100644 net/ddns-scripts/files/ddns.config delete mode 100755 net/ddns-scripts/files/ddns.defaults create mode 100644 net/ddns-scripts/files/etc/config/ddns rename net/ddns-scripts/files/{ddns.hotplug => etc/hotplug.d/iface/ddns} (100%) mode change 100755 => 100644 rename net/ddns-scripts/files/{ddns.init => etc/init.d/ddns} (94%) mode change 100755 => 100644 delete mode 100644 net/ddns-scripts/files/update_route53_v1.sh create mode 100644 net/ddns-scripts/files/usr/bin/ddns.sh rename net/ddns-scripts/files/{ => usr/lib/ddns}/dynamic_dns_functions.sh (84%) mode change 100755 => 100644 rename net/ddns-scripts/files/{ => usr/lib/ddns}/dynamic_dns_lucihelper.sh (97%) mode change 100755 => 100644 rename net/ddns-scripts/files/{ => usr/lib/ddns}/dynamic_dns_updater.sh (84%) mode change 100755 => 100644 rename net/ddns-scripts/files/{ => usr/lib/ddns}/update_cloudflare_com_v4.sh (82%) mode change 100755 => 100644 create mode 100644 net/ddns-scripts/files/usr/lib/ddns/update_cnkuai_cn.sh create mode 100644 net/ddns-scripts/files/usr/lib/ddns/update_digitalocean_com_v2.sh create mode 100755 net/ddns-scripts/files/usr/lib/ddns/update_dnspod_cn.sh rename net/ddns-scripts/files/{ => usr/lib/ddns}/update_freedns_42_pl.sh (98%) mode change 100755 => 100644 create mode 100644 net/ddns-scripts/files/usr/lib/ddns/update_gandi_net.sh create mode 100755 net/ddns-scripts/files/usr/lib/ddns/update_gcp_v1.sh rename net/ddns-scripts/files/{ => usr/lib/ddns}/update_godaddy_com_v1.sh (100%) mode change 100755 => 100644 create mode 100644 net/ddns-scripts/files/usr/lib/ddns/update_huaweicloud_com.sh create mode 100644 net/ddns-scripts/files/usr/lib/ddns/update_luadns_v1.sh rename net/ddns-scripts/files/{ => usr/lib/ddns}/update_no-ip_com.sh (87%) mode change 100755 => 100644 create mode 100644 net/ddns-scripts/files/usr/lib/ddns/update_ns1_com.sh rename net/ddns-scripts/files/{ => usr/lib/ddns}/update_nsupdate.sh (92%) mode change 100755 => 100644 create mode 100644 net/ddns-scripts/files/usr/lib/ddns/update_one_com.sh create mode 100755 net/ddns-scripts/files/usr/lib/ddns/update_pdns.sh create mode 100644 net/ddns-scripts/files/usr/lib/ddns/update_porkbun_v3.sh create mode 100644 net/ddns-scripts/files/usr/lib/ddns/update_route53_v1.sh create mode 100644 net/ddns-scripts/files/usr/lib/ddns/update_transip_nl.sh create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/3322.org.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/afraid.org-basicauth.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/afraid.org-keyauth.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/afraid.org-v2-basic.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/afraid.org-v2-token.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/all-inkl.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/bind-nsupdate.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/changeip.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/cloud.google.com-v1.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/cloudflare.com-v4.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/cnkuai.cn.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/core-networks.de.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/ddnss.de.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/ddo.jp.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/desec.io.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/dhis.org.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/digitalocean.com-v2.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/dnsdynamic.org.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/dnsever.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/dnsexit.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/dnshome.de.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/dnsmadeeasy.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/dnsmax.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/dnsomatic.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/dnspark.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/dnspod.cn.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/do.de.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/domopoli.de.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/duckdns.org.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/duiadns.net.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/dy.fi.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/dyn.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/dyndns.it.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/dyndns.org.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/dynu.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/dynv6.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/easydns.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/freedns.42.pl.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/gandi.net.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/godaddy.com-v1.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/goip.de.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/google.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/he.net.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/hosting.de.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/huaweicloud.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/infomaniak.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/inwx.de.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/ipnodns.ru.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/joker.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/loopia.se.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/luadns.com-v1.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/moniker.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/mydns.jp.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/myonlineportal.net.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/mythic-beasts.com-v2.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/mythic-beasts.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/namecheap.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/njal.la.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/no-ip.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/no-ip.pl.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/now-dns.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/ns1.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/nsupdate.info.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/one.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/opendns.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/oray.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/ovh.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/pdns.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/porkbun.com-v3.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/regfish.de.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/route53-v1.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/schokokeks.org.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/selfhost.de.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/servercow.de.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/simply.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/sitelutions.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/spdyn.de.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/strato.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/system-ns.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/thatip.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/transip.nl.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/twodns.de.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/udmedia.de.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/variomedia.de.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/xlhost.de.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/default/zoneedit.com.json create mode 100644 net/ddns-scripts/files/usr/share/ddns/list create mode 100755 net/ddns-scripts/samples/slaac_sample.sh diff --git a/net/ddns-scripts/Makefile b/net/ddns-scripts/Makefile old mode 100755 new mode 100644 index aa57c4fcb9..7ccc9ee933 --- a/net/ddns-scripts/Makefile +++ b/net/ddns-scripts/Makefile @@ -7,440 +7,770 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ddns-scripts -# Version == major.minor.patch -# increase on new functionality (minor) or patches (patch) -PKG_VERSION:=2.7.8 -# Release == build -# increase on changes of services files or tld_names.dat -PKG_RELEASE:=5 +PKG_VERSION:=2.8.2 +PKG_RELEASE:=49 PKG_LICENSE:=GPL-2.0 -PKG_MAINTAINER:= include $(INCLUDE_DIR)/package.mk -# no default dependencies -PKG_DEFAULT_DEPENDS= - define Package/ddns-scripts/Default - SECTION:=net - CATEGORY:=Network - SUBMENU:=IP Addresses and Names - PKGARCH:=all + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + PKGARCH:=all endef -###### ************************************************************************* + define Package/ddns-scripts - $(call Package/ddns-scripts/Default) - TITLE:=Dynamic DNS Client scripts (with IPv6 support) + $(call Package/ddns-scripts/Default) + TITLE:=Dynamic DNS Client scripts (with IPv6 support) + DEPENDS:=+ddns-scripts-services endef -# shown in LuCI package description + define Package/ddns-scripts/description - Dynamic DNS Client scripts (with IPv6 support) - Info: http://wiki.openwrt.org/doc/howto/ddns.client + Dynamic DNS Client scripts (with IPv6 support) + A highly configurable set of scripts for doing dynamic dns updates. + - IPv6 support + - DNS server support + - Glue Record support (require BIND host or KNOT host) + - DNS requests via TCP + - Proxy server support + - log file support + - support to run once + Version: $(PKG_VERSION)-$(PKG_RELEASE) + Info : https://openwrt.org/docs/guide-user/services/ddns/client +endef + +define Package/ddns-scripts/conffiles +/etc/config/ddns +endef + + +define Package/ddns-scripts-services + $(call Package/ddns-scripts/Default) + TITLE:=Common ddns providers + PROVIDES:=ddns-scripts_service +endef + +define Package/ddns-scripts-services/description + Dynamic DNS Client definitions for supported services +endef + +define Package/ddns-scripts-utils + $(call Package/ddns-scripts/Default) + TITLE:=Utility scripts for ddns configs + DEPENDS:=ddns-scripts +endef + +define Package/ddns-scripts-utils/description + Dynamic DNS Client utility scripts for config files +endef + + +define Package/ddns-scripts-luadns + $(call Package/ddns-scripts/Default) + TITLE:=Extension for LuaDNS API v1 + DEPENDS:=ddns-scripts +curl +endef + +define Package/ddns-scripts-luadns/description + Dynamic DNS Client scripts extension for LuaDNS API v1 (require curl) +endef + +define Package/ddns-scripts-cloudflare + $(call Package/ddns-scripts/Default) + TITLE:=Extension for cloudflare.com API v4 + DEPENDS:=ddns-scripts +curl + PROVIDES:=ddns-scripts_cloudflare.com-v4 +endef + +define Package/ddns-scripts-cloudflare/description + Dynamic DNS Client scripts extension for cloudflare.com API v4 (require curl) +endef + + +define Package/ddns-scripts-gcp + $(call Package/ddns-scripts/Default) + TITLE:=Extension for Google Cloud DNS API v1 + DEPENDS:=ddns-scripts +curl +openssl-util +endef + +define Package/ddns-scripts-gcp/description + Dynamic DNS Client scripts extension for Google Cloud DNS API v1 (requires curl) +endef + + +define Package/ddns-scripts-freedns + $(call Package/ddns-scripts/Default) + TITLE:=Extension for freedns.42.pl + DEPENDS:=ddns-scripts +curl + PROVIDES:=ddns-scripts_freedns_42_pl +endef + +define Package/ddns-scripts-freedns/description + Dynamic DNS Client scripts extension for "freedns.42.pl". +endef + + +define Package/ddns-scripts-godaddy + $(call Package/ddns-scripts/Default) + TITLE:=Extension for godaddy.com API v1 + DEPENDS:=ddns-scripts +curl + PROVIDES:=ddns-scripts_godaddy.com-v1 +endef + +define Package/ddns-scripts-godaddy/description + Dynamic DNS Client scripts extension for "godaddy.com API v1". +endef + + +define Package/ddns-scripts-digitalocean + $(call Package/ddns-scripts/Default) + TITLE:=Extention for digitalocean.com API v2 + DEPENDS:=ddns-scripts +curl + PROVIDES:=ddns-scripts_digitalocean.com-v2 +endef + +define Package/ddns-scripts-digitalocean/description + Dynamic DNS Client scripts extension for "digitalocean.com API v2". + The script directly updates a DNS record using the DO API. + It requires: + "option dns_server" to be set to the server to be used by nsupdate. + "option domain" the dns domain to update the record for (eg. A-record: home.) + "option username" the dns record name to update (eg. A-record: .example.com) + "option param_opt" the id of the dns record to update (check using chrome inspector in the DO dns tab) + "option password" the api token generated in the DO panel +endef + + +define Package/ddns-scripts-dnspod + $(call Package/ddns-scripts/Default) + TITLE:=Extension for dnspod.cn API + DEPENDS:=ddns-scripts +curl +endef + +define Package/ddns-scripts-dnspod/description + Dynamic DNS Client scripts extension for dnspod.cn API (require curl) +endef + + +define Package/ddns-scripts-noip + $(call Package/ddns-scripts/Default) + TITLE:=Extension for no-ip.com + DEPENDS:=ddns-scripts + PROVIDES:=ddns-scripts_no-ip_com +endef + +define Package/ddns-scripts-noip/description + Dynamic DNS Client scripts extension for "no-ip.com". +endef + +define Package/ddns-scripts-ns1 + $(call Package/ddns-scripts/Default) + TITLE:=NS1 API + DEPENDS:=ddns-scripts +curl +endef + +define Package/ddns-scripts-ns1/description + Dynamic DNS Client scripts extension for "ns1.com". + It requires: + "option username" to be a valid zone for ns1.com + "option password" to be a valid API key for ns1.com +endef + + +define Package/ddns-scripts-nsupdate + $(call Package/ddns-scripts/Default) + TITLE:=Extension for using bind nsupdate. + DEPENDS:=ddns-scripts +bind-client + PROVIDES:=ddns-scripts_nsupdate endef -# shown in menuconfig -define Package/ddns-scripts/config - help - A highly configurable set of scripts for doing dynamic dns updates. - - IPv6 support - - DNS server support - - Glue Record support (require BIND host or KNOT host) - - DNS requests via TCP - - Proxy server support - - log file support - - support to run once - Version: $(PKG_VERSION)-$(PKG_RELEASE) - Info : http://wiki.openwrt.org/doc/howto/ddns.client + +define Package/ddns-scripts-nsupdate/description + Dynamic DNS Client scripts extension for direct updates using bind nsupdate + The script directly updates a PowerDNS (or maybe bind server) via nsupdate + from bind-client package. + It requires: + "option dns_server" to be set to the server to be used by nsupdate. + "option username" should be set to the key name and + "option password" to the base64 encoded shared secret. endef -###### ************************************************************************* -define Package/ddns-scripts_cloudflare.com-v4 - $(call Package/ddns-scripts/Default) - TITLE:=CloudFlare.com API v4 (requires cURL) - DEPENDS:=ddns-scripts +curl + +define Package/ddns-scripts-route53 + $(call Package/ddns-scripts/Default) + TITLE:=Extension for route53 API v1 + DEPENDS:=ddns-scripts +curl +openssl-util + PROVIDES:=ddns-scripts_route53-v1 endef -define Package/ddns-scripts_cloudflare.com-v4/description - Dynamic DNS Client scripts extension for CloudFlare.com API-v4 (require/install cURL) + +define Package/ddns-scripts-route53/description + Dynamic DNS Client scripts extension for Amazon AWS "route53 API v1". + Note: You must also install ca-certificate or ca-bundle. + It requires: + "option username" to be a valid AWS access key id + "option password" to be the matching AWS secret key id + "option domain" to contain the hosted zone ID endef -###### ************************************************************************* -define Package/ddns-scripts_freedns_42_pl - $(call Package/ddns-scripts/Default) - TITLE:=DDNS extension for FreeDNS.42.pl (requires cURL) - DEPENDS:=ddns-scripts +curl + +define Package/ddns-scripts-cnkuai + $(call Package/ddns-scripts/Default) + TITLE:=CnKuai API + DEPENDS:=ddns-scripts +curl +giflib-utils + PROVIDES:=ddns-scripts_cnkuai_cn endef -define Package/ddns-scripts_freedns_42_pl/description - Dynamic DNS Client scripts extension for freedns.42.pl + +define Package/ddns-scripts-cnkuai/description + Dynamic DNS Client scripts extension for "cnkuai.cn". + It requires: + "option username" to be a valid CnKuai control panel id + "option password" to be the matching CnKuai control panel password + "option domain" to contain the domain endef -###### ************************************************************************* -define Package/ddns-scripts_godaddy.com-v1 - $(call Package/ddns-scripts/Default) - TITLE:=GoDaddy.com (require cURL) - DEPENDS:=ddns-scripts +curl + +define Package/ddns-scripts-gandi + $(call Package/ddns-scripts/Default) + TITLE:=Gandi API + DEPENDS:=ddns-scripts +curl endef -define Package/ddns-scripts_godaddy.com-v1/description - Dynamic DNS Client scripts extension for GoDaddy.com (require/install cURL) + +define Package/ddns-scripts-gandi/description + Dynamic DNS Client scripts extension for "gandi.net". + It requires: + "option username" to be a valid subdomain for gandi.net + "option password" to be a valid API key for gandi.net endef -###### ************************************************************************* -define Package/ddns-scripts_no-ip_com - $(call Package/ddns-scripts/Default) - TITLE:=DDNS extension for No-IP.com - DEPENDS:=ddns-scripts + +define Package/ddns-scripts-pdns + $(call Package/ddns-scripts/Default) + TITLE:=PowerDNS API + DEPENDS:=ddns-scripts +curl endef -define Package/ddns-scripts_no-ip_com/description - Dynamic DNS Client scripts extension for No-IP.com + +define Package/ddns-scripts-pdns/description + Dynamic DNS Client scripts extension for "PowerDNS" via API. + It requires: + "option param_opt(Optional Parameter)" to be a valid root URL for the PowerDNS webserver + "option username" to be a valid subdomain for the PowerDNS domain + "option password" to be a valid API key for the PowerDNS webserver endef -###### ************************************************************************* -define Package/ddns-scripts_nsupdate - $(call Package/ddns-scripts/Default) - TITLE:=DDNS extension using Bind nsupdate - DEPENDS:=ddns-scripts +bind-client + +define Package/ddns-scripts-transip + $(call Package/ddns-scripts/Default) + TITLE:=Extension for TransIP API + DEPENDS:=ddns-scripts +curl +openssl-util +!BUSYBOX_CONFIG_MKTEMP:coreutils-mktemp endef -define Package/ddns-scripts_nsupdate/description - Dynamic DNS Client scripts extension for direct updates using Bind nsupdate + +define Package/ddns-scripts-transip/description + Dynamic DNS Client scripts extension for "transip.nl". + Note: You must also install ca-certificate or ca-bundle. + It requires: + "option username" to be a valid username for transip.nl + "option password" to be a valid matching private key + "option domain" to contain the base domain + "option param_enc" to contain the name of the DNS record to update + "option param_opt" to contain the TTL of the DNS record to update +endef + +define Package/ddns-scripts-one + $(call Package/ddns-scripts/Default) + TITLE:=Extension for one.com Control Panel + DEPENDS:=ddns-scripts +curl endef -define Package/ddns-scripts_nsupdate/config - help - The script directly updates a PowerDNS (or maybe bind server) via nsupdate - from bind-client package. It requires - "option dns_server" to be set to the server to be used by nsupdate. - "option username" should be set to the key name and - "option password" to the base64 encoded shared secret. +define Package/ddns-scrtips-one/description + Dynamic DNS Client scripts extension for "one.com". + It requires: + "option username" to be a valid Email for one.com Control Panel + "option password" to be the matching one.com Control Panel password + "option domain" to contain the domain / subdomain endef -###### ************************************************************************* -define Package/ddns-scripts_route53-v1 - $(call Package/ddns-scripts/Default) - TITLE:=Amazon AWS Route 53 API v1 - DEPENDS:=ddns-scripts +curl +openssl-util + +define Package/ddns-scripts-porkbun + $(call Package/ddns-scripts/Default) + TITLE:=Extension for porkbun.com API v3 + DEPENDS:=ddns-scripts +curl + PROVIDES:=ddns-scripts_porkbun.com-v3 endef -define Package/ddns-scripts_route53-v1/description - Dynamic DNS Client scripts extension for Amazon AWS Route53. Note: You - must also install ca-certificate or ca-bundle. + +define Package/ddns-scripts-porkbun/description + Dynamic DNS Client scripts extension for porkbun.com API v3 (require curl) It requires: - "option username" to be a valid AWS access key id - "option password" to be the matching AWS secret key id - "option domain" to contain the hosted zone ID + "option username" to be a Porkbun API key + "option password" to be the corresponding Porkbun API secret key + "option domain" to be the FQDN for which to configure DDNS endef -###### ************************************************************************* -define Build/Configure +define Package/ddns-scripts-huaweicloud + $(call Package/ddns-scripts/Default) + TITLE:=Extension for huaweicloud.com API + DEPENDS:=ddns-scripts +curl +openssl-util endef -define Build/Compile - $(CP) ./files $(PKG_BUILD_DIR) - # ensure that VERSION inside dynamic_dns_functions.sh reflect PKG_VERSION of Makefile - $(SED) '/^VERSION=*/s/.*/VERSION="$(PKG_VERSION)-$(PKG_RELEASE)"/' $(PKG_BUILD_DIR)/files/dynamic_dns_functions.sh - # remove comments, white spaces and empty lines - for FILE in `find $(PKG_BUILD_DIR)/files -type f`; do \ - $(SED) 's/^[[:space:]]*//' \ - -e '/^#[[:space:]]\|^#$$$$/d' \ - -e 's/[[:space:]]#[[:space:]].*$$$$//' \ - -e 's/[[:space:]]*$$$$//' \ - -e '/^\/\/[[:space:]]/d' \ - -e '/^[[:space:]]*$$$$/d' $$$$FILE; \ - done + +define Package/ddns-scripts-huaweicloud/description + Dynamic DNS Client scripts extension for huaweicloud.com API (require curl and openssl) endef -define Package/ddns-scripts/conffiles -/etc/config/ddns +define Build/Configure endef -###### ************************************************************************* -define Package/ddns-scripts/preinst - #!/bin/sh - # if NOT run buildroot then stop service - [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 - exit 0 # suppress errors +define Build/Compile endef + + define Package/ddns-scripts/install - $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns - $(INSTALL_DIR) $(1)/etc/hotplug.d/iface - $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.hotplug $(1)/etc/hotplug.d/iface/95-ddns - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.init $(1)/etc/init.d/ddns - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) $(PKG_BUILD_DIR)/files/ddns.config $(1)/etc/config/ddns + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_DATA) ./files/etc/hotplug.d/iface/ddns \ + $(1)/etc/hotplug.d/iface/95-ddns + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/etc/init.d/ddns \ + $(1)/etc/init.d/ddns + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/etc/config/ddns \ + $(1)/etc/config/ddns $(INSTALL_DIR) $(1)/etc/ddns - $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/services* $(1)/etc/ddns + $(INSTALL_DATA) ./files/services* $(1)/etc/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns + echo "$(PKG_VERSION)-$(PKG_RELEASE)" > $(1)/usr/share/ddns/version - $(INSTALL_DIR) $(1)/usr/lib/ddns - $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dynamic_dns_*.sh $(1)/usr/lib/ddns + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_DATA) ./files/usr/lib/ddns/dynamic_dns_functions.sh \ + $(1)/usr/lib/ddns + $(INSTALL_BIN) ./files/usr/lib/ddns/dynamic_dns_lucihelper.sh \ + $(1)/usr/lib/ddns + $(INSTALL_BIN) ./files/usr/lib/ddns/dynamic_dns_updater.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/usr/bin/ddns.sh \ + $(1)/usr/bin/ddns endef + define Package/ddns-scripts/postinst - #!/bin/sh - # if NOT run buildroot and PKG_UPGRADE then (re)start service if enabled - [ -z "$${IPKG_INSTROOT}" -a "$${PKG_UPGRADE}" = "1" ] && { - [ -x /etc/uci-defaults/ddns ] && \ - /etc/uci-defaults/ddns && \ - rm -f /etc/uci-defaults/ddns >/dev/null 2>&1 - /etc/init.d/ddns enabled && \ - /etc/init.d/ddns start >/dev/null 2>&1 - } - exit 0 # suppress errors +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns enabled + /etc/init.d/ddns start +fi +exit 0 endef + define Package/ddns-scripts/prerm - #!/bin/sh - # if run within buildroot exit - [ -n "$${IPKG_INSTROOT}" ] && exit 0 - # stop running scripts +#!/bin/sh +if [ -n "$${IPKG_INSTROOT}" ]; then /etc/init.d/ddns stop /etc/init.d/ddns disable - # clear LuCI indexcache - rm -f /tmp/luci-indexcache >/dev/null 2>&1 - exit 0 # suppress errors +fi +exit 0 +endef + + +define Package/ddns-scripts-services/install + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/* \ + $(1)/usr/share/ddns/default + + # Remove special services + rm $(1)/usr/share/ddns/default/luadns.com-v1.json + rm $(1)/usr/share/ddns/default/cloudflare.com-v4.json + rm $(1)/usr/share/ddns/default/cloud.google.com-v1.json + rm $(1)/usr/share/ddns/default/freedns.42.pl.json + rm $(1)/usr/share/ddns/default/godaddy.com-v1.json + rm $(1)/usr/share/ddns/default/digitalocean.com-v2.json + rm $(1)/usr/share/ddns/default/dnspod.cn.json + rm $(1)/usr/share/ddns/default/no-ip.com.json + rm $(1)/usr/share/ddns/default/bind-nsupdate.json + rm $(1)/usr/share/ddns/default/route53-v1.json + rm $(1)/usr/share/ddns/default/cnkuai.cn.json + rm $(1)/usr/share/ddns/default/gandi.net.json + rm $(1)/usr/share/ddns/default/pdns.json + rm $(1)/usr/share/ddns/default/transip.nl.json + rm $(1)/usr/share/ddns/default/ns1.com.json + rm $(1)/usr/share/ddns/default/one.com.json + rm $(1)/usr/share/ddns/default/porkbun.com-v3.json + rm $(1)/usr/share/ddns/default/huaweicloud.com.json +endef + + +define Package/ddns-scripts-utils/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) ./samples/slaac_sample.sh \ + $(1)/usr/lib/ddns/slaac.sh + $(INSTALL_BIN) ./samples/getlocalip_sample.sh \ + $(1)/usr/lib/ddns/getlocalip.sh +endef + + +define Package/ddns-scripts-luadns/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) ./files/usr/lib/ddns/update_luadns_v1.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/luadns.com-v1.json \ + $(1)/usr/share/ddns/default/ +endef + +define Package/ddns-scripts-luadns/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 +endef + + +define Package/ddns-scripts-cloudflare/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) ./files/usr/lib/ddns/update_cloudflare_com_v4.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/cloudflare.com-v4.json \ + $(1)/usr/share/ddns/default/ +endef + +define Package/ddns-scripts-cloudflare/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 +endef + + +define Package/ddns-scripts-gcp/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) ./files/usr/lib/ddns/update_gcp_v1.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/cloud.google.com-v1.json \ + $(1)/usr/share/ddns/default/ +endef + +define Package/ddns-scripts-gcp/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 +endef + + +define Package/ddns-scripts-freedns/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) ./files/usr/lib/ddns/update_freedns_42_pl.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/freedns.42.pl.json \ + $(1)/usr/share/ddns/default +endef + +define Package/ddns-scripts-freedns/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 +endef + + +define Package/ddns-scripts-godaddy/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) ./files/usr/lib/ddns/update_godaddy_com_v1.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/godaddy.com-v1.json \ + $(1)/usr/share/ddns/default +endef + +define Package/ddns-scripts-godaddy/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 +endef + + +define Package/ddns-scripts-digitalocean/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) ./files/usr/lib/ddns/update_digitalocean_com_v2.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/digitalocean.com-v2.json \ + $(1)/usr/share/ddns/default +endef + +define Package/ddns-scripts-digitalocean/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 +endef + + +define Package/ddns-scripts-dnspod/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) ./files/usr/lib/ddns/update_dnspod_cn.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/dnspod.cn.json \ + $(1)/usr/share/ddns/default/ +endef + +define Package/ddns-scripts-dnspod/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 +endef + + +define Package/ddns-scripts-noip/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) ./files/usr/lib/ddns/update_no-ip_com.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/no-ip.com.json \ + $(1)/usr/share/ddns/default +endef + +define Package/ddns-scripts-noip/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 +endef + + +define Package/ddns-scripts-ns1/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) ./files/usr/lib/ddns/update_ns1_com.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/ns1.com.json \ + $(1)/usr/share/ddns/default +endef + +define Package/ddns-scripts-ns1/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 +endef + + +define Package/ddns-scripts-nsupdate/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) ./files/usr/lib/ddns/update_nsupdate.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/bind-nsupdate.json \ + $(1)/usr/share/ddns/default +endef + +define Package/ddns-scripts-nsupdate/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 +endef + + +define Package/ddns-scripts-route53/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) ./files/usr/lib/ddns/update_route53_v1.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/route53-v1.json \ + $(1)/usr/share/ddns/default +endef + +define Package/ddns-scripts-route53/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 +endef + + +define Package/ddns-scripts-cnkuai/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) ./files/usr/lib/ddns/update_cnkuai_cn.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/cnkuai.cn.json \ + $(1)/usr/share/ddns/default endef -###### ************************************************************************* -define Package/ddns-scripts_cloudflare.com-v4/preinst - #!/bin/sh - # if NOT run buildroot then stop service - [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 - exit 0 # suppress errors +define Package/ddns-scripts-cnkuai/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 endef -define Package/ddns-scripts_cloudflare.com-v4/install - $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_cloudflare.com-v4 + + +define Package/ddns-scripts-gandi/install $(INSTALL_DIR) $(1)/usr/lib/ddns - $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_cloudflare_com_v4.sh $(1)/usr/lib/ddns -endef -define Package/ddns-scripts_cloudflare.com-v4/postinst - #!/bin/sh - # remove old services file entries - /bin/sed -i '/cloudflare\.com-v4/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 - /bin/sed -i '/cloudflare\.com-v4/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1 - # and create new - printf "%s\\t%s\\n" '"cloudflare.com-v4"' '"update_cloudflare_com_v4.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services - printf "%s\\t%s\\n" '"cloudflare.com-v4"' '"update_cloudflare_com_v4.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6 - # on real system restart service if enabled - [ -z "$${IPKG_INSTROOT}" ] && { - [ -x /etc/uci-defaults/ddns_cloudflare.com-v4 ] && \ - /etc/uci-defaults/ddns_cloudflare.com-v4 && \ - rm -f /etc/uci-defaults/ddns_cloudflare.com-v4 >/dev/null 2>&1 - /etc/init.d/ddns enabled && \ - /etc/init.d/ddns start >/dev/null 2>&1 - } - exit 0 # suppress errors -endef -define Package/ddns-scripts_cloudflare.com-v4/prerm - #!/bin/sh - # if NOT run buildroot then stop service - [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 - # remove services file entries - /bin/sed -i '/cloudflare\.com-v4/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 - /bin/sed -i '/cloudflare\.com-v4/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1 - exit 0 # suppress errors -endef - -###### ************************************************************************* -define Package/ddns-scripts_freedns_42_pl/preinst - #!/bin/sh - # if NOT run buildroot then stop service - [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 - exit 0 # suppress errors -endef -define Package/ddns-scripts_freedns_42_pl/install - $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_freedns_42_pl + $(INSTALL_BIN) ./files/usr/lib/ddns/update_gandi_net.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/gandi.net.json \ + $(1)/usr/share/ddns/default +endef + +define Package/ddns-scripts-gandi/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 +endef + + +define Package/ddns-scripts-pdns/install $(INSTALL_DIR) $(1)/usr/lib/ddns - $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_freedns_42_pl.sh $(1)/usr/lib/ddns -endef -define Package/ddns-scripts_freedns_42_pl/postinst - #!/bin/sh - # remove old services file entries - /bin/sed -i '/freedns\.42\.pl/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 - # and create new - printf "%s\\t%s\\n" '"freedns.42.pl"' '"update_freedns_42_pl.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services - # on real system restart service if enabled - [ -z "$${IPKG_INSTROOT}" ] && { - [ -x /etc/uci-defaults/ddns_freedns_42_pl ] && \ - /etc/uci-defaults/ddns_freedns_42_pl && \ - rm -f /etc/uci-defaults/ddns_freedns_42_pl >/dev/null 2>&1 - /etc/init.d/ddns enabled && \ - /etc/init.d/ddns start >/dev/null 2>&1 - } - exit 0 # suppress errors -endef -define Package/ddns-scripts_freedns_42_pl/prerm - #!/bin/sh - # if NOT run buildroot then stop service - [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 - # remove services file entries - /bin/sed -i '/freedns\.42\.pl/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 - exit 0 # suppress errors -endef - -###### ************************************************************************* -define Package/ddns-scripts_godaddy.com-v1/preinst - #!/bin/sh - # if NOT run buildroot then stop service - [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 - exit 0 # suppress errors -endef -define Package/ddns-scripts_godaddy.com-v1/install - $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_godaddy.com-v1 + $(INSTALL_BIN) ./files/usr/lib/ddns/update_pdns.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/pdns.json \ + $(1)/usr/share/ddns/default +endef + +define Package/ddns-scripts-pdns/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 +endef + + +define Package/ddns-scripts-transip/install $(INSTALL_DIR) $(1)/usr/lib/ddns - $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_godaddy_com_v1.sh $(1)/usr/lib/ddns -endef -define Package/ddns-scripts_godaddy.com-v1/postinst - #!/bin/sh - # remove old services file entries - /bin/sed -i '/godaddy\.com-v1/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 - /bin/sed -i '/godaddy\.com-v1/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1 - # and create new - printf "%s\\t%s\\n" '"godaddy.com-v1"' '"update_godaddy_com_v1.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services - printf "%s\\t%s\\n" '"godaddy.com-v1"' '"update_godaddy_com_v1.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6 - # on real system restart service if enabled - [ -z "$${IPKG_INSTROOT}" ] && { - [ -x /etc/uci-defaults/ddns_godaddy.com-v1 ] && \ - /etc/uci-defaults/ddns_godaddy.com-v1 && \ - rm -f /etc/uci-defaults/ddns_godaddy.com-v1 >/dev/null 2>&1 - /etc/init.d/ddns enabled \ - && /etc/init.d/ddns start >/dev/null 2>&1 - } - exit 0 # suppress errors -endef -define Package/ddns-scripts_godaddy.com-v1/prerm - #!/bin/sh - # if NOT run buildroot then stop service - [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 - # remove services file entries - /bin/sed -i '/godaddy\.com-v1/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 - /bin/sed -i '/godaddy\.com-v1/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1 - exit 0 # suppress errors -endef - -###### ************************************************************************* -define Package/ddns-scripts_no-ip_com/preinst - #!/bin/sh - # if NOT run buildroot then stop service - [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 - exit 0 # suppress errors -endef -define Package/ddns-scripts_no-ip_com/install - $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_no-ip_com + $(INSTALL_BIN) ./files/usr/lib/ddns/update_transip_nl.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/transip.nl.json \ + $(1)/usr/share/ddns/default +endef + +define Package/ddns-scripts-transip/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 +endef + + +define Package/ddns-scripts-one/install $(INSTALL_DIR) $(1)/usr/lib/ddns - $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_no-ip_com.sh $(1)/usr/lib/ddns -endef -define Package/ddns-scripts_no-ip_com/postinst - #!/bin/sh - # remove old services file entries - /bin/sed -i '/no-ip\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 - # and create new - printf "%s\\t%s\\n" '"no-ip.com"' '"update_no-ip_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services - # on real system restart service if enabled - [ -z "$${IPKG_INSTROOT}" ] && { - [ -x /etc/uci-defaults/ddns_no-ip_com ] && \ - /etc/uci-defaults/ddns_no-ip_com && \ - rm -f /etc/uci-defaults/ddns_no-ip_com >/dev/null 2>&1 - /etc/init.d/ddns enabled && \ - /etc/init.d/ddns start >/dev/null 2>&1 - } - exit 0 # suppress errors -endef -define Package/ddns-scripts_no-ip_com/prerm - #!/bin/sh - # if NOT run buildroot then stop service - [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 - # remove services file entries - /bin/sed -i '/no-ip\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 - exit 0 # suppress errors -endef - -###### ************************************************************************* -define Package/ddns-scripts_nsupdate/preinst - #!/bin/sh - # if NOT run buildroot then stop service - [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 - exit 0 # suppress errors -endef -define Package/ddns-scripts_nsupdate/install - $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_nsupdate + $(INSTALL_BIN) ./files/usr/lib/ddns/update_one_com.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/one.com.json \ + $(1)/usr/share/ddns/default +endef + +define Package/ddns-scripts-one/prerm +#!/bin/sh +if [-z "${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 +endef + + +define Package/ddns-scripts-porkbun/install $(INSTALL_DIR) $(1)/usr/lib/ddns - $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_nsupdate.sh $(1)/usr/lib/ddns -endef -define Package/ddns-scripts_nsupdate/postinst - #!/bin/sh - # remove old services file entries - /bin/sed -i '/bind-nsupdate/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 - /bin/sed -i '/bind-nsupdate/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1 - # and create new - printf "%s\\t%s\\n" '"bind-nsupdate"' '"update_nsupdate.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services - printf "%s\\t%s\\n" '"bind-nsupdate"' '"update_nsupdate.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6 - # on real system restart service if enabled - [ -z "$${IPKG_INSTROOT}" ] && { - [ -x /etc/uci-defaults/ddns_nsupdate ] && \ - /etc/uci-defaults/ddns_nsupdate && \ - rm -f /etc/uci-defaults/ddns_nsupdate >/dev/null 2>&1 - /etc/init.d/ddns enabled && \ - /etc/init.d/ddns start >/dev/null 2>&1 - } - exit 0 # suppress errors -endef -define Package/ddns-scripts_nsupdate/prerm - #!/bin/sh - # if NOT run buildroot then stop service - [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 - # remove services file entries - /bin/sed -i '/bind-nsupdate/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 - /bin/sed -i '/bind-nsupdate/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1 - exit 0 # suppress errors -endef - -###### ************************************************************************* -define Package/ddns-scripts_route53-v1/preinst - #!/bin/sh - # if NOT run buildroot then stop service - [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 - exit 0 # suppress errors -endef -define Package/ddns-scripts_route53-v1/install - $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_route53-v1 + $(INSTALL_BIN) ./files/usr/lib/ddns/update_porkbun_v3.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/porkbun.com-v3.json \ + $(1)/usr/share/ddns/default/ +endef + +define Package/ddns-scripts-porkbun/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 +endef + + +define Package/ddns-scripts-huaweicloud/install $(INSTALL_DIR) $(1)/usr/lib/ddns - $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_route53_v1.sh $(1)/usr/lib/ddns -endef -define Package/ddns-scripts_route53-v1/postinst - #!/bin/sh - # remove old services file entries - /bin/sed -i '/route53-v1/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 - /bin/sed -i '/route53-v1/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1 - # and create new - printf "%s\\t%s\\n" '"route53-v1"' '"update_route53_v1.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services - printf "%s\\t%s\\n" '"route53-v1"' '"update_route53_v1.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6 - # on real system restart service if enabled - [ -z "$${IPKG_INSTROOT}" ] && { - [ -x /etc/uci-defaults/ddns_route53-v1 ] && \ - /etc/uci-defaults/ddns_route53-v1 && \ - rm -f /etc/uci-defaults/route53.com-v1 >/dev/null 2>&1 - /etc/init.d/ddns enabled \ - && /etc/init.d/ddns start >/dev/null 2>&1 - } - exit 0 # suppress errors -endef -define Package/ddns-scripts_route53-v1/prerm - #!/bin/sh - # if NOT run buildroot then stop service - [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 - # remove services file entries - /bin/sed -i 'route53-v1/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 - /bin/sed -i 'route53-v1/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1 - exit 0 # suppress errors -endef - -###### ************************************************************************* + $(INSTALL_BIN) ./files/usr/lib/ddns/update_huaweicloud_com.sh \ + $(1)/usr/lib/ddns + + $(INSTALL_DIR) $(1)/usr/share/ddns/default + $(INSTALL_DATA) ./files/usr/share/ddns/default/huaweicloud.com.json \ + $(1)/usr/share/ddns/default/ +endef + +define Package/ddns-scripts-huaweicloud/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/ddns stop +fi +exit 0 +endef + + $(eval $(call BuildPackage,ddns-scripts)) -$(eval $(call BuildPackage,ddns-scripts_cloudflare.com-v4)) -$(eval $(call BuildPackage,ddns-scripts_freedns_42_pl)) -$(eval $(call BuildPackage,ddns-scripts_godaddy.com-v1)) -$(eval $(call BuildPackage,ddns-scripts_no-ip_com)) -$(eval $(call BuildPackage,ddns-scripts_nsupdate)) -$(eval $(call BuildPackage,ddns-scripts_route53-v1)) +$(eval $(call BuildPackage,ddns-scripts-services)) +$(eval $(call BuildPackage,ddns-scripts-utils)) +$(eval $(call BuildPackage,ddns-scripts-luadns)) +$(eval $(call BuildPackage,ddns-scripts-cloudflare)) +$(eval $(call BuildPackage,ddns-scripts-gcp)) +$(eval $(call BuildPackage,ddns-scripts-freedns)) +$(eval $(call BuildPackage,ddns-scripts-godaddy)) +$(eval $(call BuildPackage,ddns-scripts-digitalocean)) +$(eval $(call BuildPackage,ddns-scripts-dnspod)) +$(eval $(call BuildPackage,ddns-scripts-noip)) +$(eval $(call BuildPackage,ddns-scripts-nsupdate)) +$(eval $(call BuildPackage,ddns-scripts-route53)) +$(eval $(call BuildPackage,ddns-scripts-cnkuai)) +$(eval $(call BuildPackage,ddns-scripts-gandi)) +$(eval $(call BuildPackage,ddns-scripts-pdns)) +$(eval $(call BuildPackage,ddns-scripts-transip)) +$(eval $(call BuildPackage,ddns-scripts-ns1)) +$(eval $(call BuildPackage,ddns-scripts-one)) +$(eval $(call BuildPackage,ddns-scripts-porkbun)) +$(eval $(call BuildPackage,ddns-scripts-huaweicloud)) diff --git a/net/ddns-scripts/files/ddns.config b/net/ddns-scripts/files/ddns.config deleted file mode 100644 index 2f3ed52249..0000000000 --- a/net/ddns-scripts/files/ddns.config +++ /dev/null @@ -1,9 +0,0 @@ -# -# Please read http://wiki.openwrt.org/doc/uci/ddns -# -config ddns "global" - option ddns_dateformat "%F %R" -# option ddns_rundir "/var/run/ddns" -# option ddns_logdir "/var/log/ddns" - option ddns_loglines "250" - option upd_privateip "0" diff --git a/net/ddns-scripts/files/ddns.defaults b/net/ddns-scripts/files/ddns.defaults deleted file mode 100755 index 7e551d0fb2..0000000000 --- a/net/ddns-scripts/files/ddns.defaults +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/sh - -g_pslfile=/usr/share/public_suffix_list.dat.gz -[ -f "$g_pslfile" ] || g_pslfile="$(dirname $0)/public_suffix_list.dat.gz" - -g_pslerr=0 -g_cfgfile="ddns" - -# modify timer settings from interval and unit to dhms format -timer2dhms() { -# $1 Number and -# $2 Unit of time interval - local t=0 - case $2 in - days) t=$(( $1 * 86400 ));; - hours) t=$(( $1 * 3600 ));; - minutes) t=$(( $1 * 60 ));; - *) t=$1;; - esac - - local d=$(( $t / 86400 )) - local h=$(( $t % 86400 / 3600 )) - local m=$(( $t % 3600 / 60 )) - local s=$(( $t % 60 )) - if [ $d -gt 0 ]; then printf "%dd %02dh %02dm %02ds" "$d" "$h" "$m" "$s" - elif [ $h -gt 0 ]; then printf "%dh %02dm %02ds" "$h" "$m" "$s" - elif [ $m -gt 0 ]; then printf "%dm %02ds" "$m" "$s" - else printf "%ds" "$s"; fi - - unset d h m s t - return 0 -} - -# using function to not confuse function calls with existing ones inside /lib/functions.sh -update_config() { - uc_uci="$(which uci) -q" # ignore errors - uc_cfg="" - uc_name="" - uc_var="" - uc_val="" - package() { return 0; } - config () { - uc_cfg="$1" - uc_name="$2" - - # Type = ddns Name = global - if [ "$uc_cfg" = "$g_cfgfile" -a "$uc_name" = "global" ]; then - option() { - uc_var="$1"; shift - uc_val="$*" - case "$uc_var" in - allow_local_ip) $uc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_privateip";; - date_format) $uc_uci rename $g_cfgfile.$uc_name.$uc_var="ddns_dateformat";; - log_lines) $uc_uci rename $g_cfgfile.$uc_name.$uc_var="ddns_loglines";; - log_dir) $uc_uci rename $g_cfgfile.$uc_name.$uc_var="ddns_logdir";; - run_dir) $uc_uci rename $g_cfgfile.$uc_name.$uc_var="ddns_rundir";; - # leave all other options currently unchanged - *) ;; - esac - } - - # Type = service Name = ??? - elif [ "$uc_cfg" = "service" ]; then - option() { - uc_var="$1"; shift - uc_val="$*" - case "$uc_var" in - # fix some option service_name values - # and some settings for specific providers - service_name|upd_provider) - case "$uc_val" in - freedns\.afraid\.org|afraid\.org) - $uc_uci set $g_cfgfile.$uc_name.$uc_var="afraid.org-keyauth";; - Bind-nsupdate) - $uc_uci set $g_cfgfile.$uc_name.$uc_var="bind-nsupdate";; - dyndns\.org|dyndns\.com) - $uc_uci set $g_cfgfile.$uc_name.$uc_var="dyn.com";; - free\.editdns\.net) - $uc_uci set $g_cfgfile.$uc_name.$uc_var="editdns.net";; - FreeDNS\.42\.pl) - $uc_uci set $g_cfgfile.$uc_name.$uc_var="freedns.42.pl";; - domains\.google\.com) - $uc_uci set $g_cfgfile.$uc_name.$uc_var="google.com";; - loopia\.com) - $uc_uci set $g_cfgfile.$uc_name.$uc_var="loopia.se";; - NoIP\.com|No-IP\.com) - $uc_uci set $g_cfgfile.$uc_name.$uc_var="no-ip.com";; - spdns\.de) - $uc_uci set $g_cfgfile.$uc_name.$uc_var="spdyn.de";; - strato\.de) - $uc_uci set $g_cfgfile.$uc_name.$uc_var="strato.com";; - *) - # all others leave unchanged - ;; - esac - # rename option service_name to option upd_provider -# $uc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_provider" - ;; - domain|upd_object) - # verify if lookup_host is set - $uc_uci get $g_cfgfile.$uc_name.lookup_host >/dev/null 2>&1 || \ - $uc_uci set $g_cfgfile.$uc_name.lookup_host="$uc_val" - if [ -f "$g_pslfile" ]; then - # if service_name/upd_provider cloudflare_v1 then change domain/upd_object to new syntax - # there is no sort order inside uci data so we need multiple checks - uco_provider=$($uc_uci get $g_cfgfile.$uc_name.upd_provider 2>/dev/null) || \ - uco_provider=$($uc_uci get $g_cfgfile.$uc_name.service_name 2>/dev/null) - unset uco_provider - fi - # rename option domain to option upd_object -# $uc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_object" - ;; -# dns_server) -# # if bind-nsupdate takeover old "dns_server" value as new "upd_nsupd_server" value -# uco_provider=$($uc_uci get $g_cfgfile.$uc_name.upd_provider 2>/dev/null) || \ -# uco_provider=$($uc_uci get $g_cfgfile.$uc_name.service_name 2>/dev/null) -# [ "$uco_provider" = "Bind-nsupdate" -o \ -# "$uco_provider" = "bind-nsupdate" ] && \ -# $uc_uci set $g_cfgfile.$uc_name.upd_nsupd_server="$uc_val" -# # rename option dns_server to new option global_dnssvr -# $udc_uci rename $g_cfgfile.$uc_name.$uc_var="global_dnssvr" -# ;; -# bind_network) -# $udc_uci set $g_cfgfile.$uc_name.upd_url_bindnet="$uc_val" -# $udc_uci rename $g_cfgfile.$uc_name.$uc_var="lip_url_bindnet" -# ;; -# proxy) -# # proxy value must include protocoll -# $udc_uci set $g_cfgfile.$uc_name.$uc_var="http://$uc_val" -# $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_url_proxy" -# ;; -# use_ipv6) -# $udc_uci set $g_cfgfile.$uc_name.$uc_var="$(( 4 + ( 2 * $uc_val ) ))" -# $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_ipversion" -# TODO update_url) -# TODO update_script) - # other renames -# TODO lookup_host) -> rip_host -# enabled) $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_enabled";; -# force_dnstcp) $udc_uci rename $g_cfgfile.$uc_name.$uc_var="rip_host_dnstcp";; -# is_glue) $udc_uci rename $g_cfgfile.$uc_name.$uc_var="rip_host_isglue";; -# ip_interface) $udc_uci rename $g_cfgfile.$uc_name.$uc_var="lip_iface";; -# ip_network) $udc_uci rename $g_cfgfile.$uc_name.$uc_var="lip_net";; -# use_https) $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_url_secure";; -# cacert) $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_url_cacert";; -# username) $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_username";; -# password) $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_password";; -# param_opt) $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_paramopt";; -# param_enc) $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_paramenc";; - - # leave all other options currently unchanged - *) ;; - esac - return 0 - } - return 0 - - # ignore unknown - else - return 0 - fi - } - - # read config file - uc_data=$($uc_uci -S -n export "$g_cfgfile") - uc_ret="$?" - # Error then create config file - [ $uc_ret -ne 0 ] && { - touch /etc/config/$uc_cfgfile - chmod 644 /etc/config/$uc_cfgfile - } - # No error and uc_data then execute (eval) - # this will call functions defined above - [ $uc_ret -eq 0 -a -n "$uc_data" ] && eval "$uc_data" - - # add config ddns "global" (ignore error if exists) - $uc_uci set ddns.global="$g_cfgfile" - - # write changes to config file - $uc_uci commit "$g_cfgfile" - - unset uc_uci uc_cfg uc_name uc_var uc_val uc_ret uc_data - return 0 -} - -# clear LuCI indexcache -rm -f /tmp/luci-indexcache >/dev/null 2>&1 - -# do config update -update_config - -#cleanup -[ $g_pslerr -ne 0 ] && { - unset g_pslfile g_pslerr g_cfgfile - return 1 -} - -[ -f "$g_pslfile" ] && rm -f "$g_pslfile" -unset g_pslfile g_pslerr g_cfgfile -return 0 - diff --git a/net/ddns-scripts/files/etc/config/ddns b/net/ddns-scripts/files/etc/config/ddns new file mode 100644 index 0000000000..b45855f0d0 --- /dev/null +++ b/net/ddns-scripts/files/etc/config/ddns @@ -0,0 +1,32 @@ +# +# Please read https://openwrt.org/docs/guide-user/base-system/ddns +# +config ddns "global" + option ddns_dateformat "%F %R" +# option ddns_rundir "/var/run/ddns" +# option ddns_logdir "/var/log/ddns" + option ddns_loglines "250" + option upd_privateip "0" + + +config service "myddns_ipv4" + option service_name "dyndns.org" + option lookup_host "yourhost.example.com" + option domain "yourhost.example.com" + option username "your_username" + option password "your_password" + option interface "wan" + option ip_source "network" + option ip_network "wan" + +config service "myddns_ipv6" + option update_url "http://[USERNAME]:[PASSWORD]@your.provider.net/nic/update?hostname=[DOMAIN]&myip=[IP]" + option lookup_host "yourhost.example.com" + option domain "yourhost.example.com" + option username "your_username" + option password "your_password" + option use_ipv6 "1" + option interface "wan6" + option ip_source "network" + option ip_network "wan6" + diff --git a/net/ddns-scripts/files/ddns.hotplug b/net/ddns-scripts/files/etc/hotplug.d/iface/ddns old mode 100755 new mode 100644 similarity index 100% rename from net/ddns-scripts/files/ddns.hotplug rename to net/ddns-scripts/files/etc/hotplug.d/iface/ddns diff --git a/net/ddns-scripts/files/ddns.init b/net/ddns-scripts/files/etc/init.d/ddns old mode 100755 new mode 100644 similarity index 94% rename from net/ddns-scripts/files/ddns.init rename to net/ddns-scripts/files/etc/init.d/ddns index 49052eab6c..156ccb4e97 --- a/net/ddns-scripts/files/ddns.init +++ b/net/ddns-scripts/files/etc/init.d/ddns @@ -2,10 +2,6 @@ START=95 STOP=10 -boot() { - start "$@" -} - reload() { /usr/lib/ddns/dynamic_dns_updater.sh -- reload return 0 diff --git a/net/ddns-scripts/files/update_route53_v1.sh b/net/ddns-scripts/files/update_route53_v1.sh deleted file mode 100644 index 6b9b029e0a..0000000000 --- a/net/ddns-scripts/files/update_route53_v1.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/sh -#.Distributed under the terms of the GNU General Public License (GPL) version 2.0 -#.based on Yuval Adam's route53.sh found at https://github.com/yuvadm/route53-ddns/blob/master/route53.sh -#.2017 Max Berger -[ -z "$CURL_SSL" ] && write_log 14 "Amazon AWS Route53 communication require cURL with SSL support. Please install" -[ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing key as 'username'" -[ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing secret as 'password'" -[ -z "$domain" ] && write_log 14 "Service section not configured correctly! Missing zone id as 'domain'" - -set -euo pipefail -IFS=$'\n\t' - -ENDPOINT="route53.amazonaws.com" -RECORD_TTL=300 -RECORD_NAME="$lookup_host". -[ $use_ipv6 -eq 0 ] && RECORD_TYPE="A" -[ $use_ipv6 -eq 1 ] && RECORD_TYPE="AAAA" -RECORD_VALUE="$LOCAL_IP" -HOSTED_ZONE_ID="$domain" -API_PATH="/2013-04-01/hostedzone/${HOSTED_ZONE_ID}/rrset/" - -AWS_ACCESS_KEY_ID="$username" -AWS_SECRET_ACCESS_KEY="$password" -AWS_REGION='us-east-1' -AWS_SERVICE='route53' - -hash() { - msg=$1 - echo -en "$msg" | openssl dgst -sha256 | sed 's/^.* //' -} - -sign_plain() { - # Sign message using a plaintext key - key=$1 - msg=$2 - echo -en "$msg" | openssl dgst -hex -sha256 -hmac "$key" | sed 's/^.* //' -} - -sign() { - # Sign message using a hex formatted key - key=$1 - msg=$2 - echo -en "$msg" | openssl dgst -hex -sha256 -mac HMAC -macopt "hexkey:${key}" | sed 's/^.* //' -} - -request_body=" \ - \ - \ - \ - \ - UPSERT \ - \ - ${RECORD_NAME} \ - ${RECORD_TYPE} \ - ${RECORD_TTL} \ - \ - \ - ${RECORD_VALUE} \ - \ - \ - \ - \ - \ - \ -" - -fulldate=$(date --utc +%Y%m%dT%H%M%SZ) -shortdate=$(date --utc +%Y%m%d) -signed_headers="host;x-amz-date" -request_hash=$(hash "$request_body") -canonical_request="POST\n${API_PATH}\n\nhost:route53.amazonaws.com\nx-amz-date:${fulldate}\n\n${signed_headers}\n${request_hash}" - -date_key=$(sign_plain "AWS4${AWS_SECRET_ACCESS_KEY}" "${shortdate}") -region_key=$(sign "$date_key" $AWS_REGION) -service_key=$(sign "$region_key" $AWS_SERVICE) -signing_key=$(sign "$service_key" aws4_request) - -credential="${shortdate}/${AWS_REGION}/${AWS_SERVICE}/aws4_request" -sigmsg="AWS4-HMAC-SHA256\n${fulldate}\n${credential}\n$(hash "$canonical_request")" - -signature=$(sign "$signing_key" "$sigmsg") - -authorization="AWS4-HMAC-SHA256 Credential=${AWS_ACCESS_KEY_ID}/${credential}, SignedHeaders=${signed_headers}, Signature=${signature}" - -ANSWER=$(curl \ - -X "POST" \ - -H "Host: route53.amazonaws.com" \ - -H "X-Amz-Date: ${fulldate}" \ - -H "Authorization: ${authorization}" \ - -H "Content-Type: text/xml" \ - -d "$request_body" \ - "https://${ENDPOINT}${API_PATH}") -write_log 7 "${ANSWER}" - -echo ${ANSWER} | grep Error >/dev/null && return 1 -echo ${ANSWER} | grep ChangeInfo >/dev/null && return 0 -return 2 diff --git a/net/ddns-scripts/files/usr/bin/ddns.sh b/net/ddns-scripts/files/usr/bin/ddns.sh new file mode 100644 index 0000000000..921465f7e4 --- /dev/null +++ b/net/ddns-scripts/files/usr/bin/ddns.sh @@ -0,0 +1,172 @@ +#!/bin/sh +# +# Copyright (C) 2020 TDT AG +# +# This is free software, licensed under the GNU General Public License v2. +# See https://www.gnu.org/licenses/gpl-2.0.txt for more information. +# + +. /lib/functions.sh + +DDNS_PACKAGE_DIR="/usr/share/ddns" +URL="https://raw.githubusercontent.com/openwrt/packages/master/net/ddns-scripts/files" + +usage() { + local code="$1" + local msg="$2" + + echo "$msg" + echo "" + echo "Usage: $(basename "$0") " + echo "" + echo "Supported ddns :" + echo " service: Command for custom ddns service providers" + echo "" + echo "Supported ddns 'service' command :" + echo " update: Update local custom ddns service list" + echo " list-available: List all available custom service providers" + echo " list-installed: List all installed custom service providers" + echo " install : Install custom service provider" + echo " remove : Remove custom service provider" + echo " purge: Remove local custom ddns services" + + exit "$code" +} + +action_update() { + local cacert + + config_load ddns + config_get url global 'url' "${URL}${DDNS_PACKAGE_DIR}" + config_get cacert global 'cacert' "IGNORE" + url="${url}/list" + + mkdir -p "${DDNS_PACKAGE_DIR}" + + if [ "$cacert" = "IGNORE" ]; then + uclient-fetch \ + --no-check-certificate \ + "$url" \ + -O "${DDNS_PACKAGE_DIR}/list" + elif [ -f "$cacert" ]; then + uclient-fetch \ + --ca-certificate="${cacert}" \ + "$url" \ + -O "${DDNS_PACKAGE_DIR}/list" + elif [ -n "$cacert" ]; then + echo "Certification file not found ($cacert)" + exit 5 + fi +} + +action_list_available() { + if [ -f "${DDNS_PACKAGE_DIR}/list" ]; then + cat "${DDNS_PACKAGE_DIR}/list" + else + echo "No custom service list file found. Please download first" + exit 3 + fi +} + +action_list_installed() { + if [ -d "${DDNS_PACKAGE_DIR}/custom" ]; then + ls "${DDNS_PACKAGE_DIR}/custom" + else + echo "No custom services installed" + exit 4 + fi +} + +action_install() { + local service="$1" + + local url cacert + + config_load ddns + config_get url global 'url' "${URL}${DDNS_PACKAGE_DIR}/default" + config_get cacert global 'cacert' "IGNORE" + url="${url}/${service}.json" + + if [ -z "$service" ]; then + usage "4" "No custom service specified" + fi + + mkdir -p "${DDNS_PACKAGE_DIR}/custom" + + if [ "$cacert" = "IGNORE" ]; then + uclient-fetch \ + --no-check-certificate \ + "${url}" \ + -O "${DDNS_PACKAGE_DIR}/custom/${service}.json" + elif [ -f "$cacert" ]; then + uclient-fetch \ + --ca-certifcate="${cacert}" \ + "${url}" \ + -O "${DDNS_PACKAGE_DIR}/custom/${service}.json" + elif [ -n "$cacert" ]; then + echo "Certification file not found ($cacert)" + exit 5 + fi +} + +action_remove() { + local service="$1" + if [ -z "$service" ]; then + usage "4" "No custom service specified" + fi + + rm "${DDNS_PACKAGE_DIR}/custom/${service}.json" +} + +action_purge() { + rm -rf "${DDNS_PACKAGE_DIR}/custom" + rm -rf "${DDNS_PACKAGE_DIR}/list" +} + +sub_service() { + local action="$1" + local service="$2" + + case "$action" in + update) + action_update + ;; + list-available) + action_list_available + ;; + list-installed) + action_list_installed + ;; + purge) + action_purge + ;; + install) + action_install "$service" + ;; + remove) + action_remove "$service" + ;; + *) + usage "2" "Action not supported" + ;; + esac +} + +main() { + local cmd="$1" + local action="$2" + local service="$3" + + [ "$#" -eq 0 ] && usage "1" + + case "${cmd}" in + service) + sub_service "${action}" "${service}" + ;; + *) + usage "1" "Command not supported" + ;; + esac +} + +main "$@" diff --git a/net/ddns-scripts/files/dynamic_dns_functions.sh b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh old mode 100755 new mode 100644 similarity index 84% rename from net/ddns-scripts/files/dynamic_dns_functions.sh rename to net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh index 5a76166e30..7202469c62 --- a/net/ddns-scripts/files/dynamic_dns_functions.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh @@ -21,9 +21,14 @@ . /lib/functions/network.sh # GLOBAL VARIABLES # -VERSION="2.7.8-1" +if [ -f "/usr/share/ddns/version" ]; then + VERSION="$(cat "/usr/share/ddns/version")" +else + VERSION="unknown" +fi SECTION_ID="" # hold config's section name VERBOSE=0 # default mode is log to console, but easily changed with parameter +DRY_RUN=0 # run without actually doing (sending) any changes MYPROG=$(basename $0) # my program call name LOGFILE="" # logfile - all files are set in dynamic_dns_updater.sh @@ -43,8 +48,8 @@ CURR_TIME=0 # holds the current uptime NEXT_TIME=0 # calculated time for next FORCED update EPOCH_TIME=0 # seconds since 1.1.1970 00:00:00 +CURRENT_IP="" # holds the current IP read from the box REGISTERED_IP="" # holds the IP read from DNS -LOCAL_IP="" # holds the local IP read from the box URL_USER="" # url encoded $username from config file URL_PASS="" # url encoded $password from config file @@ -53,7 +58,7 @@ URL_PENC="" # url encoded $param_enc from config file UPD_ANSWER="" # Answer given by service on success ERR_LAST=0 # used to save $? return code of program and function calls -ERR_UPDATE=0 # error counter on different local and registered ip +RETRY_COUNT=0 # error counter on different current and registered IPs PID_SLEEP=0 # ProcessID of current background "sleep" @@ -63,31 +68,36 @@ IPV4_REGEX="[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}" # IPv6 ( ( 0-9a-f 1-4char ":") min 1x) ( ( 0-9a-f 1-4char )optional) ( (":" 0-9a-f 1-4char ) min 1x) IPV6_REGEX="\(\([0-9A-Fa-f]\{1,4\}:\)\{1,\}\)\(\([0-9A-Fa-f]\{1,4\}\)\{0,1\}\)\(\(:[0-9A-Fa-f]\{1,4\}\)\{1,\}\)" +# characters that are dangerous to pass to a shell command line +SHELL_ESCAPE="[\"\'\`\$\!();><{}?|\[\]\*\\\\]" + +# dns character set. "-" must be the last character +DNS_CHARSET="[@a-zA-Z0-9._-]" + +# domains can have * for wildcard. "-" must be the last character +DNS_CHARSET_DOMAIN="[@a-zA-Z0-9._*-]" + # detect if called by ddns-lucihelper.sh script, disable retrys (empty variable == false) LUCI_HELPER=$(printf %s "$MYPROG" | grep -i "luci") # Name Server Lookup Programs -BIND_HOST=$(which host) -KNOT_HOST=$(which khost) -DRILL=$(which drill) -HOSTIP=$(which hostip) -NSLOOKUP=$(which nslookup) +BIND_HOST=$(command -v host) +KNOT_HOST=$(command -v khost) +DRILL=$(command -v drill) +HOSTIP=$(command -v hostip) +NSLOOKUP=$(command -v nslookup) # Transfer Programs -WGET=$(which wget) -WGET_SSL=$(which wget-ssl) - -CURL=$(which curl) +WGET=$(command -v wget) +$WGET -V 2>/dev/null | grep -F -q +https && WGET_SSL=$WGET +CURL=$(command -v curl) +# CURL_SSL not empty then SSL support available +CURL_SSL=$($CURL -V 2>/dev/null | grep -F "https") # CURL_PROXY not empty then Proxy support available -if [ -f /tmp/vCURL_PROXY ]; then - CURL_PROXY=$(cat /tmp/vCURL_PROXY); -else - CURL_PROXY=$(find /lib /usr/lib -name libcurl.so* -exec strings {} 2>/dev/null \; | grep -im1 "all_proxy") - echo -n $CURL_PROXY >/tmp/vCURL_PROXY -fi +CURL_PROXY=$(find /lib /usr/lib -name libcurl.so* -exec strings {} 2>/dev/null \; | grep -im1 "all_proxy") -UCLIENT_FETCH=$(which uclient-fetch) +UCLIENT_FETCH=$(command -v uclient-fetch) # Global configuration settings # allow NON-public IP's @@ -280,11 +290,11 @@ write_log() { [ $__LEVEL -eq 7 ] && return # no syslog for debug messages __CMD=$(echo -e "$__CMD" | tr -d '\n' | tr '\t' ' ') # remove \n \t chars [ $__EXIT -eq 1 ] && { - $__CMD # force syslog before exit + eval '$__CMD' # force syslog before exit exit 1 } [ $use_syslog -eq 0 ] && return - [ $((use_syslog + __LEVEL)) -le 7 ] && $__CMD + [ $((use_syslog + __LEVEL)) -le 7 ] && eval '$__CMD' return } @@ -299,74 +309,61 @@ write_log() { urlencode() { # $1 Name of Variable to store encoded string to # $2 string to encode - local __STR __LEN __CHAR __OUT - local __ENC="" - local __POS=1 + local __ENC [ $# -ne 2 ] && write_log 12 "Error calling 'urlencode()' - wrong number of parameters" - __STR="$2" # read string to encode - __LEN=${#__STR} # get string length - - while [ $__POS -le $__LEN ]; do - # read one chat of the string - __CHAR=$(expr substr "$__STR" $__POS 1) - - case "$__CHAR" in - [-_.~a-zA-Z0-9] ) - # standard char - __OUT="${__CHAR}" - ;; - * ) - # special char get %hex code - __OUT=$(printf '%%%02x' "'$__CHAR" ) - ;; - esac - __ENC="${__ENC}${__OUT}" # append to encoded string - __POS=$(( $__POS + 1 )) # increment position - done + __ENC="$(awk -v str="$2" 'BEGIN{ORS="";for(i=32;i<=127;i++)lookup[sprintf("%c",i)]=i + for(k=1;k<=length(str);++k){enc=substr(str,k,1);if(enc!~"[-_.~a-zA-Z0-9]")enc=sprintf("%%%02x", lookup[enc]);print enc}}')" eval "$1=\"$__ENC\"" # transfer back to variable return 0 } # extract url or script for given DDNS Provider from -# file /etc/ddns/services for IPv4 or from -# file /etc/ddns/services_ipv6 for IPv6 -# $1 Name of Variable to store url to -# $2 Name of Variable to store script to -# $3 Name of Variable to store service answer to +# $1 Name of the provider +# $2 Provider directory +# $3 Name of Variable to store url to +# $4 Name of Variable to store script to +# $5 Name of Variable to store service answer to get_service_data() { + local provider="$1" + shift + local dir="$1" + shift + + . /usr/share/libubox/jshn.sh + local name data url answer script + [ $# -ne 3 ] && write_log 12 "Error calling 'get_service_data()' - wrong number of parameters" - __FILE="/etc/ddns/services" # IPv4 - [ $use_ipv6 -ne 0 ] && __FILE="/etc/ddns/services_ipv6" # IPv6 - - # workaround with variables; pipe create subshell with no give back of variable content - mkfifo pipe_$$ - # only grep without # or whitespace at linestart | remove " -# grep -v -E "(^#|^[[:space:]]*$)" $__FILE | sed -e s/\"//g > pipe_$$ & - sed '/^#/d; /^[ \t]*$/d; s/\"//g' $__FILE > pipe_$$ & - - while read __SERVICE __DATA __ANSWER; do - if [ "$__SERVICE" = "$service_name" ]; then - # check if URL or SCRIPT is given - __URL=$(echo "$__DATA" | grep "^http") - [ -z "$__URL" ] && __SCRIPT="/usr/lib/ddns/$__DATA" - - eval "$1=\"$__URL\"" - eval "$2=\"$__SCRIPT\"" - eval "$3=\"$__ANSWER\"" - rm pipe_$$ - return 0 - fi - done < pipe_$$ - rm pipe_$$ + [ -f "${dir}/${provider}.json" ] || { + eval "$1=\"\"" + eval "$2=\"\"" + eval "$3=\"\"" + return 1 + } - eval "$1=\"\"" # no service match clear variables - eval "$2=\"\"" - eval "$3=\"\"" - return 1 + json_load_file "${dir}/${provider}.json" + json_get_var name "name" + if [ "$use_ipv6" -eq "1" ]; then + json_select "ipv6" + else + json_select "ipv4" + fi + json_get_var data "url" + json_get_var answer "answer" + json_select ".." + json_cleanup + + # check if URL or SCRIPT is given + url=$(echo "$data" | grep "^http") + [ -z "$url" ] && script="/usr/lib/ddns/${data}" + + eval "$1=\"$url\"" + eval "$2=\"$script\"" + eval "$3=\"$answer\"" + return 0 } # Calculate seconds from interval and unit @@ -479,14 +476,35 @@ timeout() { return $status } +# sanitize a variable +# $1 variable name +# $2 allowed shell pattern +# $3 disallowed shell pattern +sanitize_variable() { + local __VAR=$1 + eval __VALUE=\$$__VAR + local __ALLOWED=$2 + local __REJECT=$3 + + # removing all allowed should give empty string + if [ -n "$__ALLOWED" ]; then + [ -z "${__VALUE//$__ALLOWED}" ] || write_log 12 "sanitize on $__VAR found characters outside allowed subset" + fi + + # removing rejected pattern should give the same string as the input + if [ -n "$__REJECT" ]; then + [ "$__VALUE" = "${__VALUE//$__REJECT}" ] || write_log 12 "sanitize on $__VAR found rejected characters" + fi +} + # verify given host and port is connectable # $1 Host/IP to verify # $2 Port to verify verify_host_port() { local __HOST=$1 local __PORT=$2 - local __NC=$(which nc) - local __NCEXT=$($(which nc) --help 2>&1 | grep "\-w" 2>/dev/null) # busybox nc compiled with extensions + local __NC=$(command -v nc) + local __NCEXT=$($(command -v nc) --help 2>&1 | grep "\-w" 2>/dev/null) # busybox nc compiled with extensions local __IP __IPV4 __IPV6 __RUNPROG __PROG __ERR # return codes # 1 system specific error @@ -529,18 +547,21 @@ verify_host_port() { return 2 } # extract IP address - if [ -n "$BIND_HOST" -o -n "$KNOT_HOST" ]; then # use BIND host or Knot host if installed - __IPV4=$(cat $DATFILE | awk -F "address " '/has address/ {print $2; exit}' ) - __IPV6=$(cat $DATFILE | awk -F "address " '/has IPv6/ {print $2; exit}' ) + if [ -n "$BIND_HOST" ]; then # use BIND host if installed + __IPV4="$(awk -F "address " '/has address/ {print $2; exit}' "$DATFILE")" + __IPV6="$(awk -F "address " '/has IPv6/ {print $2; exit}' "$DATFILE")" + elif [ -n "$KNOT_HOST" ]; then # use Knot host if installed + __IPV4="$(awk -F "address " '/has IPv4/ {print $2; exit}' "$DATFILE")" + __IPV6="$(awk -F "address " '/has IPv6/ {print $2; exit}' "$DATFILE")" elif [ -n "$DRILL" ]; then # use drill if installed - __IPV4=$(cat $DATFILE | awk '/^'"$lookup_host"'/ {print $5}' | grep -m 1 -o "$IPV4_REGEX") - __IPV6=$(cat $DATFILE | awk '/^'"$lookup_host"'/ {print $5}' | grep -m 1 -o "$IPV6_REGEX") + __IPV4="$(awk '/^'"$__HOST"'/ {print $5}' "$DATFILE" | grep -m 1 -o "$IPV4_REGEX")" + __IPV6="$(awk '/^'"$__HOST"'/ {print $5}' "$DATFILE" | grep -m 1 -o "$IPV6_REGEX")" elif [ -n "$HOSTIP" ]; then # use hostip if installed - __IPV4=$(cat $DATFILE | grep -m 1 -o "$IPV4_REGEX") - __IPV6=$(cat $DATFILE | grep -m 1 -o "$IPV6_REGEX") + __IPV4="$(grep -m 1 -o "$IPV4_REGEX" "$DATFILE")" + __IPV6="$(grep -m 1 -o "$IPV6_REGEX" "$DATFILE")" else # use BusyBox nslookup - __IPV4=$(cat $DATFILE | sed -ne "/^Name:/,\$ { s/^Address[0-9 ]\{0,\}: \($IPV4_REGEX\).*$/\\1/p }") - __IPV6=$(cat $DATFILE | sed -ne "/^Name:/,\$ { s/^Address[0-9 ]\{0,\}: \($IPV6_REGEX\).*$/\\1/p }") + __IPV4="$(sed -ne "/^Name:/,\$ { s/^Address[0-9 ]\{0,\}: \($IPV4_REGEX\).*$/\\1/p }" "$DATFILE")" + __IPV6="$(sed -ne "/^Name:/,\$ { s/^Address[0-9 ]\{0,\}: \($IPV6_REGEX\).*$/\\1/p }" "$DATFILE")" fi } @@ -610,11 +631,11 @@ verify_dns() { return $__ERR elif [ $__ERR -ne 0 ]; then __CNT=$(( $__CNT + 1 )) # increment error counter - # if error count > retry_count leave here - [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \ - write_log 14 "Verify DNS server '$1' failed after $retry_count retries" + # if error count > retry_max_count leave here + [ $retry_max_count -gt 0 -a $__CNT -gt $retry_max_count ] && \ + write_log 14 "Verify DNS server '$1' failed after $retry_max_count retries" - write_log 4 "Verify DNS server '$1' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds" + write_log 4 "Verify DNS server '$1' failed - retry $__CNT/$retry_max_count in $RETRY_SECONDS seconds" sleep $RETRY_SECONDS & PID_SLEEP=$! wait $PID_SLEEP # enable trap-handler @@ -670,11 +691,11 @@ verify_proxy() { return $__ERR elif [ $__ERR -gt 0 ]; then __CNT=$(( $__CNT + 1 )) # increment error counter - # if error count > retry_count leave here - [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \ - write_log 14 "Verify Proxy server '$1' failed after $retry_count retries" + # if error count > retry_max_count leave here + [ $retry_max_count -gt 0 -a $__CNT -gt $retry_max_count ] && \ + write_log 14 "Verify Proxy server '$1' failed after $retry_max_count retries" - write_log 4 "Verify Proxy server '$1' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds" + write_log 4 "Verify Proxy server '$1' failed - retry $__CNT/$retry_max_count in $RETRY_SECONDS seconds" sleep $RETRY_SECONDS & PID_SLEEP=$! wait $PID_SLEEP # enable trap-handler @@ -693,16 +714,19 @@ do_transfer() { [ $# -ne 1 ] && write_log 12 "Error in 'do_transfer()' - wrong number of parameters" + # Use ip_network as default for bind_network if not separately specified + [ -z "$bind_network" ] && [ "$ip_source" = "network" ] && [ "$ip_network" ] && bind_network="$ip_network" + # lets prefer GNU Wget because it does all for us - IPv4/IPv6/HTTPS/PROXY/force IP version - if [ -n "$WGET_SSL" -a $USE_CURL -eq 0 ]; then # except global option use_curl is set to "1" - __PROG="$WGET_SSL -nv -t 1 -O $DATFILE -o $ERRFILE" # non_verbose no_retry outfile errfile + if [ -n "$WGET_SSL" ] && [ $USE_CURL -eq 0 ]; then # except global option use_curl is set to "1" + __PROG="$WGET --hsts-file=/tmp/.wget-hsts -nv -t 1 -O $DATFILE -o $ERRFILE" # non_verbose no_retry outfile errfile # force network/ip to use for communication if [ -n "$bind_network" ]; then local __BINDIP # set correct program to detect IP [ $use_ipv6 -eq 0 ] && __RUNPROG="network_get_ipaddr" || __RUNPROG="network_get_ipaddr6" eval "$__RUNPROG __BINDIP $bind_network" || \ - write_log 13 "Can not detect local IP using '$__RUNPROG $bind_network' - Error: '$?'" + write_log 13 "Can not detect current IP using '$__RUNPROG $bind_network' - Error: '$?'" write_log 7 "Force communication via IP '$__BINDIP'" __PROG="$__PROG --bind-address=$__BINDIP" fi @@ -725,14 +749,19 @@ do_transfer() { # disable proxy if no set (there might be .wgetrc or .curlrc or wrong environment set) [ -z "$proxy" ] && __PROG="$__PROG --no-proxy" + # user agent string if provided + if [ -n "$user_agent" ]; then + # replace single and double quotes + user_agent=$(echo $user_agent | sed "s/'/ /g" | sed 's/"/ /g') + __PROG="$__PROG --user-agent='$user_agent'" + fi + __RUNPROG="$__PROG '$__URL'" # build final command __PROG="GNU Wget" # reuse for error logging # 2nd choice is cURL IPv4/IPv6/HTTPS # libcurl might be compiled without Proxy or HTTPS Support elif [ -n "$CURL" ]; then - # CURL_SSL not empty then SSL support available - CURL_SSL=$($(which curl) -V 2>/dev/null | grep "Protocols:" | grep -F "https") __PROG="$CURL -RsS -o $DATFILE --stderr $ERRFILE" # check HTTPS support [ -z "$CURL_SSL" -a $use_https -eq 1 ] && \ @@ -740,8 +769,8 @@ do_transfer() { # force network/interface-device to use for communication if [ -n "$bind_network" ]; then local __DEVICE - network_get_physdev __DEVICE $bind_network || \ - write_log 13 "Can not detect local device using 'network_get_physdev $bind_network' - Error: '$?'" + network_get_device __DEVICE $bind_network || \ + write_log 13 "Can not detect local device using 'network_get_device $bind_network' - Error: '$?'" write_log 7 "Force communication via device '$__DEVICE'" __PROG="$__PROG --interface $__DEVICE" fi @@ -776,13 +805,7 @@ do_transfer() { # uclient-fetch possibly with ssl support if /lib/libustream-ssl.so installed elif [ -n "$UCLIENT_FETCH" ]; then # UCLIENT_FETCH_SSL not empty then SSL support available - if [ -f /tmp/vUCLIENT_FETCH_SSL ]; then - UCLIENT_FETCH_SSL=$(cat /tmp/vCURL_PROXY); - else - UCLIENT_FETCH_SSL=$(find /lib /usr/lib -name libustream-ssl.so* 2>/dev/null) - echo -n $UCLIENT_FETCH_SSL >/tmp/vUCLIENT_FETCH_SSL - fi - + UCLIENT_FETCH_SSL=$(find /lib /usr/lib -name libustream-ssl.so* 2>/dev/null) __PROG="$UCLIENT_FETCH -q -O $DATFILE" # force network/ip not supported [ -n "$__BINDIP" ] && \ @@ -848,11 +871,11 @@ do_transfer() { } __CNT=$(( $__CNT + 1 )) # increment error counter - # if error count > retry_count leave here - [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \ - write_log 14 "Transfer failed after $retry_count retries" + # if error count > retry_max_count leave here + [ $retry_max_count -gt 0 -a $__CNT -gt $retry_max_count ] && \ + write_log 14 "Transfer failed after $retry_max_count retries" - write_log 4 "Transfer failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds" + write_log 4 "Transfer failed - retry $__CNT/$retry_max_count in $RETRY_SECONDS seconds" sleep $RETRY_SECONDS & PID_SLEEP=$! wait $PID_SLEEP # enable trap-handler @@ -904,26 +927,26 @@ send_update() { fi } -get_local_ip () { - # $1 Name of Variable to store local IP (LOCAL_IP) +get_current_ip () { + # $1 Name of Variable to store current IP local __CNT=0 # error counter local __RUNPROG __DATA __URL __ERR - [ $# -ne 1 ] && write_log 12 "Error calling 'get_local_ip()' - wrong number of parameters" - write_log 7 "Detect local IP on '$ip_source'" + [ $# -ne 1 ] && write_log 12 "Error calling 'get_current_ip()' - wrong number of parameters" + write_log 7 "Detect current IP on '$ip_source'" while : ; do - if [ -n "$ip_network" ]; then + if [ -n "$ip_network" -a "$ip_source" = "network" ]; then # set correct program network_flush_cache # force re-read data from ubus [ $use_ipv6 -eq 0 ] && __RUNPROG="network_get_ipaddr" \ || __RUNPROG="network_get_ipaddr6" eval "$__RUNPROG __DATA $ip_network" || \ - write_log 13 "Can not detect local IP using $__RUNPROG '$ip_network' - Error: '$?'" - [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected on network '$ip_network'" - elif [ -n "$ip_interface" ]; then + write_log 13 "Can not detect current IP using $__RUNPROG '$ip_network' - Error: '$?'" + [ -n "$__DATA" ] && write_log 7 "Current IP '$__DATA' detected on network '$ip_network'" + elif [ -n "$ip_interface" -a "$ip_source" = "interface" ]; then local __DATA4=""; local __DATA6="" - if [ -n "$(which ip)" ]; then # ip program installed + if [ -n "$(command -v ip)" ]; then # ip program installed write_log 7 "#> ip -o addr show dev $ip_interface scope global >$DATFILE 2>$ERRFILE" ip -o addr show dev $ip_interface scope global >$DATFILE 2>$ERRFILE __ERR=$? @@ -939,10 +962,17 @@ get_local_ip () { # 5: eth1 inet6 fd43:5368:6f6d:6500:a00:27ff:fed0:1032/64 scope global dynamic \ valid_lft 14352sec preferred_lft 14352sec # 5: eth1 inet6 2002:b0c7:f326::a00:27ff:fed0:1032/64 scope global dynamic \ valid_lft 14352sec preferred_lft 14352sec - # remove remove remove replace replace - # link inet6 fxxx sec forever=>-1 / => ' ' to separate subnet from ip - sed "/link/d; /inet6 f/d; s/sec//g; s/forever/-1/g; s/\// /g" $DATFILE | \ - awk '{ print $3" "$4" "$NF }' > $ERRFILE # temp reuse ERRFILE + if [ $upd_privateip -eq 0 ]; then + # remove remove remove replace replace + # link inet6 fxxx sec forever=>-1 / => ' ' to separate subnet from ip + sed "/link/d; /inet6 f/d; s/sec//g; s/forever/-1/g; s/\// /g" $DATFILE | \ + awk '{ print $3" "$4" "$NF }' > $ERRFILE # temp reuse ERRFILE + else + # remove remove replace replace + # link sec forever=>-1 / => ' ' to separate subnet from ip + sed "/link/d; s/sec//g; s/forever/-1/g; s/\// /g" $DATFILE | \ + awk '{ print $3" "$4" "$NF }' > $ERRFILE # temp reuse ERRFILE + fi # we only need inet? IP prefered time local __TIME4=0; local __TIME6=0 @@ -999,27 +1029,27 @@ get_local_ip () { fi fi [ $use_ipv6 -eq 0 ] && __DATA="$__DATA4" || __DATA="$__DATA6" - [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected on interface '$ip_interface'" - elif [ -n "$ip_script" ]; then + [ -n "$__DATA" ] && write_log 7 "Current IP '$__DATA' detected on interface '$ip_interface'" + elif [ -n "$ip_script" -a "$ip_source" = "script" ]; then write_log 7 "#> $ip_script >$DATFILE 2>$ERRFILE" eval $ip_script >$DATFILE 2>$ERRFILE __ERR=$? if [ $__ERR -eq 0 ]; then __DATA=$(cat $DATFILE) - [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected via script '$ip_script'" + [ -n "$__DATA" ] && write_log 7 "Current IP '$__DATA' detected via script '$ip_script'" else write_log 3 "$ip_script Error: '$__ERR'" write_log 7 "$(cat $ERRFILE)" # report error fi - elif [ -n "$ip_url" ]; then + elif [ -n "$ip_url" -a "$ip_source" = "web" ]; then do_transfer "$ip_url" # use correct regular expression [ $use_ipv6 -eq 0 ] \ && __DATA=$(grep -m 1 -o "$IPV4_REGEX" $DATFILE) \ || __DATA=$(grep -m 1 -o "$IPV6_REGEX" $DATFILE) - [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected on web at '$ip_url'" + [ -n "$__DATA" ] && write_log 7 "Current IP '$__DATA' detected on web at '$ip_url'" else - write_log 12 "Error in 'get_local_ip()' - unhandled ip_source '$ip_source'" + write_log 12 "Error in 'get_current_ip()' - unhandled ip_source '$ip_source'" fi # valid data found return here [ -n "$__DATA" ] && { @@ -1034,22 +1064,22 @@ get_local_ip () { [ $VERBOSE -gt 1 ] && { # VERBOSE > 1 then NO retry - write_log 4 "Get local IP via '$ip_source' failed - Verbose Mode: $VERBOSE - NO retry on error" + write_log 4 "Get current IP via '$ip_source' failed - Verbose Mode: $VERBOSE - NO retry on error" return 1 } __CNT=$(( $__CNT + 1 )) # increment error counter - # if error count > retry_count leave here - [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \ - write_log 14 "Get local IP via '$ip_source' failed after $retry_count retries" - write_log 4 "Get local IP via '$ip_source' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds" + # if error count > retry_max_count leave here + [ $retry_max_count -gt 0 -a $__CNT -gt $retry_max_count ] && \ + write_log 14 "Get current IP via '$ip_source' failed after $retry_max_count retries" + write_log 4 "Get current IP via '$ip_source' failed - retry $__CNT/$retry_max_count in $RETRY_SECONDS seconds" sleep $RETRY_SECONDS & PID_SLEEP=$! wait $PID_SLEEP # enable trap-handler PID_SLEEP=0 done # we should never come here there must be a programming error - write_log 12 "Error in 'get_local_ip()' - program coding error" + write_log 12 "Error in 'get_current_ip()' - program coding error" } get_registered_ip() { @@ -1126,7 +1156,7 @@ get_registered_ip() { __RUNPROG="$__PROG $lookup_host >$DATFILE 2>$ERRFILE" __PROG="hostip" elif [ -n "$NSLOOKUP" ]; then # last use BusyBox nslookup - NSLOOKUP_MUSL=$($(which nslookup) localhost 2>&1 | grep -F "(null)") # not empty busybox compiled with musl + NSLOOKUP_MUSL=$($(command -v nslookup) localhost 2>&1 | grep -F "(null)") # not empty busybox compiled with musl [ $force_dnstcp -ne 0 ] && \ write_log 14 "Busybox nslookup - no support for 'DNS over TCP'" [ -n "$NSLOOKUP_MUSL" -a -n "$dns_server" ] && \ @@ -1181,11 +1211,11 @@ get_registered_ip() { } __CNT=$(( $__CNT + 1 )) # increment error counter - # if error count > retry_count leave here - [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \ - write_log 14 "Get registered/public IP for '$lookup_host' failed after $retry_count retries" + # if error count > retry_max_count leave here + [ $retry_max_count -gt 0 -a $__CNT -gt $retry_max_count ] && \ + write_log 14 "Get registered/public IP for '$lookup_host' failed after $retry_max_count retries" - write_log 4 "Get registered/public IP for '$lookup_host' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds" + write_log 4 "Get registered/public IP for '$lookup_host' failed - retry $__CNT/$retry_max_count in $RETRY_SECONDS seconds" sleep $RETRY_SECONDS & PID_SLEEP=$! wait $PID_SLEEP # enable trap-handler diff --git a/net/ddns-scripts/files/dynamic_dns_lucihelper.sh b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_lucihelper.sh old mode 100755 new mode 100644 similarity index 97% rename from net/ddns-scripts/files/dynamic_dns_lucihelper.sh rename to net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_lucihelper.sh index ab3eb78e72..f76334848d --- a/net/ddns-scripts/files/dynamic_dns_lucihelper.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_lucihelper.sh @@ -137,11 +137,11 @@ case "$1" in if [ "$ip_source" = "web" -o "$ip_source" = "script" ]; then # we wait only 3 seconds for an # answer from "web" or "script" - write_log 7 "-----> timeout 3 -- get_local_ip IP" - timeout 3 -- get_local_ip IP + write_log 7 "-----> timeout 3 -- get_current_ip IP" + timeout 3 -- get_current_ip IP else - write_log 7 "-----> get_local_ip IP" - get_local_ip IP + write_log 7 "-----> get_current_ip IP" + get_current_ip IP fi __RET=$? ;; diff --git a/net/ddns-scripts/files/dynamic_dns_updater.sh b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh old mode 100755 new mode 100644 similarity index 84% rename from net/ddns-scripts/files/dynamic_dns_updater.sh rename to net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh index b84e82920b..e6f91e8ee0 --- a/net/ddns-scripts/files/dynamic_dns_updater.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh @@ -37,9 +37,7 @@ Parameters: '1' output to console '2' output to console AND logfile + run once WITHOUT retry on error - '3' output to console AND logfile - + run once WITHOUT retry on error - + NOT sending update to DDNS service + -d dry run (don't send any changes) EOF } @@ -50,10 +48,11 @@ usage_err() { exit 1 } -while getopts ":hv:n:S:V" OPT; do +while getopts ":hv:dn:S:V" OPT; do case "$OPT" in h) usage; exit 0;; v) VERBOSE=$OPTARG;; + d) DRY_RUN=1;; n) NETWORK=$OPTARG;; S) SECTION_ID=$OPTARG;; V) printf %s\\n "ddns-scripts $VERSION"; exit 0;; @@ -90,7 +89,7 @@ case "$1" in exit 1 ;; reload) - killall -1 dynamic_dns_updater.sh 2>/dev/null + killall dynamic_dns_updater.sh 2>/dev/null exit $? ;; *) usage_err "unknown command - $1";; @@ -108,6 +107,8 @@ LOGFILE="$ddns_logdir/$SECTION_ID.log" # log file # only with this data of this run for easier diagnostic # new one created by write_log function [ $VERBOSE -gt 1 -a -f $LOGFILE ] && rm -f $LOGFILE +# Previously -v 3 could we used for dry run +[ $VERBOSE -ge 3 ] && DRY_RUN=1 # TRAP handler trap "trap_handler 0 \$?" 0 # handle script exit with exit status @@ -145,10 +146,10 @@ trap "trap_handler 15" 15 # SIGTERM Termination # # use_syslog log activity to syslog # -# ip_source source to detect current local IP ('network' or 'web' or 'script' or 'interface') +# ip_source source to detect current IP ('network' or 'web' or 'script' or 'interface') # ip_network local defined network to read IP from i.e. 'wan' or 'wan6' -# ip_url URL to read local address from i.e. http://checkip.dyndns.com/ or http://checkipv6.dyndns.com/ -# ip_script full path and name of your script to detect local IP +# ip_url URL to read current IP from i.e. http://checkip.dyndns.com/ or http://checkipv6.dyndns.com/ +# ip_script full path and name of your script to detect current IP # ip_interface physical interface to use for detecting # # check_interval check for changes every !!! checks below 10 minutes make no sense because the Internet @@ -159,13 +160,13 @@ trap "trap_handler 15" 15 # SIGTERM Termination # # retry_interval if error was detected retry in # retry_unit 'days' 'hours' 'minutes' 'seconds' -# retry_count number of retries before scripts stops +# retry_max_count number of retries before scripts stops # # use_ipv6 detecting/sending IPv6 address # force_ipversion force usage of IPv4 or IPv6 for the whole detection and update communication # dns_server using a non default dns server to get Registered IP from Internet # force_dnstcp force communication with DNS server via TCP instead of default UDP -# proxy using a proxy for communication !!! ALSO used to detect local IP via web => return proxy's IP !!! +# proxy using a proxy for communication !!! ALSO used to detect current IP via web => return proxy's IP !!! # use_logfile self-explanatory "/var/log/ddns/$SECTION_ID.log" # is_glue the record that should be updated is a glue record # @@ -180,7 +181,7 @@ ERR_LAST=$? # save return code - equal 0 if SECTION_ID found # set defaults if not defined [ -z "$enabled" ] && enabled=0 -[ -z "$retry_count" ] && retry_count=0 # endless retry +[ -z "$retry_max_count" ] && retry_max_count=0 # endless retry [ -z "$use_syslog" ] && use_syslog=2 # syslog "Notice" [ -z "$use_https" ] && use_https=0 # not use https [ -z "$use_logfile" ] && use_logfile=1 # use logfile by default @@ -222,9 +223,9 @@ case $VERBOSE in 0) write_log 7 "verbose mode : 0 - run normal, NO console output";; 1) write_log 7 "verbose mode : 1 - run normal, console mode";; 2) write_log 7 "verbose mode : 2 - run once, NO retry on error";; - 3) write_log 7 "verbose mode : 3 - run once, NO retry on error, NOT sending update";; *) write_log 14 "error detecting VERBOSE '$VERBOSE'";; esac +[ $DRY_RUN -ge 1 ] && write_log 7 "Dry Run: NOT sending update" # check enabled state otherwise we don't need to continue [ $enabled -eq 0 ] && write_log 14 "Service section disabled!" @@ -232,7 +233,14 @@ esac # determine what update url we're using if a service_name is supplied # otherwise update_url is set inside configuration (custom update url) # or update_script is set inside configuration (custom update script) -[ -n "$service_name" ] && get_service_data update_url update_script UPD_ANSWER +[ -n "$service_name" ] && { + # Check first if we have a custom service provider with this name + get_service_data "$service_name" "/usr/share/ddns/custom" update_url update_script UPD_ANSWER + if [ "$?" != "0" ]; then + get_service_data "$service_name" "/usr/share/ddns/default" update_url update_script UPD_ANSWER + fi +} + [ -z "$update_url" -a -z "$update_script" ] && write_log 14 "No update_url found/defined or no update_script found/defined!" [ -n "$update_script" -a ! -f "$update_script" ] && write_log 14 "Custom update_script not found!" @@ -247,6 +255,15 @@ esac # without lookup host and possibly other required options we can do nothing for you [ -z "$lookup_host" ] && write_log 14 "Service section not configured correctly! Missing 'lookup_host'" +# verify validity of variables +[ -n "$lookup_host" ] && sanitize_variable lookup_host "$DNS_CHARSET" "" +[ -n "$dns_server" ] && sanitize_variable dns_server "$DNS_CHARSET" "" +[ -n "$domain" ] && sanitize_variable domain "$DNS_CHARSET_DOMAIN" "" + +# Filter shell escape characters, if these are required in the URL, they +# can still be passed url encoded +[ -n "$param_opt" ] && sanitize_variable param_opt "" "$SHELL_ESCAPE" + [ -n "$update_url" ] && { # only check if update_url is given, update_scripts have to check themselves [ -z "$domain" ] && $(echo "$update_url" | grep "\[DOMAIN\]" >/dev/null 2>&1) && \ @@ -264,8 +281,8 @@ esac # verify ip_source 'script' if script is configured and executable if [ "$ip_source" = "script" ]; then set -- $ip_script #handling script with parameters, we need a trick - [ -z "$1" ] && write_log 14 "No script defined to detect local IP!" - [ -x "$1" ] || write_log 14 "Script to detect local IP not executable!" + [ -z "$1" ] && write_log 14 "No script defined to detect current IP!" + [ -x "$1" ] || write_log 14 "Script to detect current IP not executable!" fi # compute update interval in seconds @@ -277,7 +294,7 @@ get_seconds RETRY_SECONDS ${retry_interval:-60} ${retry_unit:-"seconds"} # defau write_log 7 "check interval: $CHECK_SECONDS seconds" write_log 7 "force interval: $FORCE_SECONDS seconds" write_log 7 "retry interval: $RETRY_SECONDS seconds" -write_log 7 "retry counter : $retry_count times" +write_log 7 "retry max count : $retry_max_count times" # kill old process if it exists & set new pid file stop_section_processes "$SECTION_ID" @@ -305,9 +322,6 @@ else write_log 7 "last update: $(eval $EPOCH_TIME)" fi -# verify DNS server -[ -n "$dns_server" ] && verify_dns "$dns_server" - # verify Proxy server and set environment [ -n "$proxy" ] && { verify_proxy "$proxy" && { @@ -331,8 +345,8 @@ ERR_LAST=$? write_log 6 "Starting main loop at $(eval $DATE_PROG)" while : ; do - get_local_ip LOCAL_IP # read local IP - [ $use_ipv6 -eq 1 ] && expand_ipv6 "$LOCAL_IP" LOCAL_IP # on IPv6 we use expanded version + get_current_ip CURRENT_IP # read current IP + [ $use_ipv6 -eq 1 ] && expand_ipv6 "$CURRENT_IP" CURRENT_IP # on IPv6 we use expanded version # prepare update # never updated or forced immediate then NEXT_TIME = 0 @@ -342,24 +356,23 @@ while : ; do get_uptime CURR_TIME # get current uptime - # send update when current time > next time or local ip different from registered ip - if [ $CURR_TIME -ge $NEXT_TIME -o "$LOCAL_IP" != "$REGISTERED_IP" ]; then - if [ $VERBOSE -gt 2 ]; then - write_log 7 "Verbose Mode: $VERBOSE - NO UPDATE send" - elif [ "$LOCAL_IP" != "$REGISTERED_IP" ]; then - write_log 7 "Update needed - L: '$LOCAL_IP' <> R: '$REGISTERED_IP'" + # send update when current time > next time or current ip different from registered ip + if [ $CURR_TIME -ge $NEXT_TIME -o "$CURRENT_IP" != "$REGISTERED_IP" ]; then + if [ $DRY_RUN -ge 1 ]; then + write_log 7 "Dry Run: NO UPDATE send" + elif [ "$CURRENT_IP" != "$REGISTERED_IP" ]; then + write_log 7 "Update needed - L: '$CURRENT_IP' <> R: '$REGISTERED_IP'" else - write_log 7 "Forced Update - L: '$LOCAL_IP' == R: '$REGISTERED_IP'" + write_log 7 "Forced Update - L: '$CURRENT_IP' == R: '$REGISTERED_IP'" fi ERR_LAST=0 - [ $VERBOSE -lt 3 ] && { - # only send if VERBOSE < 3 - send_update "$LOCAL_IP" + [ $DRY_RUN -eq 0 ] && { + send_update "$CURRENT_IP" ERR_LAST=$? # save return value } - # error sending local IP to provider + # error sending current IP to provider # we have no communication error (handled inside send_update/do_transfer) # but update was not recognized # do NOT retry after RETRY_SECONDS, do retry after CHECK_SECONDS @@ -368,9 +381,9 @@ while : ; do if [ $ERR_LAST -eq 0 ]; then get_uptime LAST_TIME # we send update, so echo $LAST_TIME > $UPDFILE # save LASTTIME to file - [ "$LOCAL_IP" != "$REGISTERED_IP" ] \ - && write_log 6 "Update successful - IP '$LOCAL_IP' send" \ - || write_log 6 "Forced update successful - IP: '$LOCAL_IP' send" + [ "$CURRENT_IP" != "$REGISTERED_IP" ] \ + && write_log 6 "Update successful - IP '$CURRENT_IP' send" \ + || write_log 6 "Forced update successful - IP: '$CURRENT_IP' send" elif [ $ERR_LAST -eq 127 ]; then write_log 3 "No update send to DDNS Provider" else @@ -379,26 +392,25 @@ while : ; do fi # now we wait for check interval before testing if update was recognized - # only sleep if VERBOSE <= 2 because otherwise nothing was send - [ $VERBOSE -le 2 ] && { + [ $DRY_RUN -eq 0 ] && { write_log 7 "Waiting $CHECK_SECONDS seconds (Check Interval)" sleep $CHECK_SECONDS & PID_SLEEP=$! wait $PID_SLEEP # enable trap-handler PID_SLEEP=0 - } || write_log 7 "Verbose Mode: $VERBOSE - NO Check Interval waiting" + } || write_log 7 "Dry Run: NO Check Interval waiting" REGISTERED_IP="" # clear variable get_registered_ip REGISTERED_IP # get registered/public IP [ $use_ipv6 -eq 1 ] && expand_ipv6 "$REGISTERED_IP" REGISTERED_IP # on IPv6 we use expanded version # IP's are still different - if [ "$LOCAL_IP" != "$REGISTERED_IP" ]; then + if [ "$CURRENT_IP" != "$REGISTERED_IP" ]; then if [ $VERBOSE -le 1 ]; then # VERBOSE <=1 then retry - ERR_UPDATE=$(( $ERR_UPDATE + 1 )) - [ $retry_count -gt 0 -a $ERR_UPDATE -gt $retry_count ] && \ - write_log 14 "Updating IP at DDNS provider failed after $retry_count retries" - write_log 4 "Updating IP at DDNS provider failed - starting retry $ERR_UPDATE/$retry_count" + RETRY_COUNT=$(( $RETRY_COUNT + 1 )) + [ $retry_max_count -gt 0 -a $RETRY_COUNT -gt $retry_max_count ] && \ + write_log 14 "Updating IP at DDNS provider failed after $retry_max_count retries" + write_log 4 "Updating IP at DDNS provider failed - starting retry $RETRY_COUNT/$retry_max_count" continue # loop to beginning else write_log 4 "Updating IP at DDNS provider failed" @@ -406,7 +418,7 @@ while : ; do fi else # we checked successful the last update - ERR_UPDATE=0 # reset error counter + RETRY_COUNT=0 # reset error counter fi # force_update=0 or VERBOSE > 1 - leave here diff --git a/net/ddns-scripts/files/update_cloudflare_com_v4.sh b/net/ddns-scripts/files/usr/lib/ddns/update_cloudflare_com_v4.sh old mode 100755 new mode 100644 similarity index 82% rename from net/ddns-scripts/files/update_cloudflare_com_v4.sh rename to net/ddns-scripts/files/usr/lib/ddns/update_cloudflare_com_v4.sh index 6dafc4e62e..4fb3a0dd6b --- a/net/ddns-scripts/files/update_cloudflare_com_v4.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/update_cloudflare_com_v4.sh @@ -15,7 +15,7 @@ # option password - cloudflare api key, you can get it from cloudflare.com/my-account/ # option domain - "hostname@yourdomain.TLD" # syntax changed to remove split_FQDN() function and tld_names.dat.gz # -# The proxy status would not be changed by this script. Please change it in Cloudflare dashboard manually. +# The proxy status would not be changed by this script. Please change it in Cloudflare dashboard manually. # # variable __IP already defined with the ip-address to use for update # @@ -27,21 +27,26 @@ [ $use_https -eq 0 ] && use_https=1 # force HTTPS # used variables -local __HOST __DOMAIN __FULLDOMAIN __TYPE __URLBASE __PRGBASE __RUNPROG __DATA __IPV6 __ZONEID __RECID __PROXIED +local __HOST __DOMAIN __TYPE __URLBASE __PRGBASE __RUNPROG __DATA __IPV6 __ZONEID __RECID __PROXIED local __URLBASE="https://api.cloudflare.com/client/v4" local __TTL=120 # split __HOST __DOMAIN from $domain -[ "${domain:0:2}" == "@." ] && domain="${domain/./}" -[ "$domain" == "${domain/@/}" ] && domain="${domain/./@}" -__HOST="${domain%%@*}" -__DOMAIN="${domain#*@}" -[ -z "$__HOST" -o "$__HOST" == "$__DOMAIN" ] && __HOST="@" -if [ "$__HOST" = "@" ]; then -__FULLDOMAIN="${__DOMAIN}" -else -__FULLDOMAIN="${__HOST}.${__DOMAIN}" -fi +# given data: +# @example.com for "domain record" +# host.sub@example.com for a "host record" +__HOST=$(printf %s "$domain" | cut -d@ -f1) +__DOMAIN=$(printf %s "$domain" | cut -d@ -f2) + +# Cloudflare v4 needs: +# __DOMAIN = the base domain i.e. example.com +# __HOST = the FQDN of record to modify +# i.e. example.com for the "domain record" or host.sub.example.com for "host record" + +# handling domain record then set __HOST = __DOMAIN +[ -z "$__HOST" ] && __HOST=$__DOMAIN +# handling host record then rebuild fqdn host@domain.tld => host.domain.tld +[ "$__HOST" != "$__DOMAIN" ] && __HOST="${__HOST}.${__DOMAIN}" # set record type [ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA" @@ -129,23 +134,27 @@ else fi __PRGBASE="$__PRGBASE --header 'Content-Type: application/json' " -# read zone id for registered domain.TLD -__RUNPROG="$__PRGBASE --request GET '$__URLBASE/zones?name=$__DOMAIN'" -cloudflare_transfer || return 1 -# extract zone id -__ZONEID=$(grep -o '"id":\s*"[^"]*' $DATFILE | grep -o '[^"]*$' | head -1) -[ -z "$__ZONEID" ] && { - write_log 4 "Could not detect 'zone id' for domain.tld: '$__DOMAIN'" - return 127 -} +if [ -n "$zone_id" ]; then + __ZONEID="$zone_id" +else + # read zone id for registered domain.TLD + __RUNPROG="$__PRGBASE --request GET '$__URLBASE/zones?name=$__DOMAIN'" + cloudflare_transfer || return 1 + # extract zone id + __ZONEID=$(grep -o '"id":\s*"[^"]*' $DATFILE | grep -o '[^"]*$' | head -1) + [ -z "$__ZONEID" ] && { + write_log 4 "Could not detect 'zone id' for domain.tld: '$__DOMAIN'" + return 127 + } +fi # read record id for A or AAAA record of host.domain.TLD -__RUNPROG="$__PRGBASE --request GET '$__URLBASE/zones/$__ZONEID/dns_records?name=${__FULLDOMAIN}&type=$__TYPE'" +__RUNPROG="$__PRGBASE --request GET '$__URLBASE/zones/$__ZONEID/dns_records?name=$__HOST&type=$__TYPE'" cloudflare_transfer || return 1 # extract record id __RECID=$(grep -o '"id":\s*"[^"]*' $DATFILE | grep -o '[^"]*$' | head -1) [ -z "$__RECID" ] && { - write_log 4 "Could not detect 'record id' for host.domain.tld: '${__FULLDOMAIN}'" + write_log 4 "Could not detect 'record id' for host.domain.tld: '$__HOST'" return 127 } @@ -182,7 +191,7 @@ __PROXIED=$(grep -o '"proxied":\s*[^",]*' $DATFILE | grep -o '[^:]*$') # use file to work around " needed for json cat > $DATFILE << EOF -{"id":"$__ZONEID","type":"$__TYPE","name":"${__FULLDOMAIN}","content":"$__IP","ttl":$__TTL,"proxied":$__PROXIED} +{"id":"$__ZONEID","type":"$__TYPE","name":"$__HOST","content":"$__IP","ttl":$__TTL,"proxied":$__PROXIED} EOF # let's complete transfer command @@ -190,3 +199,4 @@ __RUNPROG="$__PRGBASE --request PUT --data @$DATFILE '$__URLBASE/zones/$__ZONEID cloudflare_transfer || return 1 return 0 + diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_cnkuai_cn.sh b/net/ddns-scripts/files/usr/lib/ddns/update_cnkuai_cn.sh new file mode 100644 index 0000000000..a2b78630f7 --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/update_cnkuai_cn.sh @@ -0,0 +1,86 @@ +# inside url we need domain, username and password +[ -z "$domain" ] && write_log 14 "Service section not configured correctly! Missing 'domain'" +[ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing 'username'" +[ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing 'password'" + +local urlCp='http://cp.cnkuai.cn/' +local urlLogin='http://cp.cnkuai.cn/userlogin.asp' +local urlCaptcha='http://cp.cnkuai.cn/inc/image.asp' +local urlDnsA='http://cp.cnkuai.cn/dns_a.asp' +local urlDnsAAAA='http://cp.cnkuai.cn/dns_ipv6.asp' +local urlDnsSave='http://cp.cnkuai.cn/dns_save.asp' + +getPixel(){ + local filename=$1 + local x=$(($2*3)) + local y=$(($3*3)) + local width=48 + + hexdump -s "$((x+width*y))" -n 3 -e '3/1 "%02X"' "$filename" +} + +captchaChar(){ + local filename=$1 + local xoffset=$2 + + if [ "$(getPixel "$filename" $((xoffset+2)) 5)" = '000000' ]; then + echo '1' + elif [ "$(getPixel "$filename" $((xoffset+5)) 7)" = '000000' ]; then + echo '2' + elif [ "$(getPixel "$filename" $((xoffset+4)) 3)" = '000000' ]; then + echo '4' + elif [ "$(getPixel "$filename" $((xoffset+6)) 4)" = '000000' ]; then + echo '7' + elif [ "$(getPixel "$filename" $((xoffset+5)) 8)" = '000000' ]; then + echo '8' + elif [ "$(getPixel "$filename" $((xoffset+6)) 8)" = '000000' ]; then + echo '9' + elif [ "$(getPixel "$filename" $((xoffset+5)) 6)" = '000000' ]; then + echo '3' + elif [ "$(getPixel "$filename" $((xoffset+0)) 4)" = '000000' ]; then + echo '5' + elif [ "$(getPixel "$filename" $((xoffset+1)) 5)" = '000000' ]; then + echo '6' + else + echo '0' + fi +} + +captcha(){ + local str + str=$(captchaChar "$1" 9) + str=$str$(captchaChar "$1" 18) + str=$str$(captchaChar "$1" 26) + str=$str$(captchaChar "$1" 35) + echo "$str" +} + +#clean +rm /tmp/cnkuai.* +#login to cnkuai dns cp +curl -c '/tmp/cnkuai.cookiejar' "$urlCaptcha" | gif2rgb > /tmp/cnkuai.rgb || return 1 +yzm=$(captcha "/tmp/cnkuai.rgb") +curl -b '/tmp/cnkuai.cookiejar' -c '/tmp/cnkuai.cookiejar' -H "Content-Type: application/x-www-form-urlencoded" -H "Referer: $urlCp" -d "userid=$URL_USER&password=$URL_PASS&yzm=$yzm&B1=%C8%B7%C8%CF%B5%C7%C2%BD&lx=0&userlx=3" -X POST "$urlLogin" > /dev/null || return 1 + +if [ "$use_ipv6" -eq 0 ]; then + curl -b '/tmp/cnkuai.cookiejar' -c '/tmp/cnkuai.cookiejar' "$urlDnsA" > /tmp/cnkuai.html || return 1 +else + curl -b '/tmp/cnkuai.cookiejar' -c '/tmp/cnkuai.cookiejar' "$urlDnsAAAA" > /tmp/cnkuai.html || return 1 +fi +local domainline +domainline=$(awk "/$domain<\/td>/{ print NR; exit }" /tmp/cnkuai.html) +local domainid +domainid=$(awk "NR==$((domainline+3))" /tmp/cnkuai.html | sed 's/^.*name=\x27domainid\x27 value="//g' | sed 's/".*$//g') +local dnslistid +dnslistid=$(awk "NR==$((domainline+3))" /tmp/cnkuai.html | sed 's/^.*name=\x27dnslistid\x27 value="//g' | sed 's/".*$//g') + +local data + +if [ "$use_ipv6" -eq 0 ]; then + data="T2=$__IP&T3=120&act=dns_a_edit&domainid=$domainid&dnslistid=$dnslistid&B1=%D0%DE%B8%C4" +else + data="T2=$__IP&T3=120&act=dns_ipv6_edit&domainid=$domainid&dnslistid=$dnslistid&B1=%D0%DE%B8%C4" +fi +curl -b '/tmp/cnkuai.cookiejar' -c '/tmp/cnkuai.cookiejar' -H "Content-Type: application/x-www-form-urlencoded" -H "Referer: $urlDnsA" -d "$data" -X POST "$urlDnsSave" > /dev/null || return 1 + +return 0 diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_digitalocean_com_v2.sh b/net/ddns-scripts/files/usr/lib/ddns/update_digitalocean_com_v2.sh new file mode 100644 index 0000000000..5ee1b13fe7 --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/update_digitalocean_com_v2.sh @@ -0,0 +1,40 @@ +# Script for sending user defined updates using the DigitalOcean API +# 2015 Artem Yakimenko +# 2021 George Giannou + +# Options passed from /etc/config/ddns: +# Domain - the domain name managed by DigitalOcean (e.g. example.com) +# Username - the hostname of the domain (e.g. myrouter) +# Password - DigitalOcean personal access token (API key) +# Optional Parameter - the API domain record ID of the hostname (e.g. 21694203) + +# Use the following command to find your API domain record ID (replace TOKEN and DOMAIN with your own): +# curl -X GET -H 'Content-Type: application/json' \ +# -H "Authorization: Bearer TOKEN" \ +# "https://api.digitalocean.com/v2/domains/DOMAIN/records" + +. /usr/share/libubox/jshn.sh + +[ -z "$domain" ] && write_log 14 "Service section not configured correctly! Missing domain name as 'Domain'" +[ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing hostname as 'Username'" +[ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing personal access token as 'Password'" +[ -z "$param_opt" ] && write_log 14 "Service section not configured correctly! Missing API domain record ID as 'Optional Parameter'" + +# Construct JSON payload +json_init +json_add_string name "$username" +json_add_string data "$__IP" + +__STATUS=$(curl -Ss -X PUT "https://api.digitalocean.com/v2/domains/${domain}/records/${param_opt}" \ + -H "Authorization: Bearer ${password}" \ + -H "Content-Type: application/json" \ + -d "$(json_dump)" \ + -w "%{http_code}\n" -o $DATFILE 2>$ERRFILE) + +if [ $? -ne 0 ]; then + write_log 14 "Curl failed: $(cat $ERRFILE)" + return 1 +elif [ -z $__STATUS ] || [ $__STATUS != 200 ]; then + write_log 14 "Curl failed: $__STATUS \ndigitalocean.com answered: $(cat $DATFILE)" + return 1 +fi diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_dnspod_cn.sh b/net/ddns-scripts/files/usr/lib/ddns/update_dnspod_cn.sh new file mode 100755 index 0000000000..2091be132b --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/update_dnspod_cn.sh @@ -0,0 +1,137 @@ +#!/bin/sh + +# Check inputs +[ -z "$username" ] && write_log 14 "Configuration error! [User name] cannot be empty" +[ -z "$password" ] && write_log 14 "Configuration error! [Password] cannot be empty" + +# Check external tools +[ -n "$CURL_SSL" ] || write_log 13 "Dnspod communication require cURL with SSL support. Please install" +[ -n "$CURL_PROXY" ] || write_log 13 "cURL: libcurl compiled without Proxy support" + +# Declare variables +#local __URLBASE __HOST __DOMAIN __TYPE __CMDBASE __POST __POST1 __RECIP __RECID __TTL +__URLBASE="https://dnsapi.cn" + +# Get host and domain from $domain +[ "${domain:0:2}" = "@." ] && domain="${domain/./}" # host +[ "$domain" = "${domain/@/}" ] && domain="${domain/./@}" # host with no sperator +__HOST="${domain%%@*}" +__DOMAIN="${domain#*@}" +[ -z "$__HOST" -o "$__HOST" = "$__DOMAIN" ] && __HOST=@ + +# Set record type +[ $use_ipv6 = 0 ] && __TYPE=A || __TYPE=AAAA + +# Build base command +build_command() { + __CMDBASE="$CURL -Ss" + # bind host/IP + if [ -n "$bind_network" ]; then + local __DEVICE + network_get_physdev __DEVICE $bind_network || write_log 13 "Can not detect local device using 'network_get_physdev $bind_network' - Error: '$?'" + write_log 7 "Force communication via device '$__DEVICE'" + __CMDBASE="$__CMDBASE --interface $__DEVICE" + fi + # Force IP version + if [ $force_ipversion = 1 ]; then + [ $use_ipv6 = 0 ] && __CMDBASE="$__CMDBASE -4" || __CMDBASE="$__CMDBASE -6" + fi + # Set CA + if [ $use_https = 1 ]; then + if [ "$cacert" = IGNORE ]; then + __CMDBASE="$__CMDBASE --insecure" + elif [ -f "$cacert" ]; then + __CMDBASE="$__CMDBASE --cacert $cacert" + elif [ -d "$cacert" ]; then + __CMDBASE="$__CMDBASE --capath $cacert" + elif [ -n "$cacert" ]; then + write_log 14 "No valid certificate(s) found at '$cacert' for HTTPS communication" + fi + fi + # Set if no proxy (might be an error with .wgetrc or env) + [ -z "$proxy" ] && __CMDBASE="$__CMDBASE --noproxy '*'" + __CMDBASE="$__CMDBASE -d" +} + +# Dnspod API +dnspod_transfer() { + __CNT=0 + case "$1" in + 0) __A="$__CMDBASE '$__POST' $__URLBASE/Record.List" ;; + 1) __A="$__CMDBASE '$__POST1' $__URLBASE/Record.Create" ;; + 2) __A="$__CMDBASE '$__POST1&record_id=$__RECID&ttl=$__TTL' $__URLBASE/Record.Modify" ;; + esac + + write_log 7 "#> $__A" + while ! __TMP=$(eval $__A 2>&1); do + write_log 3 "[$__TMP]" + if [ $VERBOSE -gt 1 ]; then + write_log 4 "Transfer failed - detailed mode: $VERBOSE - Do not try again after an error" + return 1 + fi + __CNT=$(($__CNT + 1)) + [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && write_log 14 "Transfer failed after $retry_count retries" + write_log 4 "Transfer failed - $__CNT Try again in $RETRY_SECONDS seconds" + sleep $RETRY_SECONDS & + PID_SLEEP=$! + wait $PID_SLEEP + PID_SLEEP=0 + done + __ERR=$(jsonfilter -s "$__TMP" -e "@.status.code") + [ $__ERR = 1 ] && return 0 + [ $__ERR = 10 ] && [ $1 = 0 ] && return 0 + __TMP=$(jsonfilter -s "$__TMP" -e "@.status.message") + local A="$(date +%H%M%S) ERROR : [$__TMP] - Terminate process" + logger -p user.err -t ddns-scripts[$$] $SECTION_ID: ${A:15} + printf "%s\n" " $A" >>$LOGFILE + exit 1 +} + +# Add record +add_domain() { + dnspod_transfer 1 + printf "%s\n" " $(date +%H%M%S) : Record add successfully: [$([ "$__HOST" = @ ] || echo $__HOST.)$__DOMAIN],[IP:$__IP]" >>$LOGFILE + return 0 +} + +# Modify record +update_domain() { + dnspod_transfer 2 + printf "%s\n" " $(date +%H%M%S) : Record modified successfully: [$([ "$__HOST" = @ ] || echo $__HOST.)$__DOMAIN],[IP:$__IP],[TTL:$__TTL]" >>$LOGFILE + return 0 +} + +# Get DNS record +describe_domain() { + ret=0 + __POST="login_token=$username,$password&format=json&domain=$__DOMAIN&sub_domain=$__HOST" + __POST1="$__POST&value=$__IP&record_type=$__TYPE&record_line_id=0" + dnspod_transfer 0 + __TMP=$(jsonfilter -s "$__TMP" -e "@.records[@.type='$__TYPE' && @.line_id='0']") + if [ -z "$__TMP" ]; then + printf "%s\n" " $(date +%H%M%S) : Record not exist: [$([ "$__HOST" = @ ] || echo $__HOST.)$__DOMAIN]" >>$LOGFILE + ret=1 + else + __RECIP=$(jsonfilter -s "$__TMP" -e "@.value") + if [ "$__RECIP" != "$__IP" ]; then + __RECID=$(jsonfilter -s "$__TMP" -e "@.id") + __TTL=$(jsonfilter -s "$__TMP" -e "@.ttl") + printf "%s\n" " $(date +%H%M%S) : Record needs to be updated: [Record IP:$__RECIP] [Local IP:$__IP]" >>$LOGFILE + ret=2 + fi + fi +} + +build_command +describe_domain +if [ $ret = 1 ]; then + sleep 3 + add_domain +elif [ $ret = 2 ]; then + sleep 3 + update_domain +else + printf "%s\n" " $(date +%H%M%S) : Record needs not update: [Record IP:$__RECIP] [Local IP:$__IP]" >>$LOGFILE +fi + +return 0 diff --git a/net/ddns-scripts/files/update_freedns_42_pl.sh b/net/ddns-scripts/files/usr/lib/ddns/update_freedns_42_pl.sh old mode 100755 new mode 100644 similarity index 98% rename from net/ddns-scripts/files/update_freedns_42_pl.sh rename to net/ddns-scripts/files/usr/lib/ddns/update_freedns_42_pl.sh index 14d9713b6d..f0e91972ab --- a/net/ddns-scripts/files/update_freedns_42_pl.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/update_freedns_42_pl.sh @@ -5,7 +5,7 @@ local __URL="https://freedns.42.pl/xmlrpc.php" [ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing 'username'" [ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing 'password'" [ $ip_dynamic -eq 1 ] && __IP='\<dynamic\>' -PROG="$(which curl) -sk" +PROG="$(command -v curl) -sk" write_log 7 "sending update to freedns.42.pl with ip $__IP" XMLDATA="xname.updateArecordname[RECORDNAME]zone[ZONENAME]oldaddress*updatereverse0user[USERNAME]ttl600newaddress[IP]password[PASSWORD]" XMLDATA=$(echo $XMLDATA | sed -e "s#\[USERNAME\]#$URL_USER#g" -e "s#\[PASSWORD\]#$URL_PASS#g" \ diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_gandi_net.sh b/net/ddns-scripts/files/usr/lib/ddns/update_gandi_net.sh new file mode 100644 index 0000000000..321687d700 --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/update_gandi_net.sh @@ -0,0 +1,48 @@ +#!/bin/sh +# Thanks goes to Alex Griffin who provided this script. + +. /usr/share/libubox/jshn.sh + +local __TTL=600 +local __RRTYPE +local __ENDPOINT="https://api.gandi.net/v5/livedns" +local __STATUS + +[ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing subdomain as 'username'" +[ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing API Key as 'password'" + +[ $use_ipv6 -ne 0 ] && __RRTYPE="AAAA" || __RRTYPE="A" + +# Construct JSON payload +json_init +json_add_int rrset_ttl "$__TTL" +json_add_array rrset_values +json_add_string "" "$__IP" +json_close_array + +# Log the curl command +write_log 7 "curl -s -X PUT \"$__ENDPOINT/domains/$domain/records/$username/$__RRTYPE\" \ + -H \"Authorization: Apikey $password\" \ + -H \"Content-Type: application/json\" \ + -d \"$(json_dump)\" \ + --connect-timeout 30" + +__STATUS=$(curl -s -X PUT "$__ENDPOINT/domains/$domain/records/$username/$__RRTYPE" \ + -H "Authorization: Apikey $password" \ + -H "Content-Type: application/json" \ + -d "$(json_dump)" \ + --connect-timeout 30 \ + -w "%{http_code}\n" -o $DATFILE 2>$ERRFILE) + +local __ERRNO=$? +if [ $__ERRNO -ne 0 ]; then + write_log 14 "Curl failed with $__ERRNO: $(cat $ERRFILE)" + return 1 +elif [ -z $__STATUS ] || [ $__STATUS != 201 ]; then + write_log 14 "LiveDNS failed: $__STATUS \ngandi.net answered: $(cat $DATFILE)" + return 1 +fi + +write_log 7 "gandi.net answered: $(cat $DATFILE)" + +return 0 diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_gcp_v1.sh b/net/ddns-scripts/files/usr/lib/ddns/update_gcp_v1.sh new file mode 100755 index 0000000000..5bd096f46c --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/update_gcp_v1.sh @@ -0,0 +1,272 @@ +#!/bin/sh +# +#.Distributed under the terms of the GNU General Public License (GPL) version 2.0 +#.2022 Chris Barrick +# +# This script sends DDNS updates using the Google Cloud DNS REST API. +# See: https://cloud.google.com/dns/docs/reference/v1 +# +# This script uses a GCP service account. The user is responsible for creating +# the service account, ensuring it has permission to update DNS records, and +# for generating a service account key to be used by this script. The records +# to be updated must already exist. +# +# Arguments: +# +# - $username: The service account name. +# Example: ddns-service-account@my-dns-project.iam.gserviceaccount.com +# +# - $password: The service account key. You can paste the key directly into the +# "password" field or upload the key file to the router and set the field +# equal to the file path. This script supports JSON keys or the raw private +# key as a PEM file. P12 keys are not supported. File names must end with +# `*.json` or `*.pem`. +# +# - $domain: The domain to update. +# +# - $param_enc: The additional required arguments, as form-urlencoded data, +# i.e. `key1=value1&key2=value2&...`. The required arguments are: +# - project: The name of the GCP project that owns the DNS records. +# - zone: The DNS zone in the GCP API. +# - Example: `project=my-dns-project&zone=my-dns-zone` +# +# - $param_opt: Optional TTL for the records, in seconds. Defaults to 3600 (1h). +# +# Dependencies: +# - ddns-scripts (for the base functionality) +# - openssl-util (for the authentication flow) +# - curl (for the GCP REST API) + +. /usr/share/libubox/jshn.sh + + +# Authentication +# --------------------------------------------------------------------------- +# The authentication flow works like this: +# +# 1. Construct a JWT claim for access to the DNS readwrite scope. +# 2. Sign the JWT with the service accout key, proving we have access. +# 3. Exchange the JWT for an access token, valid for 5m. +# 4. Use the access token for API calls. +# +# See https://developers.google.com/identity/protocols/oauth2/service-account + +# A URL-safe variant of base64 encoding, used by JWTs. +base64_urlencode() { + openssl base64 | tr '/+' '_-' | tr -d '=\n' +} + +# Prints the service account private key in PEM format. +get_service_account_key() { + # The "password" field provides us with the service account key. + # We allow the user to provide it to us in a few different formats. + # + # 1. If $password is a string ending in `*.json`, it is a file path, + # pointing to a JSON service account key as downloaded from GCP. + # + # 2. If $password is a string ending with `*.pem`, it is a PEM private + # key, extracted from the JSON service account key. + # + # 3. If $password starts with `{`, then the JSON service account key + # was pasted directly into the password field. + # + # 4. If $password starts with `---`, then the PEM private key was pasted + # directly into the password field. + # + # We do not support P12 service account keys. + case "${password}" in + (*".json") + jsonfilter -i "${password}" -e @.private_key + ;; + (*".pem") + cat "${password}" + ;; + ("{"*) + jsonfilter -s "${password}" -e @.private_key + ;; + ("---"*) + printf "%s" "${password}" + ;; + (*) + write_log 14 "Could not parse the service account key." + ;; + esac +} + +# Sign stdin using the service account key. Prints the signature. +# The input is the JWT header-payload. Used to construct a signed JWT. +sign() { + # Dump the private key to a tmp file so openssl can get to it. + local tmp_keyfile="$(mktemp -t gcp_dns_sak.pem.XXXXXX)" + chmod 600 ${tmp_keyfile} + get_service_account_key > ${tmp_keyfile} + openssl dgst -binary -sha256 -sign ${tmp_keyfile} + rm ${tmp_keyfile} +} + +# Print the JWT header in JSON format. +# Currently, Google only supports RS256. +jwt_header() { + json_init + json_add_string "alg" "RS256" + json_add_string "typ" "JWT" + json_dump +} + +# Prints the JWT claim-set in JSON format. +# The claim is for 5m of readwrite access to the Cloud DNS API. +jwt_claim_set() { + local iat=$(date -u +%s) # Current UNIX time, UTC. + local exp=$(( iat + 300 )) # Expiration is 5m in the future. + + json_init + json_add_string "iss" "${username}" + json_add_string "scope" "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + json_add_string "aud" "https://oauth2.googleapis.com/token" + json_add_string "iat" "${iat}" + json_add_string "exp" "${exp}" + json_dump +} + +# Generate a JWT signed by the service account key, which can be exchanged for +# a Google Cloud access token, authorized for Cloud DNS. +get_jwt() { + local header=$(jwt_header | base64_urlencode) + local payload=$(jwt_claim_set | base64_urlencode) + local header_payload="${header}.${payload}" + local signature=$(printf "%s" ${header_payload} | sign | base64_urlencode) + echo "${header_payload}.${signature}" +} + +# Request an access token for the Google Cloud service account. +get_access_token_raw() { + local grant_type="urn:ietf:params:oauth:grant-type:jwt-bearer" + local assertion=$(get_jwt) + + ${CURL} -v https://oauth2.googleapis.com/token \ + --data-urlencode 'grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer' \ + --data-urlencode "assertion=${assertion}" \ + | jsonfilter -e @.access_token +} + +# Get the access token, stripping the trailing dots. +get_access_token() { + # Since tokens may contain internal dots, we only trim the suffix if it + # starts with at least 8 dots. (The access token has *many* trailing dots.) + local access_token="$(get_access_token_raw)" + echo "${access_token%%........*}" +} + + +# Google Cloud DNS API +# --------------------------------------------------------------------------- +# Cloud DNS offers a straight forward RESTful API. +# +# - The main class is a ResourceRecordSet. It's a collection of DNS records +# that share the same domain, type, TTL, etc. Within a record set, the only +# difference between the records are their values. +# +# - The record sets live under a ManagedZone, which in turn lives under a +# Project. All we need to know about these are their names. +# +# - This implementation only makes PATCH requests to update existing record +# sets. The user must have already created at least one A or AAAA record for +# the domain they are updating. It's fine to start with a dummy, like 0.0.0.0. +# +# - The API requires SSL, and this implementation uses curl. + +# Prints a ResourceRecordSet in JSON format. +format_record_set() { + local domain="$1" + local record_type="$2" + local ttl="$3" + shift 3 # The remaining arguments are the IP addresses for this record set. + + json_init + json_add_string "kind" "dns#resourceRecordSet" + json_add_string "name" "${domain}." # trailing dot on the domain + json_add_string "type" "${record_type}" + json_add_string "ttl" "${ttl}" + json_add_array "rrdatas" + for value in $@; do + json_add_string "" "${value}" + done + json_close_array + json_dump +} + +# Makes an HTTP PATCH request to the Cloud DNS API. +patch_record_set() { + local access_token="$1" + local project="$2" + local zone="$3" + local domain="$4" + local record_type="$5" + local ttl="$6" + shift 6 # The remaining arguments are the IP addresses for this record set. + + # Note the trailing dot after the domain name. It's fully qualified. + local url="https://dns.googleapis.com/dns/v1/projects/${project}/managedZones/${zone}/rrsets/${domain}./${record_type}" + local record_set=$(format_record_set ${domain} ${record_type} ${ttl} $@) + + ${CURL} -v ${url} \ + -X PATCH \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer ${access_token}" \ + -d "${record_set}" +} + + +# Main entrypoint +# --------------------------------------------------------------------------- + +# Parse the $param_enc into project and zone variables. +# The arguments are the names for those variables. +parse_project_zone() { + local project_var=$1 + local zone_var=$2 + + IFS='&' + for entry in $param_enc + do + case "${entry}" in + ('project='*) + local project_val=$(echo "${entry}" | cut -d'=' -f2) + eval "${project_var}=${project_val}" + ;; + ('zone='*) + local zone_val=$(echo "${entry}" | cut -d'=' -f2) + eval "${zone_var}=${zone_val}" + ;; + esac + done + unset IFS +} + +main() { + local access_token project zone ttl record_type + + # Dependency checking + [ -z "${CURL_SSL}" ] && write_log 14 "Google Cloud DNS requires cURL with SSL support" + [ -z "$(openssl version)" ] && write_log 14 "Google Cloud DNS update requires openssl-utils" + + # Argument parsing + [ -z ${param_opt} ] && ttl=3600 || ttl="${param_opt}" + [ $use_ipv6 -ne 0 ] && record_type="AAAA" || record_type="A" + parse_project_zone project zone + + # Sanity checks + [ -z "${username}" ] && write_log 14 "Config is missing 'username' (service account name)" + [ -z "${password}" ] && write_log 14 "Config is missing 'password' (service account key)" + [ -z "${domain}" ] && write_log 14 "Config is missing 'domain'" + [ -z "${project}" ] && write_log 14 "Could not parse project name from 'param_enc'" + [ -z "${zone}" ] && write_log 14 "Could not parse zone name from 'param_enc'" + [ -z "${ttl}" ] && write_log 14 "Could not parse TTL from 'param_opt'" + [ -z "${record_type}" ] && write_log 14 "Could not determine the record type" + + # Push the record! + access_token="$(get_access_token)" + patch_record_set "${access_token}" "${project}" "${zone}" "${domain}" "${record_type}" "${ttl}" "${__IP}" +} + +main $@ diff --git a/net/ddns-scripts/files/update_godaddy_com_v1.sh b/net/ddns-scripts/files/usr/lib/ddns/update_godaddy_com_v1.sh old mode 100755 new mode 100644 similarity index 100% rename from net/ddns-scripts/files/update_godaddy_com_v1.sh rename to net/ddns-scripts/files/usr/lib/ddns/update_godaddy_com_v1.sh diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_huaweicloud_com.sh b/net/ddns-scripts/files/usr/lib/ddns/update_huaweicloud_com.sh new file mode 100644 index 0000000000..1c21b1d2e7 --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/update_huaweicloud_com.sh @@ -0,0 +1,152 @@ +#!/bin/sh +# +# script for sending updates to huaweicloud.com +# 2023-2024 sxlehua +# API documentation at https://support.huaweicloud.com/api-dns/dns_api_62003.html +# API signature documentation at https://support.huaweicloud.com/api-dns/dns_api_30003.html +# +# This script is parsed by dynamic_dns_functions.sh inside send_update() function +# +# useage: +# using following options from /etc/config/ddns +# option username - huaweicloud Access Key Id +# option password - huaweicloud Secret Access Key,AK、SK documentation from https://support.huaweicloud.com/devg-apisign/api-sign-provide-aksk.html +# option domain - "hostname@yourdomain.TLD" # syntax changed to remove split_FQDN() function and tld_names.dat.gz +# + +# Check inputs +[ -z "$username" ] && write_log 14 "Configuration error! [username] cannot be empty" +[ -z "$password" ] && write_log 14 "Configuration error! [password] cannot be empty" + +[ -z "$CURL" ] && [ -z "$CURL_SSL" ] && write_log 14 "huaweicloud API require cURL with SSL support. Please install" +command -v openssl >/dev/null 2>&1 || write_log 14 "huaweicloud API require openssl-util support. Please install" + +# public variable +local __HOST __DOMAIN __TYPE __ZONE_ID __RECORD_ID +local __ENDPOINT="dns.cn-north-1.myhuaweicloud.com" +local __TTL=120 +[ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA" + +# Get host and domain from $domain +[ "${domain:0:2}" == "@." ] && domain="${domain/./}" # host +[ "$domain" == "${domain/@/}" ] && domain="${domain/./@}" # host with no sperator +__HOST="${domain%%@*}" +__DOMAIN="${domain#*@}" +[ -z "$__HOST" -o "$__HOST" == "$__DOMAIN" ] && __HOST="@" + +hcloud_transfer() { + local method=$1 + local path=$2 + local query=$3 + local body=$4 + + local timestamp=$(date -u +'%Y%m%dT%H%M%SZ') + local contentType="" + if [ ! "$method" = "GET" ]; then + contentType="application/json" + fi + local _H_Content_Type="" + + local canonicalUri="${path}" + # add / if need + echo $canonicalUri | grep -qE "/$" || canonicalUri="$canonicalUri/" + local canonicalQuery="$query" # for extend + + local canonicalHeaders="host:$__ENDPOINT\nx-sdk-date:$timestamp\n" + local signedHeaders="host;x-sdk-date" + + if [ ! "$contentType" = "" ]; then + canonicalHeaders="content-type:$contentType\n${canonicalHeaders}" + signedHeaders="content-type;$signedHeaders" + _H_Content_Type="Content-Type: ${contentType}" + fi + + local hexencode=$(printf "%s" "$body" | openssl dgst -sha256 -hex 2>/dev/null | sed 's/^.* //') + local canonicalRequest="$method\n$canonicalUri\n$canonicalQuery\n$canonicalHeaders\n$signedHeaders\n$hexencode" + canonicalRequest="$(printf "$canonicalRequest%s")" + + local stringToSign="SDK-HMAC-SHA256\n$timestamp\n$(printf "%s" "$canonicalRequest" | openssl dgst -sha256 -hex 2>/dev/null | sed 's/^.* //')" + stringToSign="$(printf "$stringToSign%s")" + + local signature=$(printf "%s" "$stringToSign" | openssl dgst -sha256 -hmac "$password" 2>/dev/null | sed 's/^.* //') + authorization="SDK-HMAC-SHA256 Access=$username, SignedHeaders=$signedHeaders, Signature=$signature" + + reqUrl="$__ENDPOINT$path" + if [ ! -z "$query" ]; then + reqUrl="$reqUrl""?$query" + fi + + curl -s -X "${method}" \ + -H "Host: $__ENDPOINT" \ + -H "$_H_Content_Type" \ + -H "Authorization: $authorization" \ + -H "X-Sdk-Date: $timestamp" \ + -d "${body}" \ + "https://$reqUrl" + + if [ $? -ne 0 ]; then + write_log 14 "rest api error" + fi +} + +get_zone() { + local resp=`hcloud_transfer GET /v2/zones "name=$__DOMAIN.&search_mode=equal" ""` + __ZONE_ID=`printf "%s" $resp | grep -Eo '"id":"[a-z0-9]+"' | cut -d':' -f2 | tr -d '"'` + if [ "$__ZONE_ID" = "" ]; then + write_log 14 "error, no zone" + fi +} + +upd_record() { + local body="{\"name\":\"$__HOST.$__DOMAIN.\",\"type\":\"$__TYPE\",\"records\":[\"$__IP\"],\"ttl\":$__TTL}" + local resp=`hcloud_transfer PUT /v2/zones/"$__ZONE_ID"/recordsets/$__RECORD_ID "" "$body"` + local recordId=`printf "%s" $resp | grep -Eo '"id":"[a-z0-9]+"' | cut -d':' -f2 | tr -d '"'` + if [ ! "$recordId" = "" ]; then + write_log 7 "upd [$recordId] success [$__TYPE] [$__IP]" + else + write_log 14 "upd ecord error [$resp]" + fi +} + +add_record() { + local body="{\"name\":\"$__HOST.$__DOMAIN.\",\"type\":\"$__TYPE\",\"records\":[\"$__IP\"],\"ttl\":$__TTL}" + local resp=`hcloud_transfer POST /v2/zones/"$__ZONE_ID"/recordsets "" "$body"` + local recordId=`printf "%s" $resp | grep -Eo '"id":"[a-z0-9]+"' | cut -d':' -f2 | tr -d '"'` + if [ ! "$recordId" = "" ]; then + write_log 7 "add [$recordId] success [$__TYPE] [$__IP]" + else + write_log 14 "add record error [$resp]" + fi +} + +# Get DNS record +get_record() { + local ret=0 + local resp=`hcloud_transfer GET /v2/zones/$__ZONE_ID/recordsets "name=$__HOST.$__DOMAIN.&search_mode=equal" ""` + __RECORD_ID=`printf "%s" $resp | grep -Eo '"id":"[a-z0-9]+"' | cut -d':' -f2 | tr -d '"' | head -1` + if [ "$__RECORD_ID" = "" ]; then + # Record needs to be add + ret=1 + else + local remoteIp=`printf "%s" $resp | grep -Eo '"records":\[[^]]+]' | cut -d ':' -f 2-10 | tr -d '[' | tr -d ']' | tr -d '"' | head -1` + if [ ! "$remoteIp" = "$__IP" ]; then + # Record needs to be updated + ret=2 + fi + fi + return $ret +} + +get_zone +get_record + +ret=$? +if [ $ret -eq 0 ]; then + write_log 7 "nochg [$__IP]" +fi +if [ $ret -eq 1 ]; then + add_record +fi +if [ $ret -eq 2 ]; then + upd_record +fi diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_luadns_v1.sh b/net/ddns-scripts/files/usr/lib/ddns/update_luadns_v1.sh new file mode 100644 index 0000000000..5d7954e125 --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/update_luadns_v1.sh @@ -0,0 +1,191 @@ +#!/bin/sh +# +#.Distributed under the terms of the GNU General Public License (GPL) version 2.0 +#.2023 Jihoon Han +# +#.based on Christian Schoenebeck's update_cloudflare_com_v4.sh +#.and on Neilpang's acme.sh found at https://github.com/acmesh-official/acme.sh +# +# Script for sending DDNS updates using the LuaDNS API +# See: https://luadns.com/api +# +# using following options from /etc/config/ddns +# option username - "Emaii" as registered on LuaDNS +# option password - "API Key" as generated at https://api.luadns.com/api_keys +# option domain - The domain to update (e.g. my.example.com) +# + +# check parameters +[ -z "$CURL" ] && [ -z "$CURL_SSL" ] && write_log 14 "LuaDNS API require cURL with SSL support. Please install" +[ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing e-mail as 'Username'" +[ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing personal API key as 'Password'" +[ $use_https -eq 0 ] && use_https=1 # force HTTPS + +# used variables +local __HOST __DOMAIN __TYPE __URLBASE __PRGBASE __RUNPROG __DATA __IPV6 __ZONEID __RECID +local __URLBASE="https://api.luadns.com/v1" +local __TTL=300 + +# set record type +[ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA" + +# transfer function to use for LuaDNS +# all needed variables are set global here +# so we can use them directly +luadns_transfer() { + local __CNT=0 + local __STATUS __ERR + while : ; do + write_log 7 "#> $__RUNPROG" + __STATUS=$(eval "$__RUNPROG") + __ERR=$? # save communication error + [ $__ERR -eq 0 ] && break # no error break while + + write_log 3 "cURL Error: '$__ERR'" + write_log 7 "$(cat $ERRFILE)" # report error + + [ $VERBOSE_MODE -gt 1 ] && { + # VERBOSE_MODE > 1 then NO retry + write_log 4 "Transfer failed - Verbose Mode: $VERBOSE_MODE - NO retry on error" + break + } + + __CNT=$(( $__CNT + 1 )) # increment error counter + # if error count > retry_count leave here + [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \ + write_log 14 "Transfer failed after $retry_count retries" + + write_log 4 "Transfer failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds" + sleep $RETRY_SECONDS & + PID_SLEEP=$! + wait $PID_SLEEP # enable trap-handler + PID_SLEEP=0 + done + + # handle HTTP error + [ $__STATUS -ne 200 ] && { + write_log 4 "LuaDNS reported an error:" + write_log 7 "$(cat $DATFILE)" + return 1 + } + return 0 +} + +# Build base command to use +__PRGBASE="$CURL -RsS -w '%{http_code}' -o $DATFILE --stderr $ERRFILE" +# force network/interface-device to use for communication +if [ -n "$bind_network" ]; then + local __DEVICE + network_get_physdev __DEVICE $bind_network || \ + write_log 13 "Can not detect local device using 'network_get_physdev $bind_network' - Error: '$?'" + write_log 7 "Force communication via device '$__DEVICE'" + __PRGBASE="$__PRGBASE --interface $__DEVICE" +fi +# force ip version to use +if [ $force_ipversion -eq 1 ]; then + [ $use_ipv6 -eq 0 ] && __PRGBASE="$__PRGBASE -4" || __PRGBASE="$__PRGBASE -6" # force IPv4/IPv6 +fi +# set certificate parameters +if [ "$cacert" = "IGNORE" ]; then # idea from Ticket #15327 to ignore server cert + __PRGBASE="$__PRGBASE --insecure" # but not empty better to use "IGNORE" +elif [ -f "$cacert" ]; then + __PRGBASE="$__PRGBASE --cacert $cacert" +elif [ -d "$cacert" ]; then + __PRGBASE="$__PRGBASE --capath $cacert" +elif [ -n "$cacert" ]; then # it's not a file and not a directory but given + write_log 14 "No valid certificate(s) found at '$cacert' for HTTPS communication" +fi +# disable proxy if not set (there might be .wgetrc or .curlrc or wrong environment set) +# or check if libcurl compiled with proxy support +if [ -z "$proxy" ]; then + __PRGBASE="$__PRGBASE --noproxy '*'" +elif [ -z "$CURL_PROXY" ]; then + # if libcurl has no proxy support and proxy should be used then force ERROR + write_log 13 "cURL: libcurl compiled without Proxy support" +fi +# set headers +__PRGBASE="$__PRGBASE --user '$username:$password' " +__PRGBASE="$__PRGBASE --header 'Accept: application/json' " + +if [ -n "$zone_id" ]; then + __ZONEID="$zone_id" +else + # read zone id for registered domain.TLD + __RUNPROG="$__PRGBASE --request GET '$__URLBASE/zones'" + luadns_transfer || return 1 + # extract zone id + i=1 + while : ; do + h=$(printf "%s" "$domain" | cut -d . -f $i-100 -s) + [ -z "$h" ] && { + write_log 4 "Could not detect 'Zone ID' for the domain provided: '$domain'" + return 127 + } + + __ZONEID=$(grep -o -e "\"id\":[^,]*,\"name\":\"$h\"" $DATFILE | cut -d : -f 2 | cut -d , -f 1) + [ -n "$__ZONEID" ] && { + # LuaDNS API needs: + # __DOMAIN = the base domain i.e. example.com + # __HOST = the FQDN of record to modify + # i.e. example.com for the "domain record" or host.sub.example.com for "host record" + __HOST="$domain" + __DOMAIN="$h" + write_log 7 "Domain : '$__DOMAIN'" + write_log 7 "Zone ID : '$__ZONEID'" + write_log 7 "Host : '$__HOST'" + break + } + i=$(expr "$i" + 1) + done +fi + +# read record id for A or AAAA record of host.domain.TLD +__RUNPROG="$__PRGBASE --request GET '$__URLBASE/zones/$__ZONEID/records'" +luadns_transfer || return 1 +# extract record id +__RECID=$(grep -o -e "\"id\":[^,]*,\"name\":\"$__HOST.\",\"type\":\"$__TYPE\"" $DATFILE | head -n 1 | cut -d : -f 2 | cut -d , -f 1) +[ -z "$__RECID" ] && { + write_log 4 "Could not detect 'Record ID' for the domain provided: '$__HOST'" + return 127 +} +write_log 7 "Record ID : '$__RECID'" + +# extract current stored IP +__DATA=$(grep -o -e "\"id\":$__RECID,\"name\":\"$__HOST.\",\"type\":\"$__TYPE\",\"content\":[^,]*" $DATFILE | grep -o '[^"]*' | tail -n 1) + +# check data +[ $use_ipv6 -eq 0 ] \ + && __DATA=$(printf "%s" "$__DATA" | grep -m 1 -o "$IPV4_REGEX") \ + || __DATA=$(printf "%s" "$__DATA" | grep -m 1 -o "$IPV6_REGEX") + +# we got data so verify +[ -n "$__DATA" ] && { + # expand IPv6 for compare + if [ $use_ipv6 -eq 1 ]; then + expand_ipv6 $__IP __IPV6 + expand_ipv6 $__DATA __DATA + [ "$__DATA" = "$__IPV6" ] && { # IPv6 no update needed + write_log 7 "IPv6 at LuaDNS already up to date" + return 0 + } + else + [ "$__DATA" = "$__IP" ] && { # IPv4 no update needed + write_log 7 "IPv4 at LuaDNS already up to date" + return 0 + } + fi +} + +# update is needed +# let's build data to send + +# use file to work around " needed for json +cat > $DATFILE << EOF +{"name":"$__HOST.","type":"$__TYPE","content":"$__IP","ttl":$__TTL} +EOF + +# let's complete transfer command +__RUNPROG="$__PRGBASE --request PUT --data @$DATFILE '$__URLBASE/zones/$__ZONEID/records/$__RECID'" +luadns_transfer || return 1 + +return 0 diff --git a/net/ddns-scripts/files/update_no-ip_com.sh b/net/ddns-scripts/files/usr/lib/ddns/update_no-ip_com.sh old mode 100755 new mode 100644 similarity index 87% rename from net/ddns-scripts/files/update_no-ip_com.sh rename to net/ddns-scripts/files/usr/lib/ddns/update_no-ip_com.sh index 7d4354bd6d..e13058b14c --- a/net/ddns-scripts/files/update_no-ip_com.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/update_no-ip_com.sh @@ -10,13 +10,15 @@ # so we send a dummy (localhost) and a seconds later we send the correct IP addr # local __DUMMY -local __UPDURL="http://[USERNAME]:[PASSWORD]@dynupdate.no-ip.com/nic/update?hostname=[DOMAIN]&myip=[IP]" +local __UPDURL6="http://[USERNAME]:[PASSWORD]@dynupdate6.noip.com/nic/update?hostname=[DOMAIN]&myip=[IP]" +local __UPDURL="http://[USERNAME]:[PASSWORD]@dynupdate.noip.com/nic/update?hostname=[DOMAIN]&myip=[IP]" # inside url we need username and password [ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing 'username'" [ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing 'password'" # set IP version dependend dummy (localhost) [ $use_ipv6 -eq 0 ] && __DUMMY="127.0.0.1" || __DUMMY="::1" +[ $use_ipv6 -eq 0 ] && __UPDURL=$__UPDURL || __UPDURL=$__UPDURL6 # lets do DUMMY transfer write_log 7 "sending dummy IP to 'no-ip.com'" diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_ns1_com.sh b/net/ddns-scripts/files/usr/lib/ddns/update_ns1_com.sh new file mode 100644 index 0000000000..4b965339c0 --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/update_ns1_com.sh @@ -0,0 +1,77 @@ +#!/bin/sh +# Derived from update_gandi_net.sh + +. /usr/share/libubox/jshn.sh + +local __ENDPOINT="https://api.nsone.net/v1" +local __TTL=600 +local __RRTYPE +local __URL +local __STATUS + +[ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing zone as 'username'" +[ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing API Key as 'password'" + +[ $use_ipv6 -ne 0 ] && __RRTYPE="AAAA" || __RRTYPE="A" + +# Construct JSON payload +json_init +# {"answers":[{"answer":["1.1.1.1"]}]} +json_add_array answers +json_add_object +json_add_array answer +json_add_string "" "$__IP" +json_close_array +json_close_object +json_close_array + +__URL="$__ENDPOINT/zones/$username/$domain/$__RRTYPE" + +__STATUS=$(curl -s -X POST "$__URL" \ + -H "X-NSONE-Key: $password" \ + -H "Content-Type: application/json" \ + -d "$(json_dump)" \ + -w "%{http_code}\n" -o $DATFILE 2>$ERRFILE) + +if [ $? -ne 0 ]; then + write_log 14 "Curl failed: $(cat $ERRFILE)" + return 1 +elif [ -z $__STATUS ] || [ $__STATUS != 200 ]; then + write_log 4 "Request failed: $__STATUS, NS1 answered: $(cat $DATFILE)" + if [ $__STATUS = 404 ]; then + write_log 4 "Status is 404, trying to create a DNS record" + + json_init + json_add_string "zone" "$username" + json_add_string "domain" "$domain" + json_add_string "type" "$__RRTYPE" + json_add_string "ttl" "$__TTL" + json_add_array answers + json_add_object + json_add_array answer + json_add_string "" "$__IP" + json_close_array + json_close_object + json_close_array + + __STATUS=$(curl -s -X PUT "$__URL" \ + -H "X-NSONE-Key: $password" \ + -H "Content-Type: application/json" \ + -d "$(json_dump)" \ + -w "%{http_code}\n" -o $DATFILE 2>$ERRFILE) + + if [ $? -ne 0 ]; then + write_log 14 "Curl failed: $(cat $ERRFILE)" + return 1 + elif [ -z $__STATUS ] || [ $__STATUS != 200 ]; then + write_log 14 "Request failed: $__STATUS, NS1 answered: $(cat $DATFILE)" + return 1 + fi + else + return 1 + fi +fi + +write_log 7 "NS1 answered: $(cat $DATFILE)" + +return 0 diff --git a/net/ddns-scripts/files/update_nsupdate.sh b/net/ddns-scripts/files/usr/lib/ddns/update_nsupdate.sh old mode 100755 new mode 100644 similarity index 92% rename from net/ddns-scripts/files/update_nsupdate.sh rename to net/ddns-scripts/files/usr/lib/ddns/update_nsupdate.sh index 983664cbca..039196ff80 --- a/net/ddns-scripts/files/update_nsupdate.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/update_nsupdate.sh @@ -17,8 +17,8 @@ # local __TTL=600 #.preset DNS TTL (in seconds) local __RRTYPE __PW __TCP -local __PROG=$(which nsupdate) # BIND nsupdate ? -[ -z "$__PROG" ] && __PROG=$(which knsupdate) # Knot nsupdate ? +local __PROG=$(command -v nsupdate) # BIND nsupdate ? +[ -z "$__PROG" ] && __PROG=$(command -v knsupdate) # Knot nsupdate ? [ -z "$__PROG" ] && write_log 14 "'nsupdate' or 'knsupdate' not installed !" [ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing 'username'" diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_one_com.sh b/net/ddns-scripts/files/usr/lib/ddns/update_one_com.sh new file mode 100644 index 0000000000..94ec2ef4a0 --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/update_one_com.sh @@ -0,0 +1,142 @@ +#!/bin/sh + +# ONE.COM DDNS SCRIPT +# REQUIRES CURL +# $ opkg install curl + +# SCRIPT BY LUGICO +# CONTACT: main@lugico.de + +[ -z "$CURL" ] && [ -z "$CURL_SSL" ] && write_log 14 "one.com communication require cURL with SSL support. Please install" +[ -z "$domain" ] && write_log 14 "Service section not configured correctly! Missing 'domain'" +[ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing 'username'" +[ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing 'password'" + +. /usr/share/libubox/jshn.sh + +write_log 0 "one.com ddns script started" + +local __SUBDOMAIN __MAINDOMAIN __LOGINURL __RECORDID +local __TTL=3600 + +COOKIEJAR=$(mktemp /tmp/one_com_cookiejar.XXXXXX) || exit 1 + +__SUBDOMAIN=$(echo $domain | sed -e 's/[^\.]*\.[^\.]*$//' -e 's/\.$//' ) +__MAINDOMAIN=$(echo $domain | sed -e "s/${__SUBDOMAIN}\.//" ) + + +# LOGGING IN +# GET LOGIN POST URL FROM FORM +__LOGINURL=$( $CURL \ + -RsSL \ + --stderr $ERRFILE \ + -c $COOKIEJAR \ + "https://www.one.com/admin/" \ + | grep 'Login-form login autofill' \ + | sed -e 's/.*action="//' -e 's/".*//' -e 's/\&/\&/g' \ +) + +# POST LOGIN DATA +$CURL \ + -RsSL \ + --stderr $ERRFILE \ + -c $COOKIEJAR \ + -b $COOKIEJAR \ + "${__LOGINURL}" \ + -H "Content-Type: application/x-www-form-urlencoded" \ + -X POST \ + -d "username=${username}&password=${password}&credentialId=" \ + | grep "Invalid username or password." > $DATFILE + +if [ "$?" == "0" ] ; then + write_log 14 "Invalid credentials" + return 1 +fi + + +# SETTING DOMAIN +$CURL -RsSL \ + --stderr $ERRFILE \ + -c $COOKIEJAR \ + -b $COOKIEJAR \ + "https://www.one.com/admin/select-admin-domain.do?domain=${__MAINDOMAIN}" \ + | grep "" > $DATFILE + +if [ "$?" != "0" ] ; then + write_log 14 "Failed to select domain '${__MAINDOMAIN}'" + return 1 +fi + + +# GETTING RECORD ID +records=$( $CURL \ + -RsSL \ + --stderr $ERRFILE \ + -c $COOKIEJAR \ + -b $COOKIEJAR \ + "https://www.one.com/admin/api/domains/${__MAINDOMAIN}/dns/custom_records" +) + +json_load "$records" + +if json_is_a "result" "object" && \ + json_select "result" && \ + json_is_a "data" "array" +then + json_select "data" + i=1 + while json_is_a ${i} "object" ; do + json_select "${i}" + json_select "attributes" + json_get_var "prefix" "prefix" + json_close_object + if [ "$prefix" == "$__SUBDOMAIN" ] ; then + json_get_var "__RECORDID" "id" + write_log 0 "Found record id : ${__RECORDID}" + break + fi + json_close_object + i=$(($i + 1)) + done +fi + + +if [ "${__RECORDID}" == "" ] ; then + write_log 14 "domain record not found" + return 1 +fi + + +# CREATING PATCH DATA +json_init +json_add_string "type" "dns_service_records" +json_add_string "id" "${__RECORDID}" +json_add_object "attributes" +json_add_string "type" "A" +json_add_string "prefix" "${__SUBDOMAIN}" +json_add_string "content" "${__IP}" +json_add_int "ttl" ${__TTL} +patchdata=$(json_dump) + + +# SENDING PATCH +$CURL \ + -RsSL \ + --stderr $ERRFILE \ + -c $COOKIEJAR \ + -b $COOKIEJAR \ + -X PATCH \ + -d "$patchdata" \ + -H "Content-Type: application/json" \ + "https://www.one.com/admin/api/domains/${__MAINDOMAIN}/dns/custom_records/${__RECORDID}" \ + | grep "priority" > $DATFILE + +if [ "$?" != "0" ] ; then + write_log 14 "one.com gave an unexpected response" + return 1 +fi + +rm $COOKIEJAR +write_log 0 "one.com ddns script finished without errors" + +return 0 diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_pdns.sh b/net/ddns-scripts/files/usr/lib/ddns/update_pdns.sh new file mode 100755 index 0000000000..a19ed13f12 --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/update_pdns.sh @@ -0,0 +1,63 @@ +#!/bin/sh +# Derived from update_gandi_net.sh +. /usr/share/libubox/jshn.sh + +local __TTL=600 +local __RRTYPE +local __STATUS +local __RNAME + +[ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing subdomain as 'username'" +[ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing API Key as 'password'" +[ -z "$param_opt" ] && write_log 14 "Service section not configured correctly! Missing PowerDNS URL as 'Optional Parameter'(param_opt)" + +# Create endpoint from $param_opt +# e.g. param_opt=http://127.0.0.1:8081 +local __ENDPOINT="$param_opt/api/v1/servers/localhost/zones" + +[ $use_ipv6 -ne 0 ] && __RRTYPE="AAAA" || __RRTYPE="A" + +# Make sure domain is period terminated +if [ ${domain: -1} != '.' ]; then + domain="${domain}." +fi +if [ $username == '@' ]; then + __RNAME="$domain" +else + __RNAME="$username.$domain" +fi + +# Build JSON payload +json_init +json_add_array rrsets +json_add_object + json_add_string name "$__RNAME" + json_add_string type "$__RRTYPE" + json_add_int ttl $__TTL + json_add_string changetype "REPLACE" + json_add_array records + json_add_object + json_add_string content "$__IP" + json_add_boolean disabled 0 + json_close_object + json_close_array +json_close_object +json_close_array + +__STATUS=$(curl -Ss -X PATCH "$__ENDPOINT/$domain" \ + -H "X-Api-Key: $password" \ + -H "Content-Type: application/json" \ + -d "$(json_dump)" \ + -w "%{http_code}\n" \ + -o $DATFILE 2>$ERRFILE) + + +if [ $? -ne 0 ]; then + write_log 14 "Curl failed: $(cat $ERRFILE)" + return 1 +elif [ -z $__STATUS ] || [ $__STATUS != 204 ]; then + write_log 14 "PowerDNS request failed: $__STATUS \n$(cat $DATFILE)" + return 1 +fi + +return 0 diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_porkbun_v3.sh b/net/ddns-scripts/files/usr/lib/ddns/update_porkbun_v3.sh new file mode 100644 index 0000000000..f1824d9d5b --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/update_porkbun_v3.sh @@ -0,0 +1,162 @@ +# +# Distributed under the terms of the GNU General Public License (GPL) version 2.0 +# 2024 Ansel Horn +# +# Script for DDNS support via Porkbun's v3 API for the OpenWRT ddns-scripts package. +# +# Will attempt to create a new or edit an existing A or AAAA record for the +# given domain and subdomain. Existing CNAME and ALIAS records WILL NOT BE +# EDITED OR DELETED! "username" and "password" configurations should be set to +# Porkbun API key and secret key, respectively. +# +# Porkbun API documentation: +# https://porkbun.com/api/json/v3/documentation#DNS%20Create%20Record +# + +# Source JSON parser +. /usr/share/libubox/jshn.sh + +# Set API base URL +# Porkbun has warned it may change API hostname in the future: +# https://porkbun.com/api/json/v3/documentation#apiHost +__API="https://api.porkbun.com/api/json/v3" + +# Check availability of cURL with SSL +[ -z "$CURL" ] && [ -z "$CURL_SSL" ] && write_log 14 "cURL with SSL support required! Please install" + +# Validate configuration +[ -z "$domain" ] && write_log 14 "Service section not configured correctly! Missing 'domain'" +[ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing 'username'" +[ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing 'password'" + +# Split FQDN into domain and subdomain(s) +__DOMAIN_REGEX='^\(\(.*\)\.\)\?\([^.]\+\.[^.]\+\)$' +echo $domain | grep "$__DOMAIN_REGEX" > /dev/null || write_log 14 "Invalid domain! Check 'domain' config" +__DOMAIN=$(echo $domain | sed -e "s/$__DOMAIN_REGEX/\3/") +__SUBDOMAIN=$(echo $domain | sed -e "s/$__DOMAIN_REGEX/\2/") + +# Determine IPv4 or IPv6 address and record type +if [ "$use_ipv6" -eq 1 ]; then + expand_ipv6 "$__IP" __ADDR + __TYPE="AAAA" +else + __ADDR="$__IP" + __TYPE="A" +fi + + +# Inject authentication into API request JSON payload +function json_authenticate() { + json_add_string "apikey" "$username" + json_add_string "secretapikey" "$password" +} + +# Make Porkbun API call +# $1 - Porkbun API endpoint +# $2 - request JSON payload +function api_call() { + local response url + url="$__API/$1" + write_log 7 "API endpoint URL: $url" + write_log 7 "API request JSON payload: $2" + response=$($CURL --data "$2" "$url") + write_log 7 "API response JSON payload: $response" + echo "$response" +} + +# Check Porkbun API response status +function json_check_status() { + local status + json_get_var status "status" + [ "$status" == "SUCCESS" ] || write_log 14 "API request failed!" +} + +# Review DNS record and, if it is the record we're looking for, get its id +function callback_review_record() { + local id name type + json_select "$2" + json_get_var id "id" + json_get_var name "name" + json_get_var type "type" + [ "$name" == "$domain" -a "$type" == "$__TYPE" ] && echo "$id" + json_select .. +} + +# Retrieve all DNS records, find the first appropriate A/AAAA record, and get its id +function find_existing_record_id() { + local request response + json_init + json_authenticate + request=$(json_dump) + response=$(api_call "/dns/retrieve/$__DOMAIN" "$request") + json_load "$response" + json_check_status + json_for_each_item callback_review_record "records" +} + +# Create a new A/AAAA record +function create_record() { + local request response + json_init + json_authenticate + json_add_string "name" "$__SUBDOMAIN" + json_add_string "type" "$__TYPE" + json_add_string "content" "$__ADDR" + request=$(json_dump) + response=$(api_call "/dns/create/$__DOMAIN" "$request") + json_load "$response" + json_check_status +} + +# Retrieve an existing record and get its content +# $1 - record id to retrieve +function retrieve_record_content() { + local content request response + json_init + json_authenticate + request=$(json_dump) + response=$(api_call "/dns/retrieve/$__DOMAIN/$1" "$request") + json_load "$response" + json_check_status + json_select "records" + json_select 1 + json_get_var content "content" + echo "$content" +} + +# Edit an existing A/AAAA record +# $1 - record id to edit +function edit_record() { + local request response + json_init + json_authenticate + json_add_string "type" "$__TYPE" + json_add_string "content" "$__ADDR" + request=$(json_dump) + response=$(api_call "/dns/edit/$__DOMAIN/$1" "$request") + json_load "$response" + json_check_status +} + + +# Try to identify an appropriate existing DNS record to update +if [ -z $rec_id]; then + write_log 7 "Retrieving DNS $__TYPE record" + __ID=$(find_existing_record_id) +else + write_log 7 "Using user-supplied DNS record id: $rec_id" + __ID=$rec_id +fi + +# Create or update DNS record with current IP address +if [ -z "$__ID" ]; then + write_log 7 "Creating new DNS $__TYPE record" + create_record +else + write_log 7 "Updating existing DNS $__TYPE record" + if [ "$(retrieve_record_content $__ID)" == "$__ADDR" ]; then + write_log 7 "Skipping Porkbun-unsupported forced noop update" + else + edit_record "$__ID" + fi +fi diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_route53_v1.sh b/net/ddns-scripts/files/usr/lib/ddns/update_route53_v1.sh new file mode 100644 index 0000000000..0d474051ee --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/update_route53_v1.sh @@ -0,0 +1,96 @@ +#!/bin/sh +# Distributed under the terms of the GNU General Public License (GPL) version 2.0 +# based on Yuval Adam's route53.sh found at https://github.com/yuvadm/route53-ddns/blob/master/route53.sh +# 2017 Max Berger + +[ -z "${CURL_SSL}" ] && write_log 14 "Amazon AWS Route53 communication require cURL with SSL support. Please install" +[ -z "${username}" ] && write_log 14 "Service section not configured correctly! Missing key as 'username'" +[ -z "${password}" ] && write_log 14 "Service section not configured correctly! Missing secret as 'password'" +[ -z "${domain}" ] && write_log 14 "Service section not configured correctly! Missing zone id as 'domain'" + +ENDPOINT="route53.amazonaws.com" +RECORD_TTL=300 +RECORD_NAME="${lookup_host}." +RECORD_VALUE="${__IP}" +[ ${use_ipv6} -eq 0 ] && RECORD_TYPE="A" +[ ${use_ipv6} -eq 1 ] && RECORD_TYPE="AAAA" + +HOSTED_ZONE_ID="${domain}" +API_PATH="/2013-04-01/hostedzone/${HOSTED_ZONE_ID}/rrset/" + +AWS_ACCESS_KEY_ID="${username}" +AWS_SECRET_ACCESS_KEY="${password}" +AWS_REGION='us-east-1' +AWS_SERVICE='route53' + +hash() { + msg="$1" + echo -en "${msg}" | openssl dgst -sha256 | sed 's/^.* //' +} + +sign_plain() { + # Sign message using a plaintext key + key="$1" + msg="$2" + echo -en "${msg}" | openssl dgst -hex -sha256 -hmac "${key}" | sed 's/^.* //' +} + +sign() { + # Sign message using a hex formatted key + key="$1" + msg="$2" + echo -en "${msg}" | openssl dgst -hex -sha256 -mac HMAC -macopt "hexkey:${key}" | sed 's/^.* //' +} + +request_body=" \ + \ + \ + \ + \ + UPSERT \ + \ + ${RECORD_NAME} \ + ${RECORD_TYPE} \ + ${RECORD_TTL} \ + \ + \ + ${RECORD_VALUE} \ + \ + \ + \ + \ + \ + \ +" + +fulldate="$(date --utc +%Y%m%dT%H%M%SZ)" +shortdate="$(date --utc +%Y%m%d)" +signed_headers="host;x-amz-date" +request_hash="$(hash "${request_body}")" +canonical_request="POST\n${API_PATH}\n\nhost:route53.amazonaws.com\nx-amz-date:${fulldate}\n\n${signed_headers}\n${request_hash}" + +date_key="$(sign_plain "AWS4${AWS_SECRET_ACCESS_KEY}" "${shortdate}")" +region_key="$(sign "${date_key}" ${AWS_REGION})" +service_key="$(sign "${region_key}" ${AWS_SERVICE})" +signing_key="$(sign "${service_key}" aws4_request)" + +credential="${shortdate}/${AWS_REGION}/${AWS_SERVICE}/aws4_request" +sigmsg="AWS4-HMAC-SHA256\n${fulldate}\n${credential}\n$(hash "${canonical_request}")" + +signature="$(sign "${signing_key}" "${sigmsg}")" + +authorization="AWS4-HMAC-SHA256 Credential=${AWS_ACCESS_KEY_ID}/${credential}, SignedHeaders=${signed_headers}, Signature=${signature}" + +ANSWER="$(flock /tmp/$(basename -s .sh "$0").lock curl \ + -X "POST" \ + -H "Host: route53.amazonaws.com" \ + -H "X-Amz-Date: ${fulldate}" \ + -H "Authorization: ${authorization}" \ + -H "Content-Type: text/xml" \ + -d "$request_body" \ + "https://${ENDPOINT}${API_PATH}")" +write_log 7 "${ANSWER}" + +echo "${ANSWER}" | grep -F "Error" >/dev/null && return 1 +echo "${ANSWER}" | grep -F "ChangeInfo" >/dev/null && return 0 +return 2 diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_transip_nl.sh b/net/ddns-scripts/files/usr/lib/ddns/update_transip_nl.sh new file mode 100644 index 0000000000..fe46987f77 --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/update_transip_nl.sh @@ -0,0 +1,134 @@ +#!/bin/sh +# +# 2021 Martijn Atema +# +# This script sends ddns updates using the TransIP API (see https://api.transip.nl/) +# and is parsed by dynamic_dns_functions.sh inside send_update(). +# +# The following options provided by ddns are used: +# username - Username of account used for logging in to TransIP +# password - Private key generated at https://www.transip.nl/cp/account/api/ +# (make sure to accept non-whitelisted IP addresses) +# domain - Base domain name registered at TransIP +# ('domain.tld' when updating 'hostname.domain.tld') +# param_enc - Name of DNS record to update +# ('hostname' when updating 'hostname.domain.tld') +# param_opt - TTL of the DNS record to update (in seconds) +# +# Note: Make sure that there is exactly one record of type A (for IPv4) or +# AAAA (for IPv6) with the specified name and TTL. That record will be +# updated by this script. +# +# The script requires cURL with SSL and the openssl binary + + +[ -z "${username}" ] && write_log 14 "Service config is missing 'username'" +[ -z "${password}" ] && write_log 14 "Service config is missing 'password' (private key)" +[ -z "${domain}" ] && write_log 14 "Service config is missing 'domain' (base domain name)" +[ -z "${param_enc}" ] && write_log 14 "Service config is missing 'param_enc' (DNS record name)" +[ -z "${param_opt}" ] && write_log 14 "Service config is missing 'param_opt' (DNS record TTL)" + +[ -z "${CURL_SSL}" ] && write_log 14 "TransIP update requires cURL with SSL" +[ -z "$(openssl version)" ] && write_log 14 "TransIP update requires openssl binary" + +. /usr/share/libubox/jshn.sh + + +# Re-format the private key and write to a temporary file + +__tmp_keyfile="$(mktemp -t ddns-transip.XXXXXX)" + +echo "${password}" | \ + sed -e "s/-----BEGIN PRIVATE KEY-----\s*/&\n/" \ + -e "s/-----END PRIVATE KEY-----/\n&/" \ + -e "s/\S\{64\}\s*/&\n/g" \ + > "${__tmp_keyfile}" + + +# Create authentication request + +json_init +json_add_string "login" "${username}" +json_add_string "label" "DDNS-script ($(openssl rand -hex 4))" +json_add_string "nonce" $(openssl rand -hex 16) +json_add_boolean "read_only" 0 +json_add_boolean "global_key" 1 +__auth_body="$(json_dump)" + + +# Sign body using the private key and encode with base64 + +__auth_signature=$(echo -n "${__auth_body}" | \ + openssl dgst -sha512 -sign "${__tmp_keyfile}" | \ + openssl base64 | \ + tr -d " \t\n\r") + +rm "${__tmp_keyfile}" + + +# Send and parse request for a temporary authentication token + +__auth_status=$(curl -s -X POST "https://api.transip.nl/v6/auth" \ + -H "Content-Type: application/json" \ + -H "Signature: ${__auth_signature}" \ + -d "${__auth_body}" \ + -w "%{http_code}\n" \ + -o "${DATFILE}" 2>"${ERRFILE}") + + +# Logging for error and debug + +if [ $? -ne 0 ]; then + write_log 14 "Curl failed: $(cat "${ERRFILE}")" + return 1 +fi + +if [ -z ${__auth_status} ] || [ ${__auth_status} -ne 201 ]; then + write_log 14 "TransIP authentication (status ${__auth_status}) failed: $(cat ${DATFILE})" + return 1 +fi + +write_log 7 "TransIP authentication successful" + + +## Extract token from the response + +__auth_token=$(cat ${DATFILE} | sed 's/^.*"token" *: *"\([^"]*\)".*$/\1/') + + +# Create request body for update + +json_init +json_add_object "dnsEntry" +json_add_string "name" "${param_enc}" +json_add_string "type" "$([ $use_ipv6 -ne 0 ] && echo -n AAAA || echo -n A)" +json_add_int "expire" "${param_opt}" +json_add_string "content" "${__IP}" +json_close_object +__update_body="$(json_dump)" + + +# Send update request + +__update_status=$(curl -s -X PATCH "https://api.transip.nl/v6/domains/${domain}/dns" \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer ${__auth_token}" \ + -d "${__update_body}" \ + -w "%{http_code}\n" \ + -o "${DATFILE}" 2>"${ERRFILE}") + + +# Logging for error and debug + +if [ $? -ne 0 ]; then + write_log 14 "Curl failed: $(cat "${ERRFILE}")" + return 1 +fi + +if [ -z ${__update_status} ] || [ ${__update_status} -ne 204 ]; then + write_log 14 "TransIP DNS update (status ${__update_status}) failed: $(cat ${DATFILE})" + return 1 +fi + +write_log 7 "TransIP DNS update successful" +return 0 diff --git a/net/ddns-scripts/files/usr/share/ddns/default/3322.org.json b/net/ddns-scripts/files/usr/share/ddns/default/3322.org.json new file mode 100644 index 0000000000..d166dc44df --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/3322.org.json @@ -0,0 +1,6 @@ +{ + "name": "3322.org", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@members.3322.org/dyndns/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/afraid.org-basicauth.json b/net/ddns-scripts/files/usr/share/ddns/default/afraid.org-basicauth.json new file mode 100644 index 0000000000..b4f73fa55f --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/afraid.org-basicauth.json @@ -0,0 +1,9 @@ +{ + "name": "afraid.org-basicauth", + "ipv4": { + "url": "https://[USERNAME]:[PASSWORD]@freedns.afraid.org/nic/update?hostname=[DOMAIN]&myip=[IP]" + }, + "ipv6": { + "url": "https://[USERNAME]:[PASSWORD]@freedns.afraid.org/nic/update?hostname=[DOMAIN]&myip=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/afraid.org-keyauth.json b/net/ddns-scripts/files/usr/share/ddns/default/afraid.org-keyauth.json new file mode 100644 index 0000000000..166b004baa --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/afraid.org-keyauth.json @@ -0,0 +1,9 @@ +{ + "name": "afraid.org-keyauth", + "ipv4": { + "url": "https://freedns.afraid.org/dynamic/update.php?[PASSWORD]&address=[IP]" + }, + "ipv6": { + "url": "https://freedns.afraid.org/dynamic/update.php?[PASSWORD]&address=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/afraid.org-v2-basic.json b/net/ddns-scripts/files/usr/share/ddns/default/afraid.org-v2-basic.json new file mode 100644 index 0000000000..436caf488c --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/afraid.org-v2-basic.json @@ -0,0 +1,9 @@ +{ + "name": "afraid.org-v2-basic", + "ipv4": { + "url": "https://[USERNAME]:[PASSWORD]@sync.afraid.org/u/?h=[DOMAIN]&ip=[IP]" + }, + "ipv6": { + "url": "https://[USERNAME]:[PASSWORD]@v6.sync.afraid.org/u/?h=[DOMAIN]&ip=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/afraid.org-v2-token.json b/net/ddns-scripts/files/usr/share/ddns/default/afraid.org-v2-token.json new file mode 100644 index 0000000000..0786dd823d --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/afraid.org-v2-token.json @@ -0,0 +1,9 @@ +{ + "name": "afraid.org-v2-token", + "ipv4": { + "url": "https://sync.afraid.org/u/[PASSWORD]/?address=[IP]" + }, + "ipv6": { + "url": "https://v6.sync.afraid.org/u/[PASSWORD]/?address=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/all-inkl.com.json b/net/ddns-scripts/files/usr/share/ddns/default/all-inkl.com.json new file mode 100644 index 0000000000..d0f5b7369e --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/all-inkl.com.json @@ -0,0 +1,9 @@ +{ + "name": "all-inkl.com", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@dyndns.kasserver.com/?myip=[IP]" + }, + "ipv6": { + "url": "http://[USERNAME]:[PASSWORD]@dyndns.kasserver.com/?myip=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/bind-nsupdate.json b/net/ddns-scripts/files/usr/share/ddns/default/bind-nsupdate.json new file mode 100644 index 0000000000..f91806a15d --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/bind-nsupdate.json @@ -0,0 +1,9 @@ +{ + "name": "bind-nsupdate", + "ipv4": { + "url": "update_nsupdate.sh" + }, + "ipv6": { + "url": "update_nsupdate.sh" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/changeip.com.json b/net/ddns-scripts/files/usr/share/ddns/default/changeip.com.json new file mode 100644 index 0000000000..3472f0b306 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/changeip.com.json @@ -0,0 +1,7 @@ +{ + "name": "changeip.com", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@nic.changeip.com/nic/update?u=[USERNAME]&p=[PASSWORD]&cmd=update&hostname=[DOMAIN]&ip=[IP]", + "answer": "Successful" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/cloud.google.com-v1.json b/net/ddns-scripts/files/usr/share/ddns/default/cloud.google.com-v1.json new file mode 100644 index 0000000000..eee707b3e2 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/cloud.google.com-v1.json @@ -0,0 +1,10 @@ +{ + "name": "cloud.google.com-v1", + "ipv4": { + "url": "update_gcp_v1.sh" + }, + "ipv6": { + "url": "update_gcp_v1.sh" + } +} + diff --git a/net/ddns-scripts/files/usr/share/ddns/default/cloudflare.com-v4.json b/net/ddns-scripts/files/usr/share/ddns/default/cloudflare.com-v4.json new file mode 100644 index 0000000000..66a1d118fc --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/cloudflare.com-v4.json @@ -0,0 +1,9 @@ +{ + "name": "cloudflare.com-v4", + "ipv4": { + "url": "update_cloudflare_com_v4.sh" + }, + "ipv6": { + "url": "update_cloudflare_com_v4.sh" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/cnkuai.cn.json b/net/ddns-scripts/files/usr/share/ddns/default/cnkuai.cn.json new file mode 100644 index 0000000000..1e9bebf5f1 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/cnkuai.cn.json @@ -0,0 +1,9 @@ +{ + "name": "cnkuai.cn", + "ipv4": { + "url": "update_cnkuai_cn.sh" + }, + "ipv6": { + "url": "update_cnkuai_cn.sh" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/core-networks.de.json b/net/ddns-scripts/files/usr/share/ddns/default/core-networks.de.json new file mode 100644 index 0000000000..c334d77339 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/core-networks.de.json @@ -0,0 +1,11 @@ +{ + "name": "core-networks.de", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@dyndns.core-networks.de/?hostname=[DOMAIN]&myip=[IP]&keepipv6=1", + "answer": "good" + }, + "ipv6": { + "url": "http://[USERNAME]:[PASSWORD]@dyndns.core-networks.de/?hostname=[DOMAIN]&myip=[IP]&keepipv4=1", + "answer": "good" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/ddnss.de.json b/net/ddns-scripts/files/usr/share/ddns/default/ddnss.de.json new file mode 100644 index 0000000000..17cdf0e3b9 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/ddnss.de.json @@ -0,0 +1,7 @@ +{ + "name": "ddnss.de", + "ipv4": { + "url": "http://ip4.ddnss.de/upd.php?user=[USERNAME]&pwd=[PASSWORD]&host=[DOMAIN]&ip=[IP]", + "answer": "Updated|No change" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/ddo.jp.json b/net/ddns-scripts/files/usr/share/ddns/default/ddo.jp.json new file mode 100644 index 0000000000..1cf53b5725 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/ddo.jp.json @@ -0,0 +1,6 @@ +{ + "name": "ddo.jp", + "ipv4": { + "url": "http://free.ddo.jp/dnsupdate.php?dn=[DOMAIN]&pw=[PASSWORD]&ip=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/desec.io.json b/net/ddns-scripts/files/usr/share/ddns/default/desec.io.json new file mode 100644 index 0000000000..c28458fee6 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/desec.io.json @@ -0,0 +1,11 @@ +{ + "name": "desec.io", + "ipv4": { + "url": "https://update.dedyn.io/update?username=[USERNAME]&password=[PASSWORD]&hostname=[DOMAIN]&myipv4=[IP]&myipv6=preserve", + "answer": "good|nochg" + }, + "ipv6": { + "url": "https://update.dedyn.io/update?username=[USERNAME]&password=[PASSWORD]&hostname=[DOMAIN]&myipv6=[IP]&myipv4=preserve", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/dhis.org.json b/net/ddns-scripts/files/usr/share/ddns/default/dhis.org.json new file mode 100644 index 0000000000..cc2ce3e5ba --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/dhis.org.json @@ -0,0 +1,9 @@ +{ + "name": "dhis.org", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@is.dhis.org/" + }, + "ipv6": { + "url": "http://[USERNAME]:[PASSWORD]@is.dhis.org/" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/digitalocean.com-v2.json b/net/ddns-scripts/files/usr/share/ddns/default/digitalocean.com-v2.json new file mode 100644 index 0000000000..abeac560f2 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/digitalocean.com-v2.json @@ -0,0 +1,9 @@ +{ + "name": "digitalocean.com-v2", + "ipv4": { + "url": "update_digitalocean_com_v2.sh" + }, + "ipv6": { + "url": "update_digitalocean_com_v2.sh" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/dnsdynamic.org.json b/net/ddns-scripts/files/usr/share/ddns/default/dnsdynamic.org.json new file mode 100644 index 0000000000..f1fd1810a3 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/dnsdynamic.org.json @@ -0,0 +1,7 @@ +{ + "name": "dnsdynamic.org", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@www.dnsdynamic.org/api/?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/dnsever.com.json b/net/ddns-scripts/files/usr/share/ddns/default/dnsever.com.json new file mode 100644 index 0000000000..23f9ac9417 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/dnsever.com.json @@ -0,0 +1,6 @@ +{ + "name": "dnsever.com", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@dyna.dnsever.com/update.php?host[[DOMAIN]]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/dnsexit.com.json b/net/ddns-scripts/files/usr/share/ddns/default/dnsexit.com.json new file mode 100644 index 0000000000..89d7a8147f --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/dnsexit.com.json @@ -0,0 +1,6 @@ +{ + "name": "dnsexit.com", + "ipv4": { + "url": "http://update.dnsexit.com/RemoteUpdate.sv?login=[USERNAME]&password=[PASSWORD]&host=[DOMAIN]&myip=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/dnshome.de.json b/net/ddns-scripts/files/usr/share/ddns/default/dnshome.de.json new file mode 100644 index 0000000000..f767de2bc9 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/dnshome.de.json @@ -0,0 +1,9 @@ +{ + "name": "dnshome.de", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@www.dnshome.de/dyndns.php?hostname=[DOMAIN]&ip=[IP]" + }, + "ipv6": { + "url": "http://[USERNAME]:[PASSWORD]@www.dnshome.de/dyndns.php?hostname=[DOMAIN]&ip6=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/dnsmadeeasy.com.json b/net/ddns-scripts/files/usr/share/ddns/default/dnsmadeeasy.com.json new file mode 100644 index 0000000000..744301af5c --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/dnsmadeeasy.com.json @@ -0,0 +1,7 @@ +{ + "name": "dnsmadeeasy.com", + "ipv4": { + "url": "http://cp.dnsmadeeasy.com/servlet/updateip?username=[USERNAME]&password=[PASSWORD]&id=[DOMAIN]&ip=[IP]", + "answer": "success|ip-same" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/dnsmax.com.json b/net/ddns-scripts/files/usr/share/ddns/default/dnsmax.com.json new file mode 100644 index 0000000000..e84667a772 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/dnsmax.com.json @@ -0,0 +1,6 @@ +{ + "name": "dnsmax.com", + "ipv4": { + "url": "http://update.dnsmax.com/update/?username=[USERNAME]&password=[PASSWORD]&resellerid=1&clientname=openwrt&clientversion=8.09&protocolversion=2.0&updatehostname=[DOMAIN]&ip=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/dnsomatic.com.json b/net/ddns-scripts/files/usr/share/ddns/default/dnsomatic.com.json new file mode 100644 index 0000000000..09df1eb009 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/dnsomatic.com.json @@ -0,0 +1,7 @@ +{ + "name": "dnsomatic.com", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@updates.dnsomatic.com/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/dnspark.com.json b/net/ddns-scripts/files/usr/share/ddns/default/dnspark.com.json new file mode 100644 index 0000000000..f10e1f2468 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/dnspark.com.json @@ -0,0 +1,7 @@ +{ + "name": "dnspark.com", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@control.dnspark.com/api/dynamic/update.php?hostname=[DOMAIN]&ip=[IP]", + "answer": "ok|nochange" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/dnspod.cn.json b/net/ddns-scripts/files/usr/share/ddns/default/dnspod.cn.json new file mode 100644 index 0000000000..dcfa4a2594 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/dnspod.cn.json @@ -0,0 +1,9 @@ +{ + "name": "dnspod.cn", + "ipv4": { + "url": "update_dnspod_cn.sh" + }, + "ipv6": { + "url": "update_dnspod_cn.sh" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/do.de.json b/net/ddns-scripts/files/usr/share/ddns/default/do.de.json new file mode 100644 index 0000000000..3884a01ae8 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/do.de.json @@ -0,0 +1,11 @@ +{ + "name": "do.de", + "ipv4": { + "url": "http://ddns.do.de/?myip=[IP]&hostname=[DOMAIN]&username=[USERNAME]&password=[PASSWORD]", + "answer": "good|nochg" + }, + "ipv6": { + "url": "http://ddns.do.de/?myip=[IP]&hostname=[DOMAIN]&username=[USERNAME]&password=[PASSWORD]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/domopoli.de.json b/net/ddns-scripts/files/usr/share/ddns/default/domopoli.de.json new file mode 100644 index 0000000000..517751cc44 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/domopoli.de.json @@ -0,0 +1,7 @@ +{ + "name": "domopoli.de", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@http://dyndns.domopoli.de/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/duckdns.org.json b/net/ddns-scripts/files/usr/share/ddns/default/duckdns.org.json new file mode 100644 index 0000000000..625c9f9904 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/duckdns.org.json @@ -0,0 +1,11 @@ +{ + "name": "duckdns.org", + "ipv4": { + "url": "http://www.duckdns.org/update?domains=[DOMAIN]&token=[PASSWORD]&ip=[IP]", + "answer": "OK" + }, + "ipv6": { + "url": "http://www.duckdns.org/update?domains=[DOMAIN]&token=[PASSWORD]&ipv6=[IP]", + "answer": "OK" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/duiadns.net.json b/net/ddns-scripts/files/usr/share/ddns/default/duiadns.net.json new file mode 100644 index 0000000000..bbf9998be7 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/duiadns.net.json @@ -0,0 +1,9 @@ +{ + "name": "duiadns.net", + "ipv4": { + "url": "http://ip.duiadns.net/dynamic.duia?host=[DOMAIN]&password=[PASSWORD]&ip4=[IP]" + }, + "ipv6": { + "url": "http://ip.duiadns.net/dynamic.duia?host=[DOMAIN]&password=[PASSWORD]&ip6=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/dy.fi.json b/net/ddns-scripts/files/usr/share/ddns/default/dy.fi.json new file mode 100644 index 0000000000..ce9e4fd817 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/dy.fi.json @@ -0,0 +1,7 @@ +{ + "name": "dy.fi", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@www.dy.fi/nic/update?hostname=[DOMAIN]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/dyn.com.json b/net/ddns-scripts/files/usr/share/ddns/default/dyn.com.json new file mode 100644 index 0000000000..0ac779b064 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/dyn.com.json @@ -0,0 +1,11 @@ +{ + "name": "dyn.com", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@members.dyndns.org/v3/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + }, + "ipv6": { + "url": "http://[USERNAME]:[PASSWORD]@members.dyndns.org/v3/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/dyndns.it.json b/net/ddns-scripts/files/usr/share/ddns/default/dyndns.it.json new file mode 100644 index 0000000000..2cffb347fc --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/dyndns.it.json @@ -0,0 +1,7 @@ +{ + "name": "dyndns.it", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@update.dyndns.it/nic/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/dyndns.org.json b/net/ddns-scripts/files/usr/share/ddns/default/dyndns.org.json new file mode 100644 index 0000000000..a0c064f4d0 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/dyndns.org.json @@ -0,0 +1,11 @@ +{ + "name": "dyndns.org", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@members.dyndns.org/v3/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + }, + "ipv6": { + "url": "http://[USERNAME]:[PASSWORD]@members.dyndns.org/v3/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/dynu.com.json b/net/ddns-scripts/files/usr/share/ddns/default/dynu.com.json new file mode 100644 index 0000000000..2c25ea90f4 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/dynu.com.json @@ -0,0 +1,9 @@ +{ + "name": "dynu.com", + "ipv4": { + "url": "http://api.dynu.com/nic/update?hostname=[DOMAIN]&myip=[IP]&username=[USERNAME]&password=[PASSWORD]" + }, + "ipv6": { + "url": "http://api.dynu.com/nic/update?hostname=[DOMAIN]&myipv6=[IP]&username=[USERNAME]&password=[PASSWORD]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/dynv6.com.json b/net/ddns-scripts/files/usr/share/ddns/default/dynv6.com.json new file mode 100644 index 0000000000..66c62aa70c --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/dynv6.com.json @@ -0,0 +1,11 @@ +{ + "name": "dynv6.com", + "ipv4": { + "url": "http://dynv6.com/api/update?hostname=[DOMAIN]&token=[PASSWORD]&ipv4=[IP]", + "answer": "updated|unchanged" + }, + "ipv6": { + "url": "http://dynv6.com/api/update?hostname=[DOMAIN]&token=[PASSWORD]&ipv6=[IP]", + "answer": "updated|unchanged" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/easydns.com.json b/net/ddns-scripts/files/usr/share/ddns/default/easydns.com.json new file mode 100644 index 0000000000..0642c38dd0 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/easydns.com.json @@ -0,0 +1,11 @@ +{ + "name": "easydns.com", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@api.cp.easydns.com/dyn/generic.php?hostname=[DOMAIN]&myip=[IP]", + "answer": "OK|NOERROR" + }, + "ipv6": { + "url": "http://[USERNAME]:[PASSWORD]@api.cp.easydns.com/dyn/generic.php?hostname=[DOMAIN]&myip=[IP]", + "answer": "OK|NOERROR" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/freedns.42.pl.json b/net/ddns-scripts/files/usr/share/ddns/default/freedns.42.pl.json new file mode 100644 index 0000000000..c04dc1dd42 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/freedns.42.pl.json @@ -0,0 +1,6 @@ +{ + "name": "freedns.42.pl", + "ipv4": { + "url": "update_freedns_42_pl.sh" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/gandi.net.json b/net/ddns-scripts/files/usr/share/ddns/default/gandi.net.json new file mode 100644 index 0000000000..de54a16a4f --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/gandi.net.json @@ -0,0 +1,9 @@ +{ + "name": "gandi.net", + "ipv4": { + "url": "update_gandi_net.sh" + }, + "ipv6": { + "url": "update_gandi_net.sh" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/godaddy.com-v1.json b/net/ddns-scripts/files/usr/share/ddns/default/godaddy.com-v1.json new file mode 100644 index 0000000000..211e0e5f5a --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/godaddy.com-v1.json @@ -0,0 +1,9 @@ +{ + "name": "godaddy.com-v1", + "ipv4": { + "url": "update_godaddy_com_v1.sh" + }, + "ipv6": { + "url": "update_godaddy_com_v1.sh" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/goip.de.json b/net/ddns-scripts/files/usr/share/ddns/default/goip.de.json new file mode 100644 index 0000000000..5aaf3baed8 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/goip.de.json @@ -0,0 +1,9 @@ +{ + "name": "goip.de", + "ipv4": { + "url": "http://www.goip.de/setip?username=[USERNAME]&password=[PASSWORD]&subdomain=[DOMAIN]&ip=[IP]" + }, + "ipv6": { + "url": "http://www.goip.de/setip?username=[USERNAME]&password=[PASSWORD]&subdomain=[DOMAIN]&ip6=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/google.com.json b/net/ddns-scripts/files/usr/share/ddns/default/google.com.json new file mode 100644 index 0000000000..edfe461c86 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/google.com.json @@ -0,0 +1,11 @@ +{ + "name": "google.com", + "ipv4": { + "url": "https://[USERNAME]:[PASSWORD]@domains.google.com/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + }, + "ipv6": { + "url": "https://[USERNAME]:[PASSWORD]@domains.google.com/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/he.net.json b/net/ddns-scripts/files/usr/share/ddns/default/he.net.json new file mode 100644 index 0000000000..7043efe671 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/he.net.json @@ -0,0 +1,11 @@ +{ + "name": "he.net", + "ipv4": { + "url": "http://[DOMAIN]:[PASSWORD]@dyn.dns.he.net/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + }, + "ipv6": { + "url": "http://[DOMAIN]:[PASSWORD]@dyn.dns.he.net/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/hosting.de.json b/net/ddns-scripts/files/usr/share/ddns/default/hosting.de.json new file mode 100644 index 0000000000..c41ee35e44 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/hosting.de.json @@ -0,0 +1,11 @@ +{ + "name": "hosting.de", + "ipv4": { + "url": "https://[USERNAME]:[PASSWORD]@ddns.hosting.de/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + }, + "ipv6": { + "url": "https://[USERNAME]:[PASSWORD]@ddns.hosting.de/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/huaweicloud.com.json b/net/ddns-scripts/files/usr/share/ddns/default/huaweicloud.com.json new file mode 100644 index 0000000000..be549deb64 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/huaweicloud.com.json @@ -0,0 +1,9 @@ +{ + "name": "huaweicloud.com", + "ipv4": { + "url": "update_huaweicloud_com.sh" + }, + "ipv6": { + "url": "update_huaweicloud_com.sh" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/infomaniak.com.json b/net/ddns-scripts/files/usr/share/ddns/default/infomaniak.com.json new file mode 100644 index 0000000000..80541aca99 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/infomaniak.com.json @@ -0,0 +1,11 @@ +{ + "name": "infomaniak.com", + "ipv4": { + "url": "https://[USERNAME]:[PASSWORD]@infomaniak.com/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + }, + "ipv6": { + "url": "https://[USERNAME]:[PASSWORD]@infomaniak.com/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/inwx.de.json b/net/ddns-scripts/files/usr/share/ddns/default/inwx.de.json new file mode 100644 index 0000000000..10b16a9856 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/inwx.de.json @@ -0,0 +1,11 @@ +{ + "name": "inwx.de", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@dyndns.inwx.com/nic/update?myip=[IP]", + "answer": "good|nochg" + }, + "ipv6": { + "url": "http://[USERNAME]:[PASSWORD]@dyndns.inwx.com/nic/update?myipv6=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/ipnodns.ru.json b/net/ddns-scripts/files/usr/share/ddns/default/ipnodns.ru.json new file mode 100644 index 0000000000..026caa19c5 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/ipnodns.ru.json @@ -0,0 +1,7 @@ +{ + "name": "ipnodns.ru", + "ipv4": { + "url": "https://ipnodns.ru/cgi-bin/dyndns.cgi?login=[USERNAME]&secret=[PASSWORD]", + "answer": "ok" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/joker.com.json b/net/ddns-scripts/files/usr/share/ddns/default/joker.com.json new file mode 100644 index 0000000000..af897f18e1 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/joker.com.json @@ -0,0 +1,7 @@ +{ + "name": "joker.com", + "ipv4": { + "url": "http://svc.joker.com/nic/update?username=[USERNAME]&password=[PASSWORD]&myip=[IP]&hostname=[DOMAIN]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/loopia.se.json b/net/ddns-scripts/files/usr/share/ddns/default/loopia.se.json new file mode 100644 index 0000000000..f1c3fc22fb --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/loopia.se.json @@ -0,0 +1,11 @@ +{ + "name": "loopia.se", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@dns.loopia.se/XDynDNSServer/XDynDNS.php?system=custom&hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + }, + "ipv6": { + "url": "http://[USERNAME]:[PASSWORD]@dns.loopia.se/XDynDNSServer/XDynDNS.php?system=custom&hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/luadns.com-v1.json b/net/ddns-scripts/files/usr/share/ddns/default/luadns.com-v1.json new file mode 100644 index 0000000000..c77d55be3c --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/luadns.com-v1.json @@ -0,0 +1,9 @@ +{ + "name": "luadns.com-v1", + "ipv4": { + "url": "update_luadns_v1.sh" + }, + "ipv6": { + "url": "update_luadns_v1.sh" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/moniker.com.json b/net/ddns-scripts/files/usr/share/ddns/default/moniker.com.json new file mode 100644 index 0000000000..c5b7aa984c --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/moniker.com.json @@ -0,0 +1,7 @@ +{ + "name": "moniker.com", + "ipv4": { + "url": "https://dynamicdns.key-systems.net/update.php?hostname=[DOMAIN]&password=[PASSWORD]&ip=[IP]", + "answer": "success" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/mydns.jp.json b/net/ddns-scripts/files/usr/share/ddns/default/mydns.jp.json new file mode 100644 index 0000000000..11e9887359 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/mydns.jp.json @@ -0,0 +1,9 @@ +{ + "name": "mydns.jp", + "ipv4": { + "url": "http://www.mydns.jp/directip.html?MID=[USERNAME]&PWD=[PASSWORD]&IPV4ADDR=[IP]" + }, + "ipv6": { + "url": "http://www.mydns.jp/directip.html?MID=[USERNAME]&PWD=[PASSWORD]&IPV6ADDR=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/myonlineportal.net.json b/net/ddns-scripts/files/usr/share/ddns/default/myonlineportal.net.json new file mode 100644 index 0000000000..b3196d6d68 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/myonlineportal.net.json @@ -0,0 +1,11 @@ +{ + "name": "myonlineportal.net", + "ipv4": { + "url": "http://myonlineportal.net/updateddns?hostname=[DOMAIN]&ip=[IP]&username=[USERNAME]&password=[PASSWORD]", + "answer": "good|nochg" + }, + "ipv6": { + "url": "http://myonlineportal.net/updateddns?hostname=[DOMAIN]&ip6=[IP]&username=[USERNAME]&password=[PASSWORD]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/mythic-beasts.com-v2.json b/net/ddns-scripts/files/usr/share/ddns/default/mythic-beasts.com-v2.json new file mode 100644 index 0000000000..e246223805 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/mythic-beasts.com-v2.json @@ -0,0 +1,9 @@ +{ + "name": "mythic-beasts.com (API v2)", + "ipv4": { + "url": "https://[USERNAME]:[PASSWORD]@ipv4.api.mythic-beasts.com/dns/v2/dynamic/[DOMAIN]" + }, + "ipv6": { + "url": "https://[USERNAME]:[PASSWORD]@ipv6.api.mythic-beasts.com/dns/v2/dynamic/[DOMAIN]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/mythic-beasts.com.json b/net/ddns-scripts/files/usr/share/ddns/default/mythic-beasts.com.json new file mode 100644 index 0000000000..9b2556becc --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/mythic-beasts.com.json @@ -0,0 +1,9 @@ +{ + "name": "mythic-beasts.com", + "ipv4": { + "url": "http://dnsapi4.mythic-beasts.com/?domain=[USERNAME]&password=[PASSWORD]&command=REPLACE%20[DOMAIN]%2060%20A%20DYNAMIC_IP&origin=." + }, + "ipv6": { + "url": "http://dnsapi6.mythic-beasts.com/?domain=[USERNAME]&password=[PASSWORD]&command=REPLACE%20[DOMAIN]%2060%20AAAA%20DYNAMIC_IP&origin=." + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/namecheap.com.json b/net/ddns-scripts/files/usr/share/ddns/default/namecheap.com.json new file mode 100644 index 0000000000..bbb0c1fc38 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/namecheap.com.json @@ -0,0 +1,6 @@ +{ + "name": "namecheap.com", + "ipv4": { + "url": "http://dynamicdns.park-your-domain.com/update?host=[USERNAME]&domain=[DOMAIN]&password=[PASSWORD]&ip=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/njal.la.json b/net/ddns-scripts/files/usr/share/ddns/default/njal.la.json new file mode 100644 index 0000000000..5da8850d7f --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/njal.la.json @@ -0,0 +1,9 @@ +{ + "name": "njal.la", + "ipv4": { + "url": "https://njal.la/update/?h=[DOMAIN]&k=[PASSWORD]&a=[IP]" + }, + "ipv6": { + "url": "https://njal.la/update/?h=[DOMAIN]&k=[PASSWORD]&aaaa=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/no-ip.com.json b/net/ddns-scripts/files/usr/share/ddns/default/no-ip.com.json new file mode 100644 index 0000000000..e0f8ccb543 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/no-ip.com.json @@ -0,0 +1,10 @@ +{ + "name": "no-ip.com", + "ipv4": { + "url": "update_no-ip_com.sh" + }, + "ipv6": { + "url": "update_no-ip_com.sh" + } +} + diff --git a/net/ddns-scripts/files/usr/share/ddns/default/no-ip.pl.json b/net/ddns-scripts/files/usr/share/ddns/default/no-ip.pl.json new file mode 100644 index 0000000000..323a415ae1 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/no-ip.pl.json @@ -0,0 +1,9 @@ +{ + "name": "no-ip.pl", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@update.no-ip.pl/?hostname=[DOMAIN]" + }, + "ipv6": { + "url": "http://[USERNAME]:[PASSWORD]@update.no-ip.pl/?hostname=[DOMAIN]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/now-dns.com.json b/net/ddns-scripts/files/usr/share/ddns/default/now-dns.com.json new file mode 100644 index 0000000000..8c4a2209b0 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/now-dns.com.json @@ -0,0 +1,11 @@ +{ + "name": "now-dns.com", + "ipv4": { + "url": "https://[USERNAME]:[PASSWORD]@now-dns.com/update?hostname=[DOMAIN]", + "answer": "good|nochg" + }, + "ipv6": { + "url": "https://[USERNAME]:[PASSWORD]@now-dns.com/update?hostname=[DOMAIN]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/ns1.com.json b/net/ddns-scripts/files/usr/share/ddns/default/ns1.com.json new file mode 100644 index 0000000000..93484b6cca --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/ns1.com.json @@ -0,0 +1,9 @@ +{ + "name": "ns1.com", + "ipv4": { + "url": "update_ns1_com.sh" + }, + "ipv6": { + "url": "update_ns1_com.sh" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/nsupdate.info.json b/net/ddns-scripts/files/usr/share/ddns/default/nsupdate.info.json new file mode 100644 index 0000000000..435e41dfec --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/nsupdate.info.json @@ -0,0 +1,11 @@ +{ + "name": "nsupdate.info", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@ipv4.nsupdate.info/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + }, + "ipv6": { + "url": "http://[USERNAME]:[PASSWORD]@ipv6.nsupdate.info/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/one.com.json b/net/ddns-scripts/files/usr/share/ddns/default/one.com.json new file mode 100644 index 0000000000..9245a73086 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/one.com.json @@ -0,0 +1,6 @@ +{ + "name": "one.com", + "ipv4": { + "url": "update_one_com.sh" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/opendns.com.json b/net/ddns-scripts/files/usr/share/ddns/default/opendns.com.json new file mode 100644 index 0000000000..35d4953ce9 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/opendns.com.json @@ -0,0 +1,7 @@ +{ + "name":"opendns.com", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@updates.opendns.com/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/oray.com.json b/net/ddns-scripts/files/usr/share/ddns/default/oray.com.json new file mode 100644 index 0000000000..3172805734 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/oray.com.json @@ -0,0 +1,6 @@ +{ + "name": "oray.com", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@ddns.oray.com/ph/update?hostname=[DOMAIN]&myip=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/ovh.com.json b/net/ddns-scripts/files/usr/share/ddns/default/ovh.com.json new file mode 100644 index 0000000000..446093bcec --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/ovh.com.json @@ -0,0 +1,11 @@ +{ + "name": "ovh.com", + "ipv4": { + "url": "https://[USERNAME]:[PASSWORD]@dns.eu.ovhapis.com/nic/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + }, + "ipv6": { + "url": "https://[USERNAME]:[PASSWORD]@dns.eu.ovhapis.com/nic/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/pdns.json b/net/ddns-scripts/files/usr/share/ddns/default/pdns.json new file mode 100644 index 0000000000..aa6faa657e --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/pdns.json @@ -0,0 +1,9 @@ +{ + "name": "PowerDNS", + "ipv4": { + "url": "update_pdns.sh" + }, + "ipv6": { + "url": "update_pdns.sh" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/porkbun.com-v3.json b/net/ddns-scripts/files/usr/share/ddns/default/porkbun.com-v3.json new file mode 100644 index 0000000000..69509c191a --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/porkbun.com-v3.json @@ -0,0 +1,9 @@ +{ + "name": "porkbun.com-v3", + "ipv4": { + "url": "update_porkbun_v3.sh" + }, + "ipv6": { + "url": "update_porkbun_v3.sh" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/regfish.de.json b/net/ddns-scripts/files/usr/share/ddns/default/regfish.de.json new file mode 100644 index 0000000000..9b17995929 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/regfish.de.json @@ -0,0 +1,11 @@ +{ + "name": "regfish.de", + "ipv4": { + "url": "http://dyndns.regfish.de/?fqdn=[DOMAIN]&forcehost=1&authtype=secure&token=[PASSWORD]&ipv4=[IP]", + "answer": "success|100|101" + }, + "ipv6": { + "url": "http://dyndns.regfish.de/?fqdn=[DOMAIN]&forcehost=1&authtype=secure&token=[PASSWORD]&ipv6=[IP]", + "answer": "success|100|101" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/route53-v1.json b/net/ddns-scripts/files/usr/share/ddns/default/route53-v1.json new file mode 100644 index 0000000000..bf5d8d37ba --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/route53-v1.json @@ -0,0 +1,9 @@ +{ + "name": "route53-v1", + "ipv4": { + "url": "update_route53_v1.sh" + }, + "ipv6": { + "url": "update_route53_v1.sh" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/schokokeks.org.json b/net/ddns-scripts/files/usr/share/ddns/default/schokokeks.org.json new file mode 100644 index 0000000000..480c069319 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/schokokeks.org.json @@ -0,0 +1,7 @@ +{ + "name": "schokokeks.org", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@dyndns.schokokeks.org/nic/update?myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/selfhost.de.json b/net/ddns-scripts/files/usr/share/ddns/default/selfhost.de.json new file mode 100644 index 0000000000..0db3895c80 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/selfhost.de.json @@ -0,0 +1,7 @@ +{ + "name": "selfhost.de", + "ipv4": { + "url": "http://carol.selfhost.de/update?username=[USERNAME]&password=[PASSWORD]&myip=[IP]&hostname=1", + "answer": "good|nochg|200|204" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/servercow.de.json b/net/ddns-scripts/files/usr/share/ddns/default/servercow.de.json new file mode 100644 index 0000000000..ebe963ab56 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/servercow.de.json @@ -0,0 +1,11 @@ +{ + "name": "servercow.de", + "ipv4": { + "url": "http://www.servercow.de/dnsupdate/update.php?username=[USERNAME]&pass=[PASSWORD]&hostname=[DOMAIN]&ipaddr=[IP]", + "answer": "OKv4" + }, + "ipv6": { + "url": "http://www.servercow.de/dnsupdate/update.php?username=[USERNAME]&pass=[PASSWORD]&hostname=[DOMAIN]&ip6addr=[IP]", + "answer": "OKv6" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/simply.com.json b/net/ddns-scripts/files/usr/share/ddns/default/simply.com.json new file mode 100644 index 0000000000..5ab9c8d519 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/simply.com.json @@ -0,0 +1,11 @@ +{ + "name": "simply.com", + "ipv4": { + "url": "https://[USERNAME]:[PASSWORD]@api.simply.com/2/ddns/?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + }, + "ipv6": { + "url": "https://[USERNAME]:[PASSWORD]@api.simply.com/2/ddns/?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/sitelutions.com.json b/net/ddns-scripts/files/usr/share/ddns/default/sitelutions.com.json new file mode 100644 index 0000000000..a9fec1fb7c --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/sitelutions.com.json @@ -0,0 +1,7 @@ +{ + "name": "sitelutions.com", + "ipv4": { + "url": "https://dnsup.sitelutions.com/dnsup?user=[USERNAME]&pass=[PASSWORD]&id=[DOMAIN]&ip=[IP]", + "answer": "success" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/spdyn.de.json b/net/ddns-scripts/files/usr/share/ddns/default/spdyn.de.json new file mode 100644 index 0000000000..a9352efc9e --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/spdyn.de.json @@ -0,0 +1,11 @@ +{ + "name": "spdyn.de", + "ipv4": { + "url": "https://update.spdyn.de/nic/update?hostname=[DOMAIN]&myip=[IP]&user=[USERNAME]&pass=[PASSWORD]", + "answer": "good|nochg" + }, + "ipv6": { + "url": "https://update.spdyn.de/nic/update?hostname=[DOMAIN]&myip=[IP]&user=[USERNAME]&pass=[PASSWORD]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/strato.com.json b/net/ddns-scripts/files/usr/share/ddns/default/strato.com.json new file mode 100644 index 0000000000..9ab43d2476 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/strato.com.json @@ -0,0 +1,11 @@ +{ + "name": "strato.com", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@dyndns.strato.com/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + }, + "ipv6": { + "url": "http://[USERNAME]:[PASSWORD]@dyndns.strato.com/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/system-ns.com.json b/net/ddns-scripts/files/usr/share/ddns/default/system-ns.com.json new file mode 100644 index 0000000000..4c4ca7fce7 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/system-ns.com.json @@ -0,0 +1,8 @@ +{ + "name": "system-ns.com", + + "ipv4": { + "url": "http://system-ns.com/api?type=dynamic&command=set&domain=[DOMAIN]&token=[PASSWORD]&ip=[IP]", + "answer": "0" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/thatip.com.json b/net/ddns-scripts/files/usr/share/ddns/default/thatip.com.json new file mode 100644 index 0000000000..18e72b7535 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/thatip.com.json @@ -0,0 +1,6 @@ +{ + "name": "thatip.com", + "ipv4": { + "url": "http://update.dnsmax.com/update/?username=[USERNAME]&password=[PASSWORD]&resellerid=2&clientname=openwrt&clientversion=8.09&protocolversion=2.0&updatehostname=[DOMAIN]&ip=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/transip.nl.json b/net/ddns-scripts/files/usr/share/ddns/default/transip.nl.json new file mode 100644 index 0000000000..1dabb4f6e1 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/transip.nl.json @@ -0,0 +1,9 @@ +{ + "name": "transip.nl", + "ipv4": { + "url": "update_transip_nl.sh" + }, + "ipv6": { + "url": "update_transip_nl.sh" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/twodns.de.json b/net/ddns-scripts/files/usr/share/ddns/default/twodns.de.json new file mode 100644 index 0000000000..2d20e76c68 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/twodns.de.json @@ -0,0 +1,6 @@ +{ + "name": "twodns.de", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@update.twodns.de/update?hostname=[DOMAIN]&ip=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/udmedia.de.json b/net/ddns-scripts/files/usr/share/ddns/default/udmedia.de.json new file mode 100644 index 0000000000..fa9ff4c591 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/udmedia.de.json @@ -0,0 +1,9 @@ +{ + "name": "udmedia.de", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@www.udmedia.de/nic/update?myip=[IP]" + }, + "ipv6": { + "url": "http://[USERNAME]:[PASSWORD]@www.udmedia.de/nic/update?myip=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/variomedia.de.json b/net/ddns-scripts/files/usr/share/ddns/default/variomedia.de.json new file mode 100644 index 0000000000..fa86f4e62f --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/variomedia.de.json @@ -0,0 +1,11 @@ +{ + "name": "variomedia.de", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@dyndns.variomedia.de/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + }, + "ipv6": { + "url": "http://[USERNAME]:[PASSWORD]@dyndns.variomedia.de/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/xlhost.de.json b/net/ddns-scripts/files/usr/share/ddns/default/xlhost.de.json new file mode 100644 index 0000000000..302cdc6308 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/xlhost.de.json @@ -0,0 +1,7 @@ +{ + "name": "xlhost.de", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@nsupdate.xlhost.de/nic/update?hostname=[DOMAIN]&myip=[IP]", + "answer": "good|nochg" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/default/zoneedit.com.json b/net/ddns-scripts/files/usr/share/ddns/default/zoneedit.com.json new file mode 100644 index 0000000000..dd3c2263af --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/default/zoneedit.com.json @@ -0,0 +1,6 @@ +{ + "name": "zoneedit.com", + "ipv4": { + "url": "http://[USERNAME]:[PASSWORD]@dynamic.zoneedit.com/auth/dynamic.html?host=[DOMAIN]&dnsto=[IP]" + } +} diff --git a/net/ddns-scripts/files/usr/share/ddns/list b/net/ddns-scripts/files/usr/share/ddns/list new file mode 100644 index 0000000000..9373aeed03 --- /dev/null +++ b/net/ddns-scripts/files/usr/share/ddns/list @@ -0,0 +1,69 @@ +3322.org +afraid.org-basicauth +afraid.org-keyauth +afraid.org-v2-basic +afraid.org-v2-token +all-inkl.com +changeip.com +core-networks.de +ddnss.de +ddo.jp +desec.io +dhis.org +dnsdynamic.org +dnsever.com +dnsexit.com +dnshome.de +dnsmadeeasy.com +dnsmax.com +dnsomatic.com +dnspark.com +do.de +domopoli.de +duckdns.org +duiadns.net +dy.fi +dyn.com +dyndns.it +dyndns.org +dynu.com +dynv6.com +easydns.com +goip.de +google.com +he.net +hosting.de +infomaniak.com +ipnodns.ru +inwx.de +joker.com +loopia.se +moniker.com +mydns.jp +myonlineportal.net +mythic-beasts.com +mythic-beasts.com-v2 +namecheap.com +njal.la +no-ip.pl +now-dns.com +nsupdate.info +opendns.com +oray.com +ovh.com +regfish.de +schokokeks.org +selfhost.de +servercow.de +simply.com +sitelutions.com +spdyn.de +strato.com +system-ns.com +thatip.com +transip.nl +twodns.de +udmedia.de +variomedia.de +xlhost.de +zoneedit.com diff --git a/net/ddns-scripts/samples/ddns.config_sample b/net/ddns-scripts/samples/ddns.config_sample index a3aa7e8132..46bd8abe24 100644 --- a/net/ddns-scripts/samples/ddns.config_sample +++ b/net/ddns-scripts/samples/ddns.config_sample @@ -221,6 +221,11 @@ config service "myddns" # option ip_source "script" # option ip_script "" + # This option can be used in combination with ip_source "web" and ip_url. + # It adds a given user agent string to the request. + # Will only be used when wget or wget-ssl is installed. +# option user_agent "Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/95.0" + ########### # force_ipversion option will set the "-4" respectively "-6" parameter # on command line of transfer and DNS lookup program. diff --git a/net/ddns-scripts/samples/slaac_sample.sh b/net/ddns-scripts/samples/slaac_sample.sh new file mode 100755 index 0000000000..ea8f24d879 --- /dev/null +++ b/net/ddns-scripts/samples/slaac_sample.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# +# script to determine and return SLAAC ipv6 address using prefix from a locally configured interface and the MAC address of the device +# (c) 2018 Keve Mueller +# +# activated inside /etc/config/ddns by setting +# +# option ip_source 'script' +# option ip_script '/usr/lib/ddns/slaac_sample.sh br-lan AA:BB:CC:DD:EE:FF' +# +# the script is executed (not parsed) inside get_local_ip() function +# of /usr/lib/ddns/dynamic_dns_functions.sh +# +# useful when this box is the only DDNS client in the network and other clients use SLAAC +# so no need to install ddns client on every "internal" box +# +# NB: this will not catch the actual IPV6 used by the host when it is configured to use temporary addresses + +#NB: we need a valid MAC address that is fully expanded with leading zeroes on all positions +format_eui_64() { + local macaddr="$1" + echo ${macaddr:0:1}$(echo ${macaddr:1:1}|tr 0123456789abcdefABCDEF 23016745ab89efcd89efcd)${macaddr:3:2}:${macaddr:6:2}ff:fe${macaddr:9:2}:${macaddr:12:2}${macaddr:15:2} +} + +# expand :: in an ipv6 address specification to the appropriate series of 0: +# result will have 8 ipv6 fragments separated by single colon +# NB: input must be a valid IPv6 address, e.g. ::1 +# NB: numbers are not prepended with leading zeroes +expand_ipv6_colons() { + local ipv6=$1 +# we need :: to be in the middle, so prepend a 0 if the input starts with : and append 0 if it ends with it + if [ "${ipv6:0:1}" = ":" ]; then ipv6=0${ipv6}; fi + if [ "${ipv6: -1:1}" = ":" ]; then ipv6=${ipv6}0; fi +# retain only the real colons + local colons=${ipv6//::|[0123456789abcdefABCDEF]/} +# count them + local num_colons=${#colons} + local filler=":0:0:0:0:0:0:" +# replace the :: with the appropriate substring from filler + local ipv6_x=${ipv6/::/${filler:0:(7-$num_colons)*2-1}} + echo $ipv6_x +} + +# obtain the first ipv6 address of the device passed in $1 +addr_net=$(ip -6 -o addr show dev $1 scope global up | cut -d" " -f 7 | head -1) +#addr_net=$1 +addr=${addr_net%/*} +# TODO: we assume /64 subnet +# get the first 64 bits of the address +prefix=$(expand_ipv6_colons $addr | cut -d: -f -4) +# compute the SLAAC 64 bits from the MAC +suffix=$(format_eui_64 "$2") + +echo -n $prefix:$suffix +exit 0 + +#echo "Should never come here" >&2 +#exit 2 + diff --git a/net/ddns-scripts/samples/update_sample.sh b/net/ddns-scripts/samples/update_sample.sh index 00b51cbd2e..316dfa52ff 100644 --- a/net/ddns-scripts/samples/update_sample.sh +++ b/net/ddns-scripts/samples/update_sample.sh @@ -24,7 +24,7 @@ local __URL="http://[USERNAME]:[PASSWORD]@update.spdns.de/nic/update?hostname=[D [ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing 'password'" # do replaces in URL -__URL=$(echo $__URL | | sed -e "s#\[USERNAME\]#$URL_USER#g" -e "s#\[PASSWORD\]#$URL_PASS#g" \ +__URL=$(echo $__URL | sed -e "s#\[USERNAME\]#$URL_USER#g" -e "s#\[PASSWORD\]#$URL_PASS#g" \ -e "s#\[PARAMENC\]#$URL_PENC#g" -e "s#\[PARAMOPT\]#$param_opt#g" \ -e "s#\[DOMAIN\]#$domain#g" -e "s#\[IP\]#$__IP#g") [ $use_https -ne 0 ] && __URL=$(echo $__URL | sed -e 's#^http:#https:#') From 77142063696e2b493b07d1ff7bf1ff1c2b567ae4 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 29 Oct 2024 20:36:37 +0800 Subject: [PATCH 18/88] dmx_usb_module: fix kernel 6.6 build --- libs/dmx_usb_module/Makefile | 2 +- ...0-fix-compilation-warning-wrong-cast.patch | 37 +++++++++++++++++++ .../patches/101-fix-kernel-6.6-builds.patch | 14 +++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 libs/dmx_usb_module/patches/100-fix-compilation-warning-wrong-cast.patch create mode 100644 libs/dmx_usb_module/patches/101-fix-kernel-6.6-builds.patch diff --git a/libs/dmx_usb_module/Makefile b/libs/dmx_usb_module/Makefile index 971648cfad..309c6fe130 100644 --- a/libs/dmx_usb_module/Makefile +++ b/libs/dmx_usb_module/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=dmx_usb_module PKG_VERSION:=19.12.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/lowlander/dmx_usb_module/tar.gz/V$(PKG_VERSION)? diff --git a/libs/dmx_usb_module/patches/100-fix-compilation-warning-wrong-cast.patch b/libs/dmx_usb_module/patches/100-fix-compilation-warning-wrong-cast.patch new file mode 100644 index 0000000000..9d9767d1bb --- /dev/null +++ b/libs/dmx_usb_module/patches/100-fix-compilation-warning-wrong-cast.patch @@ -0,0 +1,37 @@ +From eeecf40c3eb3dbdf1981c508080ab3aa61e105e2 Mon Sep 17 00:00:00 2001 +From: Erwin Rol +Date: Fri, 13 Jan 2023 17:57:36 +0100 +Subject: [PATCH] Fix format warnings +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fix the following warning + +warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ {aka ‘long unsigned int’} + +Signed-off-by: Erwin Rol +--- + dmx_usb.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/dmx_usb.c ++++ b/dmx_usb.c +@@ -406,7 +406,7 @@ static ssize_t dmx_usb_write (struct fil + + dev = (struct dmx_usb_device *)file->private_data; + +- dbg("%s - minor %d, count = %d", __FUNCTION__, dev->minor, count); ++ dbg("%s - minor %d, count = %zu", __FUNCTION__, dev->minor, count); + + /* lock this object */ + down (&dev->sem); +@@ -500,7 +500,7 @@ static long dmx_usb_ioctl (struct file * + return -ENODEV; + } + +- dbg("%s - minor %d, cmd 0x%.4x, arg %ld", __FUNCTION__, ++ dbg("%s - minor %d, cmd 0x%.4x, arg %lu", __FUNCTION__, + dev->minor, cmd, arg); + + /* fill in your device specific stuff here */ diff --git a/libs/dmx_usb_module/patches/101-fix-kernel-6.6-builds.patch b/libs/dmx_usb_module/patches/101-fix-kernel-6.6-builds.patch new file mode 100644 index 0000000000..d0cd7bdbb3 --- /dev/null +++ b/libs/dmx_usb_module/patches/101-fix-kernel-6.6-builds.patch @@ -0,0 +1,14 @@ +--- a/dmx_usb.c ++++ b/dmx_usb.c +@@ -97,7 +97,11 @@ struct dmx_usb_device { + + + /* prevent races between open() and disconnect() */ ++#if(LINUX_VERSION_CODE < KERNEL_VERSION(6,5,3)) + static DEFINE_SEMAPHORE(disconnect_sem); ++#else ++ static DEFINE_SEMAPHORE(disconnect_sem, 1); ++#endif + + /* local function prototypes */ + static ssize_t dmx_usb_write (struct file *file, const char *buffer, size_t count, loff_t *ppos); From b784740ce47b4741652736f7c7321b31c5c97c59 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 30 Oct 2024 11:24:05 +0800 Subject: [PATCH 19/88] gl-mifi-mcu: remove package --- utils/gl-mifi-mcu/Makefile | 36 ------ utils/gl-mifi-mcu/src/Makefile | 4 - utils/gl-mifi-mcu/src/module.c | 210 --------------------------------- 3 files changed, 250 deletions(-) delete mode 100755 utils/gl-mifi-mcu/Makefile delete mode 100755 utils/gl-mifi-mcu/src/Makefile delete mode 100755 utils/gl-mifi-mcu/src/module.c diff --git a/utils/gl-mifi-mcu/Makefile b/utils/gl-mifi-mcu/Makefile deleted file mode 100755 index 08183d91e3..0000000000 --- a/utils/gl-mifi-mcu/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=gl-mifi-mcu -PKG_VERSION:=1 -PKG_RELEASE:=1 - -PKG_MAINTAINER:=Nuno Goncalves -PKG_LICENSE:=GPL-3.0-or-later - -include $(INCLUDE_DIR)/package.mk - -define KernelPackage/gl-mifi-mcu - SUBMENU:=Hardware Monitoring Support - TITLE:=GL.iNet GL-MiFI Power monitoring support - AUTOLOAD:=$(call AutoLoad,60,gl-mifi-mcu) - FILES:=$(PKG_BUILD_DIR)/gl-mifi-mcu.ko -endef - -define KernelPackage/gl-mifi-mcu/description - Interfaces with GL-MiFI Power monitoring MCU with a soft UART - and provides Battery SOC, Temperature and charging data at - /proc/gl_mifi_mcu. - This feature is supported from GL-MiFi PCB revision v2.6.2. - The content of /proc/gl_mifi_mcu is JSON as received from the - UART and will frequenty contain corrupted data due to soft UART - unreliability. User application must validate the data. -endef - -define Build/Compile - $(KERNEL_MAKE) \ - M="$(PKG_BUILD_DIR)" \ - modules -endef - -$(eval $(call KernelPackage,gl-mifi-mcu)) diff --git a/utils/gl-mifi-mcu/src/Makefile b/utils/gl-mifi-mcu/src/Makefile deleted file mode 100755 index bce424b1ba..0000000000 --- a/utils/gl-mifi-mcu/src/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -obj-m += gl-mifi-mcu.o - -gl-mifi-mcu-objs := module.o - diff --git a/utils/gl-mifi-mcu/src/module.c b/utils/gl-mifi-mcu/src/module.c deleted file mode 100755 index 8f5a5146b2..0000000000 --- a/utils/gl-mifi-mcu/src/module.c +++ /dev/null @@ -1,210 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Nuno Goncalves"); -MODULE_DESCRIPTION("GL-MiFi power monitoring MCU interface"); -MODULE_VERSION("0.1"); - -static int gpio_tx = 19; -static int gpio_rx = 8; -static int baudrate = 1200; -static int query_interval_sec = 4; - -static struct hrtimer timer_tx; -static struct hrtimer timer_rx; -static ktime_t period; -static int rx_bit_index = -1; - -static unsigned read_buf_ready = 0; -static unsigned read_buf_size = 0; -static char read_buf[2][64] = {{0},{0}}; - -static int proc_show(struct seq_file *m, void *v) -{ - seq_printf(m, "%s\n", read_buf[read_buf_ready]); - return 0; -} - -static int proc_open(struct inode *inode, struct file *file) -{ - return single_open(file, proc_show, NULL); -} - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) -static const struct proc_ops hello_proc_ops = { - .proc_open = proc_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_release = single_release, -}; -#else -static const struct file_operations hello_proc_ops = { - .owner = THIS_MODULE, - .open = proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; -#endif - -static irq_handler_t handle_rx_start(unsigned int irq, void* device, struct pt_regs* registers) -{ - if (rx_bit_index == -1) - { - hrtimer_start(&timer_rx, ktime_set(0, period / 2), HRTIMER_MODE_REL); - } - return (irq_handler_t) IRQ_HANDLED; -} - -static enum hrtimer_restart handle_tx(struct hrtimer* timer) -{ - ktime_t current_time = ktime_get(); - const unsigned char character = 'g'; - static int bit_index = -1; - - // Start bit. - if (bit_index == -1) - { - gpio_set_value(gpio_tx, 0); - bit_index++; - } - - // Data bits. - else if (0 <= bit_index && bit_index < 8) - { - gpio_set_value(gpio_tx, 1 & (character >> bit_index)); - bit_index++; - } - - // Stop bit. - else if (bit_index == 8) - { - gpio_set_value(gpio_tx, 1); - bit_index = -1; - } - - hrtimer_forward(&timer_tx, current_time, bit_index == 8 - ? ktime_set(query_interval_sec, 0) //wait for next query cycle - : period); //wait for next bit period - - return HRTIMER_RESTART; -} - -void receive_character(unsigned char character) -{ - if(character == '{') - read_buf_size = 0; - - if(read_buf_size < (sizeof(read_buf[0])-1) || character == '}') - { - read_buf[!read_buf_ready][read_buf_size++] = character; - if(character == '}') - { - read_buf[!read_buf_ready][read_buf_size] = '\0'; - read_buf_ready = !read_buf_ready; - read_buf_size = 0; - } - } -} - -static enum hrtimer_restart handle_rx(struct hrtimer* timer) -{ - ktime_t current_time = ktime_get(); - static unsigned int character = 0; - int bit_value = gpio_get_value(gpio_rx); - enum hrtimer_restart result = HRTIMER_NORESTART; - bool must_restart_timer = false; - - // Start bit. - if (rx_bit_index == -1) - { - rx_bit_index++; - character = 0; - must_restart_timer = true; - } - - // Data bits. - else if (0 <= rx_bit_index && rx_bit_index < 8) - { - if (bit_value == 0) - { - character &= 0xfeff; - } - else - { - character |= 0x0100; - } - - rx_bit_index++; - character >>= 1; - must_restart_timer = true; - } - - // Stop bit. - else if (rx_bit_index == 8) - { - receive_character(character); - rx_bit_index = -1; - } - - // Restarts the RX timer. - if (must_restart_timer) - { - hrtimer_forward(&timer_rx, current_time, period); - result = HRTIMER_RESTART; - } - - return result; -} - -static int __init init(void) -{ - bool success = true; - - proc_create("gl_mifi_mcu", 0, NULL, &hello_proc_ops); - - success &= gpio_request(gpio_tx, "soft_uart_tx") == 0; - success &= gpio_direction_output(gpio_tx, 1) == 0; - success &= gpio_request(gpio_rx, "soft_uart_rx") == 0; - success &= gpio_direction_input(gpio_rx) == 0; - success &= gpio_set_debounce(gpio_rx, 1000/baudrate/2); - - success &= request_irq( - gpio_to_irq(gpio_rx), - (irq_handler_t) handle_rx_start, - IRQF_TRIGGER_FALLING, - "gl_mifi_mcu_irq_handler", - NULL) == 0; - - hrtimer_init(&timer_tx, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - timer_tx.function = &handle_tx; - hrtimer_init(&timer_rx, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - timer_rx.function = &handle_rx; - period = ktime_set(0, 1000000000/baudrate); - hrtimer_start(&timer_tx, period, HRTIMER_MODE_REL); - - return success; -} - -static void __exit exit(void) -{ - disable_irq(gpio_to_irq(gpio_rx)); - hrtimer_cancel(&timer_tx); - hrtimer_cancel(&timer_rx); - free_irq(gpio_to_irq(gpio_rx), NULL); - gpio_set_value(gpio_tx, 0); - gpio_free(gpio_tx); - gpio_free(gpio_rx); - remove_proc_entry("gl_mifi_mcu", NULL); -} - -module_init(init); -module_exit(exit); - From afd175885f7d7ba10d0c2ac03d960b10261b2e16 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 31 Oct 2024 17:42:47 +0800 Subject: [PATCH 20/88] haproxy: revert to v2.8.5 --- net/haproxy/Makefile | 14 ++++++-------- net/haproxy/get-latest-patches.sh | 5 ++--- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index a7798ce3df..6dc1f2063c 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -10,12 +10,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=haproxy -PKG_VERSION:=3.0.0 +PKG_VERSION:=2.8.5 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://www.haproxy.org/download/3.0/src -PKG_HASH:=5aad97416216d2cd9dd212eb674839c40cd387f60fbc4b13d7ea3f1e5664a814 +PKG_SOURCE_URL:=https://www.haproxy.org/download/2.8/src +PKG_HASH:=3f5459c5a58e0b343a32eaef7ed5bed9d3fc29d8aa9e14b36c92c969fc2a60d9 PKG_MAINTAINER:=Thomas Heil , \ Christian Lachner @@ -46,7 +46,7 @@ endef define Package/haproxy $(call Package/haproxy/Default) TITLE+=with SSL support - DEPENDS+= +libpcre2 +libltdl +zlib +libpthread +liblua5.3 +libopenssl +libncurses +libreadline +libatomic + DEPENDS+= +libpcre +libltdl +zlib +libpthread +liblua5.3 +libopenssl +libncurses +libreadline +libatomic VARIANT:=ssl endef @@ -59,7 +59,7 @@ define Package/haproxy-nossl $(call Package/haproxy/Default) TITLE+=without SSL support VARIANT:=nossl - DEPENDS+= +libpcre2 +libltdl +zlib +libpthread +liblua5.3 +libatomic + DEPENDS+= +libpcre +libltdl +zlib +libpthread +liblua5.3 +libatomic CONFLICTS:=haproxy endef @@ -83,8 +83,6 @@ endif ifeq ($(BUILD_VARIANT),ssl) ADDON+=USE_OPENSSL=1 ADDON+=ADDLIB="-lcrypto -lm" - ADDON+=USE_QUIC=1 - ADDON+=USE_QUIC_OPENSSL_COMPAT=1 endif define Build/Compile @@ -94,7 +92,7 @@ define Build/Compile PCREDIR="$(STAGING_DIR)/usr/" \ USE_LUA=1 LUA_LIB_NAME="lua5.3" LUA_INC="$(STAGING_DIR)/usr/include/lua5.3" LUA_LIB="$(STAGING_DIR)/usr/lib" \ SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530" \ - USE_ZLIB=1 USE_PCRE2=1 USE_PCRE2_JIT=1 USE_PTHREAD_PSHARED=1 USE_LIBATOMIC=1 USE_PROMEX=1 \ + USE_ZLIB=1 USE_PCRE=1 USE_PCRE_JIT=1 USE_PTHREAD_PSHARED=1 USE_LIBATOMIC=1 USE_PROMEX=1 \ VERSION="$(PKG_VERSION)" SUBVERS="-$(PKG_RELEASE)" \ VERDATE="$(shell date -d @$(SOURCE_DATE_EPOCH) '+%Y/%m/%d')" IGNOREGIT=1 \ $(ADDON) \ diff --git a/net/haproxy/get-latest-patches.sh b/net/haproxy/get-latest-patches.sh index c5b766cb50..dc1451ff03 100755 --- a/net/haproxy/get-latest-patches.sh +++ b/net/haproxy/get-latest-patches.sh @@ -1,7 +1,7 @@ #!/bin/sh -CLONEURL=https://git.haproxy.org/git/haproxy-3.0.git -BASE_TAG=v3.0.0 +CLONEURL=https://git.haproxy.org/git/haproxy-2.8.git +BASE_TAG=v2.8.5 TMP_REPODIR=tmprepo PATCHESDIR=patches @@ -24,4 +24,3 @@ done rm -rf "${TMP_REPODIR}" printf "finished\n" - From 0fa76a3e6333664ab3a87c29a87b175bb6303c6d Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 6 Nov 2024 23:10:25 +0800 Subject: [PATCH 21/88] ddns-go: update to v6.7.6 --- net/ddns-go/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ddns-go/Makefile b/net/ddns-go/Makefile index 5b6e028358..ecf0b831b9 100644 --- a/net/ddns-go/Makefile +++ b/net/ddns-go/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ddns-go -PKG_VERSION:=6.7.0 -PKG_RELEASE:=2 +PKG_VERSION:=6.7.6 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/jeessy2/ddns-go/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=02e850e10fef76fef41102f11fa5c606d77cab876056618d36663e1869496353 +PKG_HASH:=8cb4cf2ba31fe351c01abc567600240951729c0e56180eb6a6ffbd8a8a22271d PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE From 00fb8ee59ea5b724ca9eb0d1932332198846867c Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 5 Nov 2024 23:10:16 +0800 Subject: [PATCH 22/88] cloudflared: bump to latest Fixes: #838 --- net/cloudflared/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/cloudflared/Makefile b/net/cloudflared/Makefile index b0e3caeefa..d694e7c367 100644 --- a/net/cloudflared/Makefile +++ b/net/cloudflared/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cloudflared -PKG_VERSION:=2023.2.2 +PKG_VERSION:=2024.11.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/cloudflare/cloudflared/tar.gz/$(PKG_VERSION)? -PKG_HASH:=b0abaff125d29c517894f6ea74dcc7044c92500670463595ba9ff4950a1d2fc2 +PKG_HASH:=bef01251bebfc2ddf146388c5b771bb41cc13a29f79dd7dfc504e47a2f161b63 PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE From 98b47a0b181800ae4478f630e76f1f8232987199 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 9 Nov 2024 23:27:56 +0800 Subject: [PATCH 23/88] ddns-scripts: fix cloudflare v4 script --- .../usr/lib/ddns/update_cloudflare_com_v4.sh | 58 ++++++++----------- 1 file changed, 24 insertions(+), 34 deletions(-) diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_cloudflare_com_v4.sh b/net/ddns-scripts/files/usr/lib/ddns/update_cloudflare_com_v4.sh index 4fb3a0dd6b..6dafc4e62e 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/update_cloudflare_com_v4.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/update_cloudflare_com_v4.sh @@ -15,7 +15,7 @@ # option password - cloudflare api key, you can get it from cloudflare.com/my-account/ # option domain - "hostname@yourdomain.TLD" # syntax changed to remove split_FQDN() function and tld_names.dat.gz # -# The proxy status would not be changed by this script. Please change it in Cloudflare dashboard manually. +# The proxy status would not be changed by this script. Please change it in Cloudflare dashboard manually. # # variable __IP already defined with the ip-address to use for update # @@ -27,26 +27,21 @@ [ $use_https -eq 0 ] && use_https=1 # force HTTPS # used variables -local __HOST __DOMAIN __TYPE __URLBASE __PRGBASE __RUNPROG __DATA __IPV6 __ZONEID __RECID __PROXIED +local __HOST __DOMAIN __FULLDOMAIN __TYPE __URLBASE __PRGBASE __RUNPROG __DATA __IPV6 __ZONEID __RECID __PROXIED local __URLBASE="https://api.cloudflare.com/client/v4" local __TTL=120 # split __HOST __DOMAIN from $domain -# given data: -# @example.com for "domain record" -# host.sub@example.com for a "host record" -__HOST=$(printf %s "$domain" | cut -d@ -f1) -__DOMAIN=$(printf %s "$domain" | cut -d@ -f2) - -# Cloudflare v4 needs: -# __DOMAIN = the base domain i.e. example.com -# __HOST = the FQDN of record to modify -# i.e. example.com for the "domain record" or host.sub.example.com for "host record" - -# handling domain record then set __HOST = __DOMAIN -[ -z "$__HOST" ] && __HOST=$__DOMAIN -# handling host record then rebuild fqdn host@domain.tld => host.domain.tld -[ "$__HOST" != "$__DOMAIN" ] && __HOST="${__HOST}.${__DOMAIN}" +[ "${domain:0:2}" == "@." ] && domain="${domain/./}" +[ "$domain" == "${domain/@/}" ] && domain="${domain/./@}" +__HOST="${domain%%@*}" +__DOMAIN="${domain#*@}" +[ -z "$__HOST" -o "$__HOST" == "$__DOMAIN" ] && __HOST="@" +if [ "$__HOST" = "@" ]; then +__FULLDOMAIN="${__DOMAIN}" +else +__FULLDOMAIN="${__HOST}.${__DOMAIN}" +fi # set record type [ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA" @@ -134,27 +129,23 @@ else fi __PRGBASE="$__PRGBASE --header 'Content-Type: application/json' " -if [ -n "$zone_id" ]; then - __ZONEID="$zone_id" -else - # read zone id for registered domain.TLD - __RUNPROG="$__PRGBASE --request GET '$__URLBASE/zones?name=$__DOMAIN'" - cloudflare_transfer || return 1 - # extract zone id - __ZONEID=$(grep -o '"id":\s*"[^"]*' $DATFILE | grep -o '[^"]*$' | head -1) - [ -z "$__ZONEID" ] && { - write_log 4 "Could not detect 'zone id' for domain.tld: '$__DOMAIN'" - return 127 - } -fi +# read zone id for registered domain.TLD +__RUNPROG="$__PRGBASE --request GET '$__URLBASE/zones?name=$__DOMAIN'" +cloudflare_transfer || return 1 +# extract zone id +__ZONEID=$(grep -o '"id":\s*"[^"]*' $DATFILE | grep -o '[^"]*$' | head -1) +[ -z "$__ZONEID" ] && { + write_log 4 "Could not detect 'zone id' for domain.tld: '$__DOMAIN'" + return 127 +} # read record id for A or AAAA record of host.domain.TLD -__RUNPROG="$__PRGBASE --request GET '$__URLBASE/zones/$__ZONEID/dns_records?name=$__HOST&type=$__TYPE'" +__RUNPROG="$__PRGBASE --request GET '$__URLBASE/zones/$__ZONEID/dns_records?name=${__FULLDOMAIN}&type=$__TYPE'" cloudflare_transfer || return 1 # extract record id __RECID=$(grep -o '"id":\s*"[^"]*' $DATFILE | grep -o '[^"]*$' | head -1) [ -z "$__RECID" ] && { - write_log 4 "Could not detect 'record id' for host.domain.tld: '$__HOST'" + write_log 4 "Could not detect 'record id' for host.domain.tld: '${__FULLDOMAIN}'" return 127 } @@ -191,7 +182,7 @@ __PROXIED=$(grep -o '"proxied":\s*[^",]*' $DATFILE | grep -o '[^:]*$') # use file to work around " needed for json cat > $DATFILE << EOF -{"id":"$__ZONEID","type":"$__TYPE","name":"$__HOST","content":"$__IP","ttl":$__TTL,"proxied":$__PROXIED} +{"id":"$__ZONEID","type":"$__TYPE","name":"${__FULLDOMAIN}","content":"$__IP","ttl":$__TTL,"proxied":$__PROXIED} EOF # let's complete transfer command @@ -199,4 +190,3 @@ __RUNPROG="$__PRGBASE --request PUT --data @$DATFILE '$__URLBASE/zones/$__ZONEID cloudflare_transfer || return 1 return 0 - From 1c38018ec081bc062822048a6737e8f9f8f87ff9 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 12 Nov 2024 23:16:41 +0800 Subject: [PATCH 24/88] uugamebooster: update version --- net/uugamebooster/Makefile | 84 ++++++++------------ net/uugamebooster/files/uugamebooster-update | 18 ----- net/uugamebooster/files/uugamebooster.config | 4 + net/uugamebooster/files/uugamebooster.init | 37 +++++++++ net/uugamebooster/update.sh | 35 ++++++++ 5 files changed, 107 insertions(+), 71 deletions(-) delete mode 100755 net/uugamebooster/files/uugamebooster-update create mode 100644 net/uugamebooster/files/uugamebooster.config create mode 100755 net/uugamebooster/files/uugamebooster.init create mode 100755 net/uugamebooster/update.sh diff --git a/net/uugamebooster/Makefile b/net/uugamebooster/Makefile index 6ca22e90cd..953c1935d4 100644 --- a/net/uugamebooster/Makefile +++ b/net/uugamebooster/Makefile @@ -1,22 +1,33 @@ +# SPDX-License-Identifier: GPL-3.0-only # -# Copyright (C) 2021 KFERMercer -# -# This is free software, licensed under the GNU General Public License v3. -# - -# -# to get the latest version & md5 checksum: -# curl -L -s -k -H "Accept:text/plain" "http://router.uu.163.com/api/plugin?type=openwrt-$(UU_ARCH)" -# +# Copyright (C) 2021 ImmortalWrt.org include $(TOPDIR)/rules.mk PKG_NAME:=uugamebooster -PKG_VERSION:=v7.9.14 -PKG_RELEASE:=1 +PKG_VERSION:=7.9.14 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(ARCH).tar.gz +PKG_SOURCE_URL:=https://uu.gdl.netease.com/uuplugin/openwrt-$(ARCH)/v$(PKG_VERSION)/uu.tar.gz? +ifeq ($(ARCH),aarch64) + PKG_HASH:=95ea5d99a6ad8d22c3650660d04d603508509972ec9098d680c82e7d51ff024e +else ifeq ($(ARCH),arm) + PKG_HASH:=2e624deea128a298fce71f243d92092dad23451de7f547ad82008b9dd989bca5 +else ifeq ($(ARCH),mipsel) + PKG_HASH:=31c08d893f46aaeddef41b37cdf10f935d5a45a136c6401fb71166d47cd8db12 +else ifeq ($(ARCH),x86_64) + PKG_HASH:=6025af23e771540e31f86144aebb1420d56e315e29cb3157ac1dc0da428fcf63 +endif + +PKG_LICENSE:=Proprietary include $(INCLUDE_DIR)/package.mk +STRIP:=true + +TAR_CMD=$(HOST_TAR) -C $(1)/ $(TAR_OPTIONS) + define Package/uugamebooster SECTION:=net CATEGORY:=Network @@ -26,60 +37,27 @@ define Package/uugamebooster endef define Package/uugamebooster/description - NetEase's UU Game Booster Accelerates Triple-A Gameplay and Market -endef - -ifeq ($(ARCH),arm) - UU_ARCH:=arm - PKG_HASH:=2e624deea128a298fce71f243d92092dad23451de7f547ad82008b9dd989bca5 -endif - -ifeq ($(ARCH),aarch64) - UU_ARCH:=aarch64 - PKG_HASH:=95ea5d99a6ad8d22c3650660d04d603508509972ec9098d680c82e7d51ff024e -endif - -ifeq ($(ARCH),mipsel) - UU_ARCH:=mipsel - PKG_HASH:=31c08d893f46aaeddef41b37cdf10f935d5a45a136c6401fb71166d47cd8db12 -endif - -ifeq ($(ARCH),x86_64) - UU_ARCH:=x86_64 - PKG_HASH:=6025af23e771540e31f86144aebb1420d56e315e29cb3157ac1dc0da428fcf63 -endif - -PKG_SOURCE_URL:=https://uu.gdl.netease.com/uuplugin/openwrt-$(UU_ARCH)/$(PKG_VERSION)/uu.tar.gz? -PKG_SOURCE:=$(PKG_NAME)-$(UU_ARCH)-$(PKG_VERSION).tar.gz - -STRIP:=true - -UNTAR_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/$(PKG_NAME)-$(UU_ARCH)-bin - -define Build/Prepare - mkdir -vp $(UNTAR_DIR) - tar -zxvf $(DL_DIR)/$(PKG_SOURCE) -C $(UNTAR_DIR) + NetEase's UU Game Booster Accelerates Triple-A Gameplay and Market. endef define Build/Compile endef define Package/uugamebooster/conffiles -/root/.uuplugin_uuid +/.uuplugin_uuid +/usr/share/uugamebooster/uu.conf endef define Package/uugamebooster/install - # $(INSTALL_DIR) $(1)/etc/init.d - # $(INSTALL_BIN) ./files/uugamebooster.init $(1)/etc/init.d/uuplugin + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/uuplugin $(1)/usr/bin/uugamebooster $(INSTALL_DIR) $(1)/usr/share/uugamebooster - $(INSTALL_BIN) $(UNTAR_DIR)/uuplugin $(1)/usr/share/uugamebooster/uuplugin - $(INSTALL_CONF) $(UNTAR_DIR)/uu.conf $(1)/usr/share/uugamebooster/uu.conf + $(INSTALL_CONF) $(PKG_BUILD_DIR)/uu.conf $(1)/usr/share/uugamebooster/uu.conf - # not finish yet: - # $(INSTALL_DIR) $(1)/usr/bin - # $(INSTALL_BIN) ./files/uugamebooster-update $(1)/usr/bin/uugamebooster - # $(LN) $(1)/usr/bin/uugamebooster/uugamebooster-update $(1)/usr/bin/uugamebooster-update + $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d + $(INSTALL_CONF) ./files/uugamebooster.config $(1)/etc/config/uugamebooster + $(INSTALL_BIN) ./files/uugamebooster.init $(1)/etc/init.d/uugamebooster endef $(eval $(call BuildPackage,uugamebooster)) diff --git a/net/uugamebooster/files/uugamebooster-update b/net/uugamebooster/files/uugamebooster-update deleted file mode 100755 index 8e07805888..0000000000 --- a/net/uugamebooster/files/uugamebooster-update +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# Return: 0 means update flag is set. -check_update() { - if [ -f "/usr/bin/uugamebooster/uu.update" ];then - return 0 - else - return 1 - fi -} - -check_update -if [ "$?" != "0" ];then - exit 0 - return -fi - -exit 0 diff --git a/net/uugamebooster/files/uugamebooster.config b/net/uugamebooster/files/uugamebooster.config new file mode 100644 index 0000000000..09016777d5 --- /dev/null +++ b/net/uugamebooster/files/uugamebooster.config @@ -0,0 +1,4 @@ + +config uugamebooster 'config' + option enabled '0' + diff --git a/net/uugamebooster/files/uugamebooster.init b/net/uugamebooster/files/uugamebooster.init new file mode 100755 index 0000000000..ed51795517 --- /dev/null +++ b/net/uugamebooster/files/uugamebooster.init @@ -0,0 +1,37 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2021 Tianling Shen + +USE_PROCD=1 +START=99 + +CONF="uugamebooster" +PROG="/usr/bin/uugamebooster" + +UU_CONF="/usr/share/uugamebooster/uu.conf" + +start_service() { + config_load "$CONF" + local enabled + config_get_bool enabled "config" "enabled" "0" + [ "$enabled" -eq "1" ] || return 1 + + procd_open_instance "$CONF" + + procd_set_param command "$PROG" "$UU_CONF" + + procd_set_param limits core="unlimited" + procd_set_param respawn + procd_set_param stdout 1 + procd_set_param stderr 1 + + procd_close_instance +} + +reload_service() { + stop + start +} + +service_triggers() { + procd_add_reload_trigger "$CONF" +} diff --git a/net/uugamebooster/update.sh b/net/uugamebooster/update.sh new file mode 100755 index 0000000000..1c060ca2e4 --- /dev/null +++ b/net/uugamebooster/update.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0-only +# +# Copyright (C) 2021 ImmortalWrt.org + +set -x + +export CURDIR="$(cd "$(dirname $0)"; pwd)" + +VERSION="$(curl -fsSL "https://router.uu.163.com/api/plugin?type=openwrt-aarch64" | jq -r ".url" | awk -F '/' '{print $6}' | tr -d 'v')" || exit 1 +PKG_VERSION="$(awk -F "PKG_VERSION:=" '{print $2}' "$CURDIR/Makefile" | xargs)" +[ "$PKG_VERSION" != "$VERSION" ] || exit 0 + +for ARCH in "aarch64" "arm" "mipsel" "x86_64"; do + FILE_INFO="$(curl -fsSL "https://router.uu.163.com/api/plugin?type=openwrt-$ARCH")" + FILE_MD5="$(echo "$FILE_INFO" | jq -r ".md5")" + FILE_VER="$(echo "$FILE_INFO" | jq -r ".url" | awk -F '/' '{print $6}' | tr -d 'v')" + if [ "$FILE_VER" != "$VERSION" ]; then + echo -e "Version mismatch. Expected version: $VERSION, got $FILE_VER." + exit 1 + else + curl -fsSL "https://uu.gdl.netease.com/uuplugin/openwrt-$ARCH/v$VERSION/uu.tar.gz" -o "$CURDIR/uu-$ARCH.tar.gz" + ACTUAL_MD5="$(md5sum "$CURDIR/uu-$ARCH.tar.gz" | awk '{print $1}')" + if [ "$ACTUAL_MD5" != "$FILE_MD5" ]; then + echo -e "HASH mismatch. Expected md5: $FILE_MD5, got $ACTUAL_MD5." + else + FILE_HASH="$(sha256sum "$CURDIR/uu-$ARCH.tar.gz" | awk '{print $1}')" + HASH_LINE="$(($(sed -n -e "/(\$(ARCH),$ARCH)/=" "$CURDIR/Makefile") + 1))" + sed -i "${HASH_LINE}s/PKG_HASH:=.*/PKG_HASH:=$FILE_HASH/" "$CURDIR/Makefile" + fi + rm -f "$CURDIR/uu-$ARCH.tar.gz" + fi +done + +sed -i "s,PKG_VERSION:=.*,PKG_VERSION:=$VERSION,g" "$CURDIR/Makefile" From 7b5a8f41faaf6416b6af4ac79a00dc3b5fe66a47 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 14 Nov 2024 11:03:50 +0800 Subject: [PATCH 25/88] jool: add hotplug script to disable fraglist GRO --- net/jool/Makefile | 15 ++++--- net/jool/files/jool-disable-fraglist-gro.sh | 6 +++ net/jool/files/readme.md | 43 +++++++++++-------- .../patches/001-libtool-reduce-version.patch | 2 +- ...0-fix-compilation-warning-simple-fix.patch | 22 ++++++++++ 5 files changed, 63 insertions(+), 25 deletions(-) create mode 100644 net/jool/files/jool-disable-fraglist-gro.sh create mode 100644 net/jool/patches/100-fix-compilation-warning-simple-fix.patch diff --git a/net/jool/Makefile b/net/jool/Makefile index ae06bed412..2cd6973496 100644 --- a/net/jool/Makefile +++ b/net/jool/Makefile @@ -8,16 +8,16 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=jool -PKG_VERSION:=4.1.8 -PKG_RELEASE:=$(AUTORELEASE) +PKG_VERSION:=4.1.13 +PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=COPYING PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/NICMx/Jool.git -PKG_SOURCE_VERSION:=6822bdee4ec63467e82d723a3381b3116c1853d9 -PKG_MIRROR_HASH:=6ef000459858a87e206c903828f428d469c18221789cb65fec91a8d822b0178f +PKG_SOURCE_VERSION:=39ca69f8717a83733548bea3b7bfad2a4799572a +PKG_MIRROR_HASH:=9846ec0766cf00f56628a2ae57bef066e7a723c9afa9f27ce1d2e2bfaa7c37ee PKG_BUILD_DIR=$(KERNEL_BUILD_DIR)/$(PKG_SOURCE_SUBDIR) PKG_BUILD_PARALLEL:=1 @@ -67,7 +67,7 @@ endef define Package/jool/Default SECTION:=net CATEGORY:=Network - URL:=https://www.jool.mx + URL:=https://nicmx.github.io/Jool/ endef define Package/jool/Default/description @@ -102,7 +102,7 @@ endef define Package/jool-tools-netfilter $(call Package/jool/Default) TITLE:=Jool userspace control programs - DEPENDS:=+libnl +kmod-jool-netfilter + DEPENDS:=+libnl +libnl-genl +kmod-jool-netfilter +ethtool endef define Package/jool-tools-netfilter/description @@ -135,6 +135,9 @@ define Package/jool-tools-netfilter/install $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/jool.init $(1)/etc/init.d/jool + $(INSTALL_DIR) $(1)/etc/hotplug.d/net + $(INSTALL_BIN) ./files/jool-disable-fraglist-gro.sh $(1)/etc/hotplug.d/net/90-jool-disable-fraglist-gro.sh + $(INSTALL_DIR) $(1)/etc/jool $(INSTALL_CONF) ./files/jool-nat64.conf.json $(1)/etc/jool/jool-nat64.conf.json $(INSTALL_CONF) ./files/jool-siit.conf.json $(1)/etc/jool/jool-siit.conf.json diff --git a/net/jool/files/jool-disable-fraglist-gro.sh b/net/jool/files/jool-disable-fraglist-gro.sh new file mode 100644 index 0000000000..2d43c2e4b2 --- /dev/null +++ b/net/jool/files/jool-disable-fraglist-gro.sh @@ -0,0 +1,6 @@ +if [ "$ACTION" = add ]; then + for dev in `ls /sys/class/net`; do + [ -d "/sys/class/net/$dev" ] || continue + ethtool -K $dev rx-gro-list off 2>/dev/null + done +fi diff --git a/net/jool/files/readme.md b/net/jool/files/readme.md index 88f978d9dc..0638d786e7 100644 --- a/net/jool/files/readme.md +++ b/net/jool/files/readme.md @@ -1,28 +1,35 @@ -# [Jool](https://www.jool.mx) +# [Jool](https://nicmx.github.io/Jool/en/index.html) ## Documentation -[See here](https://www.jool.mx/en/documentation.html). +[See here](https://nicmx.github.io/Jool/en/documentation.html). -You might also want to see [contact info](https://www.jool.mx/en/contact.html). +You might also want to see [contact info](https://nicmx.github.io/Jool/en/contact.html). ## Usage ### Start script This package includes a start script that will: - 1. Read the configuration file `/etc/config/jool` - 2. Determine what services are active - 3. Run jool with procd - -For now this means that: - * The services will be disabled by default in the uci config `(/etc/config/jool)` - * The only uci configuration support available for the package is to enable or disable each instance or the entire deamon - * There is no uci support and configuration will be saved at `/etc/jool/* - * Only one instance of jool(nat64) can run with the boot script - * Only one instance of jool(siit) can run with the boot script - * For now there is no way of overriding of the configuration file's paths - -The configuration files the startup script useses for each jool instance are: - * jool(nat64): `/etc/jool/jool-nat64.conf.json` - * jool(siit): `/etc/jool/jool-siit.conf.json` + + 1. Read the configuration file `/etc/config/jool` + 2. Determine what services are active + 3. Run `jool` with procd + +### For now this means that + +- The services will be disabled by default in the uci config `(/etc/config/jool)` +- The only uci configuration support available for the package is to enable or disable each instance or the entire deamon +- There is no uci support and configuration will be saved at `/etc/jool/` +- Only one instance of jool(nat64) can run with the boot script +- Only one instance of jool(siit) can run with the boot script +- For now there is no way of overriding of the configuration file's paths + +The configuration files the startup script uses for each jool instance are: + +- jool(nat64): `/etc/jool/jool-nat64.conf.json` +- jool(siit): `/etc/jool/jool-siit.conf.json` + +### OpenWrt tutorial + +For a more detailed tutorial refer to this [wiki page](https://openwrt.org/docs/guide-user/network/ipv6/nat64). diff --git a/net/jool/patches/001-libtool-reduce-version.patch b/net/jool/patches/001-libtool-reduce-version.patch index 94f3e75864..54ce8f64ca 100644 --- a/net/jool/patches/001-libtool-reduce-version.patch +++ b/net/jool/patches/001-libtool-reduce-version.patch @@ -11,7 +11,7 @@ Signed-off-by: Tiago Gaspar --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ AC_PREREQ([2.68]) - AC_INIT([Jool], [4.1.8], [jool@nic.mx]) + AC_INIT([Jool], [4.1.6], [jool@nic.mx]) AC_CONFIG_SRCDIR([src/common/xlat.h]) AM_INIT_AUTOMAKE([subdir-objects]) -LT_PREREQ([2.4.6]) diff --git a/net/jool/patches/100-fix-compilation-warning-simple-fix.patch b/net/jool/patches/100-fix-compilation-warning-simple-fix.patch new file mode 100644 index 0000000000..8dcd7d69bb --- /dev/null +++ b/net/jool/patches/100-fix-compilation-warning-simple-fix.patch @@ -0,0 +1,22 @@ +--- a/src/mod/common/xlator.c ++++ b/src/mod/common/xlator.c +@@ -891,7 +891,7 @@ void xlator_put(struct xlator *jool) + static bool offset_equals(struct instance_entry_usr *offset, + struct jool_instance *instance) + { +- return (offset->ns == ((PTR_AS_UINT_TYPE)instance->jool.ns & 0xFFFFFFFF)) ++ return (offset->ns == ((uintptr_t)instance->jool.ns & 0xFFFFFFFF)) + && (strcmp(offset->iname, instance->jool.iname) == 0); + } + +--- a/src/mod/common/nl/instance.c ++++ b/src/mod/common/nl/instance.c +@@ -38,7 +38,7 @@ static int serialize_instance(struct xla + if (!root) + return 1; + +- error = nla_put_u32(skb, JNLAIE_NS, ((PTR_AS_UINT_TYPE)entry->ns) & 0xFFFFFFFF); ++ error = nla_put_u32(skb, JNLAIE_NS, ((uintptr_t)entry->ns) & 0xFFFFFFFF); + if (error) + goto cancel; + error = nla_put_u8(skb, JNLAIE_XF, xlator_flags2xf(entry->flags)); From cf62b54812cc83a113a528ba7f69d287dff08086 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 14 Nov 2024 11:18:55 +0800 Subject: [PATCH 26/88] libpfring: bump version --- libs/libpfring/Makefile | 12 ++-- .../patches/0001-fix-cross-compiling.patch | 6 +- libs/libpfring/patches/010-gcc14.patch | 24 +++++++ .../patches/100-fix-compilation-warning.patch | 11 +++ ...l-pf_ring-better-define-sa_data-size.patch | 72 +++++++++++++++++++ .../patches/102-remove-sendpage.patch | 22 ++++++ 6 files changed, 138 insertions(+), 9 deletions(-) create mode 100644 libs/libpfring/patches/010-gcc14.patch create mode 100644 libs/libpfring/patches/100-fix-compilation-warning.patch create mode 100644 libs/libpfring/patches/101-kernel-pf_ring-better-define-sa_data-size.patch create mode 100644 libs/libpfring/patches/102-remove-sendpage.patch diff --git a/libs/libpfring/Makefile b/libs/libpfring/Makefile index 6123c87b33..984611d59f 100644 --- a/libs/libpfring/Makefile +++ b/libs/libpfring/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=libpfring -PKG_VERSION:=8.0.0 -PKG_RELEASE:=$(AUTORELEASE) +PKG_VERSION:=8.6.1 +PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://codeload.github.com/ntop/PF_RING/tar.gz/$(PKG_VERSION)? -PKG_HASH:=8e733899b736fe2536ef785b2b7d719abe652297fe7fe3a03fc495a87a9b6e82 -PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/PF_RING-$(PKG_VERSION) +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=$(PKG_VERSION) +PKG_SOURCE_URL:=https://github.com/ntop/PF_RING +PKG_MIRROR_HASH:=da580f899de9ca73d2ab6958e2919415f70a0b8f22841083edf41aeb2c8995c6 PKG_MAINTAINER:=Banglang Huang diff --git a/libs/libpfring/patches/0001-fix-cross-compiling.patch b/libs/libpfring/patches/0001-fix-cross-compiling.patch index 9b52fbe9f4..1b9d455408 100644 --- a/libs/libpfring/patches/0001-fix-cross-compiling.patch +++ b/libs/libpfring/patches/0001-fix-cross-compiling.patch @@ -1,6 +1,6 @@ --- a/userland/configure +++ b/userland/configure -@@ -3875,12 +3875,6 @@ $as_echo "no" >&6; } +@@ -3873,12 +3873,6 @@ $as_echo "no" >&6; } if test "$IS_FREEBSD" != "1" && test "$cross_compiling" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if r/w locks are supported" >&5 $as_echo_n "checking if r/w locks are supported... " >&6; } @@ -13,7 +13,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -@@ -3893,7 +3887,7 @@ else +@@ -3891,7 +3885,7 @@ else _ACEOF @@ -22,7 +22,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF -@@ -3907,7 +3901,6 @@ $as_echo "no" >&6; } +@@ -3905,7 +3899,6 @@ $as_echo "no" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext diff --git a/libs/libpfring/patches/010-gcc14.patch b/libs/libpfring/patches/010-gcc14.patch new file mode 100644 index 0000000000..c17dc85aa8 --- /dev/null +++ b/libs/libpfring/patches/010-gcc14.patch @@ -0,0 +1,24 @@ +--- a/kernel/pf_ring.c ++++ b/kernel/pf_ring.c +@@ -4713,8 +4713,8 @@ void reserve_memory(unsigned long base, + { + struct page *page, *page_end; + +- page_end = virt_to_page(base + mem_len - 1); +- for(page = virt_to_page(base); page <= page_end; page++) ++ page_end = virt_to_page((void*)base + mem_len - 1); ++ for(page = virt_to_page((void*)base); page <= page_end; page++) + SetPageReserved(page); + } + +@@ -4722,8 +4722,8 @@ void unreserve_memory(unsigned long base + { + struct page *page, *page_end; + +- page_end = virt_to_page(base + mem_len - 1); +- for(page = virt_to_page(base); page <= page_end; page++) ++ page_end = virt_to_page((void*)base + mem_len - 1); ++ for(page = virt_to_page((void*)base); page <= page_end; page++) + ClearPageReserved(page); + } + diff --git a/libs/libpfring/patches/100-fix-compilation-warning.patch b/libs/libpfring/patches/100-fix-compilation-warning.patch new file mode 100644 index 0000000000..85393a2efb --- /dev/null +++ b/libs/libpfring/patches/100-fix-compilation-warning.patch @@ -0,0 +1,11 @@ +--- a/kernel/pf_ring.c ++++ b/kernel/pf_ring.c +@@ -3903,7 +3903,7 @@ static int hash_pkt_cluster(ring_cluster + break; + } + /* else, fall through, because it's like 2-tuple for non-TCP packets */ +- ++ fallthrough; + case cluster_per_flow_2_tuple: + case cluster_per_inner_flow_2_tuple: + flags |= mask_2_tuple; diff --git a/libs/libpfring/patches/101-kernel-pf_ring-better-define-sa_data-size.patch b/libs/libpfring/patches/101-kernel-pf_ring-better-define-sa_data-size.patch new file mode 100644 index 0000000000..3045818fcf --- /dev/null +++ b/libs/libpfring/patches/101-kernel-pf_ring-better-define-sa_data-size.patch @@ -0,0 +1,72 @@ +From 1b7780e9ecb46c6a5bbc8a831778a683f8ae80d8 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Mon, 18 Mar 2024 10:03:43 +0100 +Subject: [PATCH] kernel: pf_ring: better define sa_data size + +pfring_mod_bind() needs to specify the interface +name using struct sockaddr that is defined as + +struct sockaddr { ushort sa_family; char sa_data[14]; }; + +so the total interface name length is 13 chars (plus \0 trailer). + +Since sa_data size is arbitrary, define a more precise size for +PF_RING socket use. + +This fix some compilation error with fortify string and makes the array +handling more deterministic. + +Signed-off-by: Christian Marangi +--- + kernel/pf_ring.c | 20 ++++++++++++++++---- + 1 file changed, 16 insertions(+), 4 deletions(-) + +--- a/kernel/pf_ring.c ++++ b/kernel/pf_ring.c +@@ -158,6 +158,18 @@ + #endif + #endif + ++/* ++ pfring_mod_bind() needs to specify the interface ++ name using struct sockaddr that is defined as ++ ++ struct sockaddr { ushort sa_family; char sa_data[14]; }; ++ ++ so the total interface name length is 13 chars (plus \0 trailer). ++ Since sa_data size is arbitrary, define a more precise size for ++ PF_RING socket use. ++*/ ++#define RING_SA_DATA_LEN 14 ++ + /* ************************************************* */ + + #if(LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) +@@ -1032,7 +1044,7 @@ pf_ring_device *pf_ring_device_name_look + so the total interface name length is 13 chars (plus \0 trailer). + The check below is to trap this case. + */ +- || ((l >= 13) && (strncmp(dev_ptr->device_name, name, 13) == 0))) ++ || ((l >= RING_SA_DATA_LEN - 1) && (strncmp(dev_ptr->device_name, name, RING_SA_DATA_LEN - 1) == 0))) + && device_net_eq(dev_ptr, net)) + return dev_ptr; + } +@@ -5605,15 +5617,15 @@ static int ring_bind(struct socket *sock + #ifndef RING_USE_SOCKADDR_LL + } else if (addr_len == sizeof(struct sockaddr)) { /* Deprecated */ + +- char name[sizeof(sa->sa_data)+1]; ++ char name[RING_SA_DATA_LEN]; + + if (sa->sa_family != PF_RING) + return(-EINVAL); + +- memcpy(name, sa->sa_data, sizeof(sa->sa_data)); ++ memcpy(name, sa->sa_data, RING_SA_DATA_LEN - 1); + + /* Add trailing zero if missing */ +- name[sizeof(name)-1] = '\0'; ++ name[RING_SA_DATA_LEN-1] = '\0'; + + debug_printk(2, "searching device %s\n", name); + diff --git a/libs/libpfring/patches/102-remove-sendpage.patch b/libs/libpfring/patches/102-remove-sendpage.patch new file mode 100644 index 0000000000..a5ca50900a --- /dev/null +++ b/libs/libpfring/patches/102-remove-sendpage.patch @@ -0,0 +1,22 @@ +From 5557b6ffe8d4eeb93532d043649b40eb10120bf7 Mon Sep 17 00:00:00 2001 +From: Gavin +Date: Wed, 25 Oct 2023 11:40:50 +0100 +Subject: [PATCH] Update pf_ring.c + +Change to remove .sendpage assignment, as that attribute seems to have gone away in 6.5.3 kernel. +--- + kernel/pf_ring.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/kernel/pf_ring.c ++++ b/kernel/pf_ring.c +@@ -8470,7 +8470,9 @@ static struct proto_ops ring_ops = { + .getname = sock_no_getname, + .listen = sock_no_listen, + .shutdown = sock_no_shutdown, ++ #if(LINUX_VERSION_CODE < KERNEL_VERSION(6,5,3)) + .sendpage = sock_no_sendpage, ++ #endif + + /* Now the operations that really occur. */ + .release = ring_release, From d58e68ace0f5e2bdbfc375bb0889e6599a74b349 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 15 Nov 2024 20:05:37 +0800 Subject: [PATCH 27/88] ddns-scripts: fix cloudflare.com-v4 for lua luci --- net/ddns-scripts/Makefile | 40 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/net/ddns-scripts/Makefile b/net/ddns-scripts/Makefile index 7ccc9ee933..d68cfd96f2 100644 --- a/net/ddns-scripts/Makefile +++ b/net/ddns-scripts/Makefile @@ -374,7 +374,6 @@ fi exit 0 endef - define Package/ddns-scripts-services/install $(INSTALL_DIR) $(1)/usr/share/ddns/default $(INSTALL_DATA) ./files/usr/share/ddns/default/* \ @@ -429,6 +428,24 @@ fi exit 0 endef +define Package/ddns-scripts-cloudflare/postinst + #!/bin/sh + # remove old services file entries + /bin/sed -i '/cloudflare\.com-v4/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 + /bin/sed -i '/cloudflare\.com-v4/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1 + # and create new + printf "%s\\t%s\\n" '"cloudflare.com-v4"' '"update_cloudflare_com_v4.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services + printf "%s\\t%s\\n" '"cloudflare.com-v4"' '"update_cloudflare_com_v4.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6 + # on real system restart service if enabled + [ -z "$${IPKG_INSTROOT}" ] && { + [ -x /etc/uci-defaults/ddns_cloudflare.com-v4 ] && \ + /etc/uci-defaults/ddns_cloudflare.com-v4 && \ + rm -f /etc/uci-defaults/ddns_cloudflare.com-v4 >/dev/null 2>&1 + /etc/init.d/ddns enabled && \ + /etc/init.d/ddns start >/dev/null 2>&1 + } + exit 0 # suppress errors +endef define Package/ddns-scripts-cloudflare/install $(INSTALL_DIR) $(1)/usr/lib/ddns @@ -445,6 +462,9 @@ define Package/ddns-scripts-cloudflare/prerm if [ -z "$${IPKG_INSTROOT}" ]; then /etc/init.d/ddns stop fi + # remove services file entries + /bin/sed -i '/cloudflare\.com-v4/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 + /bin/sed -i '/cloudflare\.com-v4/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1 exit 0 endef @@ -543,6 +563,22 @@ fi exit 0 endef +define Package/ddns-scripts_no-ip_com/postinst + #!/bin/sh + # remove old services file entries + /bin/sed -i '/no-ip\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 + # and create new + printf "%s\\t%s\\n" '"no-ip.com"' '"update_no-ip_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services + # on real system restart service if enabled + [ -z "$${IPKG_INSTROOT}" ] && { + [ -x /etc/uci-defaults/ddns_no-ip_com ] && \ + /etc/uci-defaults/ddns_no-ip_com && \ + rm -f /etc/uci-defaults/ddns_no-ip_com >/dev/null 2>&1 + /etc/init.d/ddns enabled && \ + /etc/init.d/ddns start >/dev/null 2>&1 + } + exit 0 # suppress errors +endef define Package/ddns-scripts-noip/install $(INSTALL_DIR) $(1)/usr/lib/ddns @@ -559,6 +595,8 @@ define Package/ddns-scripts-noip/prerm if [ -z "$${IPKG_INSTROOT}" ]; then /etc/init.d/ddns stop fi + # remove services file entries + /bin/sed -i '/no-ip\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 exit 0 endef From 3c01d86556d62697f762e4d5d4b9f7f1dd2e60e0 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 15 Nov 2024 22:31:43 +0800 Subject: [PATCH 28/88] swanmon: add package --- utils/swanmon/Makefile | 44 ++++++++++++++++++++++++++++++++++++++++++ utils/swanmon/test.sh | 3 +++ 2 files changed, 47 insertions(+) create mode 100644 utils/swanmon/Makefile create mode 100644 utils/swanmon/test.sh diff --git a/utils/swanmon/Makefile b/utils/swanmon/Makefile new file mode 100644 index 0000000000..6dd9675734 --- /dev/null +++ b/utils/swanmon/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2023 TDT AG +# +# This is free software, licensed under the GNU General Public License v2. +# See https://www.gnu.org/licenses/gpl-2.0.txt for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=swanmon +PKG_VERSION:=0.1 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/TDT-AG/swanmon +PKG_SOURCE_VERSION:=296096e172005cae855c316f859265aba8b2e472 +PKG_MIRROR_HASH:=f69f27e976f35ad15bd95e8f06b950b48bca957f0fe3e00c2cf8c381cbf05bc3 + +PKG_MAINTAINER:=Lukas Voegl +PKG_LICENSE:=LGPL-2.1-or-later +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/swanmon + SECTION:=utils + CATEGORY:=Utilities + TITLE:=strongSwan monitoring tool + DEPENDS:=+davici +glib2 +libjson-c +endef + +define Package/swanmon/description + A command-line utility for serializing the strongSwan VICI output to JSON. +endef + +define Package/swanmon/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/swanmon $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,swanmon)) diff --git a/utils/swanmon/test.sh b/utils/swanmon/test.sh new file mode 100644 index 0000000000..e2f737ffc6 --- /dev/null +++ b/utils/swanmon/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +swanmon help From 5d263760aeb50d113289179dd17ace9260db0bc5 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 15 Nov 2024 22:33:01 +0800 Subject: [PATCH 29/88] davici: add package --- libs/davici/Makefile | 54 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 libs/davici/Makefile diff --git a/libs/davici/Makefile b/libs/davici/Makefile new file mode 100644 index 0000000000..f4a5a044a1 --- /dev/null +++ b/libs/davici/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2023 TDT AG +# +# This is free software, licensed under the GNU General Public License v2. +# See https://www.gnu.org/licenses/gpl-2.0.txt for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=davici +PKG_VERSION:=1.4 +PKG_RELEASE=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/strongswan/davici/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=b03c5a1aad905e962271d70246d6af6c337ffd00449d990082ea02161327bde8 + +PKG_MAINTAINER:=Lukas Voegl +PKG_LICENSE:=LGPL-2.1-or-later +PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:strongswan:davici + +PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/davici + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Decoupled Asynchronous VICI + URL:=https://github.com/strongswan/davici +endef + +define Package/davici/description + The davici library provides a client implementation of the + strongSwan VICI protocol for integration into external applications. +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdavici.so* $(1)/usr/lib/ +endef + +define Package/davici/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdavici.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,davici)) From 3c2b3bd8940d6255a23cadd635ca96e94afec070 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 15 Nov 2024 22:53:02 +0800 Subject: [PATCH 30/88] forked-daapd: add package --- net/mwol/Makefile | 60 +++ net/mwol/files/mwol.config | 11 + net/mwol/files/mwol.init | 56 +++ net/mwol/files/mwol_config_json | 56 +++ net/mwol/files/ssl/ca.crt | 16 + net/mwol/files/ssl/client.crt | 16 + net/mwol/files/ssl/client.key | 27 ++ net/njitclient/Makefile | 40 ++ net/scutclient/Makefile | 59 +++ sound/forked-daapd/Makefile | 81 ++++ sound/forked-daapd/files/forked-daapd.conf | 414 +++++++++++++++++++++ sound/forked-daapd/files/forked-daapd.init | 15 + 12 files changed, 851 insertions(+) create mode 100644 net/mwol/Makefile create mode 100644 net/mwol/files/mwol.config create mode 100755 net/mwol/files/mwol.init create mode 100644 net/mwol/files/mwol_config_json create mode 100644 net/mwol/files/ssl/ca.crt create mode 100644 net/mwol/files/ssl/client.crt create mode 100644 net/mwol/files/ssl/client.key create mode 100644 net/njitclient/Makefile create mode 100644 net/scutclient/Makefile create mode 100644 sound/forked-daapd/Makefile create mode 100644 sound/forked-daapd/files/forked-daapd.conf create mode 100644 sound/forked-daapd/files/forked-daapd.init diff --git a/net/mwol/Makefile b/net/mwol/Makefile new file mode 100644 index 0000000000..c641246000 --- /dev/null +++ b/net/mwol/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2019 mleaf.org +# 微信公众号【WiFi物联网】 +# +# Copyright (C) 2021 ImmortalWrt +# +# +# This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mwol +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/Mleaf/mwol.git +PKG_SOURCE_DATE:=2021-08-20 +PKG_SOURCE_VERSION:=5291e45b3baedd8bd38358bcd275ce35296df82e +PKG_MIRROR_HASH:=5dde8ddc828c02b642e37e4e9726ab6f50e39c982da9b9d0a8e2595387504f1b + +PKG_LICENSE:=GPL-3.0 +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=mleaf + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/mwol + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libmosquitto-ssl +libopenssl +libpthread +luci-lib-json + TITLE:=MQTT Wake On Lan + URL:=http://www.mleaf.org +endef + +define Package/mwol/description + Mwol is a project that uses mqtt to implement reverse proxy and + wake up the computer. +endef + +define Package/mwol/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mwol $(1)/usr/sbin/mwol + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) files/mwol.config $(1)/etc/config/mwol + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) files/mwol.init $(1)/etc/init.d/mwol + + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) files/mwol_config_json $(1)/usr/sbin/mwol_config_json + $(INSTALL_DIR) $(1)/usr/share/mwol/ssl + $(CP) files/ssl/* $(1)/usr/share/mwol/ssl/ +endef + +$(eval $(call BuildPackage,mwol)) diff --git a/net/mwol/files/mwol.config b/net/mwol/files/mwol.config new file mode 100644 index 0000000000..919c1935cc --- /dev/null +++ b/net/mwol/files/mwol.config @@ -0,0 +1,11 @@ + +config mwol 'mwol_conf' + option enable '0' + option hostname 'www.mleaf.org' + option port '1999' + option sslenable '1' + option cafile '/usr/share/mwol/ssl/ca.crt' + option crtfile '/usr/share/mwol/ssl/client.crt' + option keyfile '/usr/share/mwol/ssl/client.key' + option encryptionenable '0' + diff --git a/net/mwol/files/mwol.init b/net/mwol/files/mwol.init new file mode 100755 index 0000000000..f8048d1c50 --- /dev/null +++ b/net/mwol/files/mwol.init @@ -0,0 +1,56 @@ +#!/bin/sh /etc/rc.common +# Copyright (c) 2019 www.mleaf.org. All rights reserved. +# 微信公众号【WiFi物联网】 + +START=99 +STOP=10 + +USE_PROCD=1 + +PROG=/usr/sbin/mwol + +generate_mwol_conf() +{ + logger "Generate /tmp/mwol.json" + lua /usr/sbin/mwol_config_json > /tmp/mwol.json +} + +start_service_real() { + local cfg="$1" + local enable + local id + config_get enable "$cfg" enable + config_get id "$cfg" id + if [ -z "$id" ]; then + mac=`cat /sys/class/net/eth0/address` + logger "mqtt id is not set to use eth0 by default: $mac" + uci set mwol.mwol_conf.id=$mac + uci commit mwol + fi + + if [ "$enable" -eq 1 ]; then + generate_mwol_conf + + procd_open_instance + + procd_set_param command $PROG -c /tmp/mwol.json + + procd_set_param respawn + + procd_set_param stdout 1 + procd_set_param stderr 1 + + procd_close_instance + fi +} + +service_triggers() { + procd_add_reload_trigger "mwol" +} + +start_service() +{ + config_load mwol + + config_foreach start_service_real mwol +} diff --git a/net/mwol/files/mwol_config_json b/net/mwol/files/mwol_config_json new file mode 100644 index 0000000000..2ea55aa5df --- /dev/null +++ b/net/mwol/files/mwol_config_json @@ -0,0 +1,56 @@ +#!/usr/bin/env lua +--Copyright (c) 2019 www.mleaf.org. All rights reserved. +--微信公众号【WiFi物联网】 + +ubus = require('ubus') + +local json = require "luci.json" + +local conn = ubus.connect() +if not conn then + error("Failed to connect to ubus") +end + +local mwol_ubus = conn:call("uci", "get", {config = "mwol"}) + +local mwol_table = mwol_ubus["values"] + +local mwol_conf = {} +local mwo_enable + +function get_mwol_conf(mTable) + + for key, val in pairs(mTable) do + if string.match(key, '%.[%a]*', 1) == nil then + if key == "enable" then + mwo_enable = val + elseif key == "sslenable" then + if val == "1" then + mwol_conf["ssl"] = true + else + mwol_conf["ssl"] = false + end + elseif key=="encryptionenable" then + if val == "1" then + mwol_conf["encryption"] = true + else + mwol_conf["encryption"] = false + end + elseif key == "port" then + mwol_conf[key] = tonumber(val) + else + mwol_conf[key] = val + end + end + end +end + +for key, val in pairs(mwol_table) do + + if key == "mwol_conf" then + get_mwol_conf(val) + end +end + +jsonStr = json.encode(mwol_conf) +print(jsonStr) diff --git a/net/mwol/files/ssl/ca.crt b/net/mwol/files/ssl/ca.crt new file mode 100644 index 0000000000..0100bef370 --- /dev/null +++ b/net/mwol/files/ssl/ca.crt @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICljCCAX4CCQCKs4OCFSYhzjANBgkqhkiG9w0BAQsFADANMQswCQYDVQQDDAJj +YTAeFw0yMDAxMDcwNDEwMTJaFw0zMDAxMDQwNDEwMTJaMA0xCzAJBgNVBAMMAmNh +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3LwOkCJ1MDajCRK4jTgf +0cnapRPOs6xZFru0NgHMY7R6hlmBk8asHJIM+B9c3hGqEYERkRTR586lUWiE1n/i +VTTa5kblEb48p9dDaeUHtGB5FYvJQDgpdyy+dbqgFs/LbZ4mngz0rBeY4ukxu3lX +Zcs2DOGYnZd2uun7TSd5k6276tjzljcVfPigBN0U1YMyhPv+vo66bYBH+QFBXgd+ +8+Be5nCEY2IQjaeTbpobcnz1x9iyfrqDc1Xk+d+dnHoajdgIdWKgR6rTcKlMNwh+ +SVz1zU1GmzUtD+dfpB2mc8f1G3J1bXA2n8Jt568KH6Gx8KvX6NXpvK+vHcmFTaDv +CQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAwJ8xvUtSEhYuFOGCZ1fWz1Q8lLtC6 +tNARV4C+JmT63mBkwP2tHC5GjbgCQTtYA8bgiEAsZkYL7wDw4R6104xHVmpYSaoN +lZxSps2t7WfpwABzaHZaeIzlZ+7lkamLb5It9yAvJTEN2L3opdRFleumz+3mpouM +VjBN6g3xX1SUmPoWn8QW7NvK9KwZHdr6uALoZ8vGAaXg7OTZooHL4xlCyESLqnbA +p7Nr1iiqhbRRcVeplljFGoAEMBlrx1x3rwtJl2gCBQmN802P+Vh4TdoWTBbFhdNR +R3PeUvxu3rZYnFrcfmdiABnAzqAybxr8/GO/UHqooSD2PLwC/CiI4FjT +-----END CERTIFICATE----- diff --git a/net/mwol/files/ssl/client.crt b/net/mwol/files/ssl/client.crt new file mode 100644 index 0000000000..a5f45c2a96 --- /dev/null +++ b/net/mwol/files/ssl/client.crt @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICmjCCAYICCQDPwW2AAN66QDANBgkqhkiG9w0BAQsFADANMQswCQYDVQQDDAJj +YTAeFw0yMDAxMDcwNDEwMTJaFw0zMDAxMDQwNDEwMTJaMBExDzANBgNVBAMMBmNs +aWVudDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPHfX5Eb6fEz/DSL +JwTC+ZoToYIi4Nw4n+MyTGzMrNRXGKCX52/h9DrWUNNpACZ2O3SVSdgTknv2g0oZ +wjr0xEhMILYwAauzA9N6IcLZcZ2RMvRXyY0KRvVluBEgrZty0oEHgFE2BSMENF6P +BWRmWJs8s91Ckt8JkHfkXR7ul8Wba9ETQldZ1Z9lHgawbxuQARq6IduqtrqHwId0 +LLYGF7bsYf/IL5ZtQs66+ldJUiUcRAwaR12X6kwn1dATpcgJlxiq4LCYP3wde3Ja +wqbW57S7FBoVInjboieGAGBV9Cd3jW19hLQCzAO5Y81N6GSBX5uxu4RkbgMEmWOw +/T7Wq30CAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAz5let8l3UXdhVSim+ZT5Q+l9 +jTJxheSct5MnZ+68qkF7Aax0DY6eB2RTymv/uQ9TBOKPGnOQAW/c328t39XP2PRY +tqN30iyYsmxZ/AXVDykEnV4GlssgJKWPrC+oca80+FT8O+k0QjiAFbVdpRfkr/rh +IMBRt/E0vuaqEPfgS7b9SrE8cH+InZMvoeV1PKDBnMCnROO6jHo27iV1yJxJd0Eu +JmOBHnIcFh3SD8kh4boPO4IiHY6FS3rDgaVveITc6faZSDvyjkv5Yqvl+n79V3M9 +zISgdkNYkEG50dJiVPoVNq0SLt4kWTpRKs3WgZEN4wZVQCu9Ijtf+4hmqeWmTg== +-----END CERTIFICATE----- diff --git a/net/mwol/files/ssl/client.key b/net/mwol/files/ssl/client.key new file mode 100644 index 0000000000..41451e4c40 --- /dev/null +++ b/net/mwol/files/ssl/client.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA8d9fkRvp8TP8NIsnBML5mhOhgiLg3Dif4zJMbMys1FcYoJfn +b+H0OtZQ02kAJnY7dJVJ2BOSe/aDShnCOvTESEwgtjABq7MD03ohwtlxnZEy9FfJ +jQpG9WW4ESCtm3LSgQeAUTYFIwQ0Xo8FZGZYmzyz3UKS3wmQd+RdHu6XxZtr0RNC +V1nVn2UeBrBvG5ABGroh26q2uofAh3QstgYXtuxh/8gvlm1Czrr6V0lSJRxEDBpH +XZfqTCfV0BOlyAmXGKrgsJg/fB17clrCptbntLsUGhUieNuiJ4YAYFX0J3eNbX2E +tALMA7ljzU3oZIFfm7G7hGRuAwSZY7D9PtarfQIDAQABAoIBACkFdGTc8hlZcr3K +l+yD0OdjyvGSTsaqx9s1jaaqM+mzd9bMzJC6JrzP2ldwqHjddon4Q9TkxORHU87+ +fWWYW63TU3zyuWXQb6avQQiV7mIF3Tl5phJImu5FuSkWfLsvhyohBo8/dTGSJfuf +kA+OGBsD+ZFeGCDBs4HR9kUnvA/kTsXFL2XsrjNvPP4d1z90H2GtVujhhH4mfEO1 +E8BL1crNMmZFek+ETk7GfZ/GE4oLtno1jaBczbpEa9wekjtq6ffoAGaAd5/6ZjIw +tpC6bNSDGqL0fTd/6ss5WZc8hYLTdkcZxh08kpVP5WoWm5WSxh8osQ494w6upEuo +p9qpRrUCgYEA+eRBhfAC0Cal5qTZTX4nbKdO7gkmxefcNfMF6eNJZ/oxOANEnl/Q +sSyZvtzoxNPaPuYu4LrniaKqFKD6DqA2ZIKRf4o8ydfQeDMvz8Ly4rpzuIDi45kc +sZ2S3aRh8IpDM4KOFachmBcjpyf2CPhJxeYLlHCMfASN5T2cGdpBKMcCgYEA98jv +viDoDPRTglfNYWIvU4dHWel9zjySSey6L9Awpna22jdLVTcaplZQNVKJ7uajIj1A +DA2GNDtZXHnUJBx9avMaURXBGLh/0S9NBMaeCRoQeCI1249/3xPQzKCWscvv2hPW +vRUQMS+erfmSDxg8B5LOVqPXLagZ0QA33KkILZsCgYBEh+GkTrcmyIKU5z6k7uT2 ++kc+JopYmgadUQGdK/T0q/uVhefqmxJLlJSxcDnxyLvApjXS8c8Pwulr8N3C5xMj +q18loA6duC721+rTyn37yfB0d/xBOLtSxokBedRWOETHupUmwQgIgsgHToE94oGw +4S7pzZfpZwJXDPdja6SU/wKBgQDLHUG5HwxZIicaX5MR0wRseiX5BDeGSYy5YH43 +F3fp3MKDGnR8RBFqbLKPIzvCQ/lR5deMicGLK2NTNOK7P0dn1iOqeCSzePn9pcKC +ubVuTJlXgOOZOYZefMXaF4Gv+TaCE2Uh1hRR3XE7t6sNCJactrDBwMhwuq1+76jb +DwyPJQKBgQCGX/+wwPnAvmtaKu9EUegp2hbmPXqLCexGAME/npUn071CYRoXb1OM ++13f7zWxC+5AIbcbX1LC+GrafeJGT/9VPqivvntwU2PtxfdPJ+wGkLcV+10gxV2l +5+w86aMDefzlqvMCX6pp9SY8jtzYBYGhm5OFVQ4eRAkceHlpXtEf/w== +-----END RSA PRIVATE KEY----- diff --git a/net/njitclient/Makefile b/net/njitclient/Makefile new file mode 100644 index 0000000000..087bac0f0e --- /dev/null +++ b/net/njitclient/Makefile @@ -0,0 +1,40 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=njit8021xclient +PKG_BASE_VERSION:=2.0 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/bitdust/njit8021xclient.git +PKG_SOURCE_DATE:=2018-11-24 +PKG_SOURCE_VERSION:=dd28c17f24275bbbf4c44504b832c0f1e6b9ae40 +PKG_MIRROR_HASH:=66e4f20ceeceaed457657b60ec0b390aab0d7ff380b0abe749738b8f4aa23556 + +PKG_VERSION:=$(PKG_BASE_VERSION)-$(PKG_SOURCE_DATE)-$(call version_abbrev,$(PKG_SOURCE_VERSION)) + +PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/njit8021xclient + SECTION:=net + CATEGORY:=Network + SUBMENU:=Campus Network + TITLE:=NJIT 802.1X client program + DEPENDS:=+libopenssl +libpcap +endef + +define Package/njit8021xclient/description + 802.1X client from Nanjing Institude of Technology, compatable with + H3C iNode 802.1X client. Support H3C/iNode's private authentication + protocol V7.10. +endef + +define Package/njit8021xclient/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/njit-client $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,njit8021xclient)) diff --git a/net/scutclient/Makefile b/net/scutclient/Makefile new file mode 100644 index 0000000000..c9278245b7 --- /dev/null +++ b/net/scutclient/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2016-2018 SCUT Router Term +# +# This is free software, licensed under the GNU Affero General Public License v3. +# See /COPYING for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=scutclient +PKG_BASE_VERSION:=3.1.3 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/scutclient/scutclient.git +PKG_SOURCE_DATE:=2021-11-26 +PKG_SOURCE_VERSION:=b265ca8ffea204bd1788b0addd42184496b8a118 +PKG_MIRROR_HASH:=798b31809f59f614e76c629bce2ab2c22b5589dca820c4302bc2974e5ab777bd + +PKG_VERSION:=$(PKG_BASE_VERSION)-$(PKG_SOURCE_DATE)-$(call version_abbrev,$(PKG_SOURCE_VERSION)) + +PKG_MAINTAINER:=Scutclient Project +PKG_LICENSE:=AGPL-3.0 +PKG_LICENSE_FILES:=COPYING + +PKG_BUILD_PARALLEL:=1 +CMAKE_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/scutclient + SECTION:=net + CATEGORY:=Network + SUBMENU:=Campus Network + TITLE:=SCUT Dr.com client + URL:=https://github.com/scutclient/scutclient +endef + +define Package/scutclient/description + Support SCUT private authentication protocol. +endef + +define Package/scutclient/conffiles +/etc/config/scutclient +endef + +define Package/scutclient/install + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) $(PKG_BUILD_DIR)/openwrt/files/scutclient.config $(1)/etc/config/scutclient + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/openwrt/files/scutclient.init $(1)/etc/init.d/scutclient + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_BIN) $(PKG_BUILD_DIR)/openwrt/files/scutclient.hotplug $(1)/etc/hotplug.d/iface/99-scutclient + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/scutclient $(1)/usr/bin +endef + +$(eval $(call BuildPackage,scutclient)) diff --git a/sound/forked-daapd/Makefile b/sound/forked-daapd/Makefile new file mode 100644 index 0000000000..cfefd61aa1 --- /dev/null +++ b/sound/forked-daapd/Makefile @@ -0,0 +1,81 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=forked-daapd +PKG_VERSION:=27.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://github.com/ejurgensen/$(PKG_NAME)/releases/download/$(PKG_VERSION)/ +PKG_HASH:=27294a893253d232161f4521fc42147e65324ce5a13fcf550b537100375277bb + +PKG_FIXUP:=autoreconf +PKG_USE_MIPS16:=0 +PKG_INSTALL:=1 + +PKG_MAINTAINER:=Espen Jürgensen +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/forked-daapd +SECTION:=sound +CATEGORY:=Sound +TITLE:=iTunes (DAAP) server for Apple Remote and AirPlay +URL:=https://github.com/ejurgensen/forked-daapd +DEPENDS:=+libgpg-error +libgcrypt +libgdbm +zlib +libexpat +libunistring \ + +libevent2 +libdaemon +libantlr3c +confuse +libopus +alsa-lib +libffmpeg-full \ + +mxml +libavahi-client +sqlite3-cli +libplist +libcurl +libjson-c \ + +libprotobuf-c +libgnutls +libsodium +libwebsockets-full $(ICONV_DEPENDS) +endef + +define Package/forked-daapd/description + forked-daapd is a Linux/FreeBSD DAAP (iTunes), MPD (Music Player Daemon) and + RSP (Roku) media server. It has support for AirPlay speakers, Chromecast, + Apple Remote (and compatibles), MPD clients, internet radio and LastFM. It + does not support AirPlay/Chromecast video. +endef + +define Package/forked-daapd/conffiles +/etc/forked-daapd.conf +endef + +CONFIGURE_ARGS += \ + --enable-itunes \ + --enable-lastfm \ + --enable-mpd \ + --enable-chromecast \ + --enable-verification \ + --enable-webinterface \ + --disable-spotify \ + --with-libplist \ + --with-libwebsockets-full \ + --with-alsa \ + --without-pulseaudio \ + --without-libevent_pthreads + +TARGET_CFLAGS += $(FPIC) +TARGET_LDFLAGS += -Wl,-rpath-link,$(STAGING_DIR)/usr/lib + +define Package/forked-daapd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/forked-daapd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) ./files/forked-daapd.conf $(1)/etc/forked-daapd.conf + $(INSTALL_DIR) $(1)/usr/lib/forked-daapd + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/forked-daapd/* $(1)/usr/lib/forked-daapd/ + $(INSTALL_DIR) $(1)/usr/share/forked-daapd/htdocs + $(CP) $(PKG_BUILD_DIR)/htdocs/* $(1)/usr/share/forked-daapd/htdocs/ + #$(INSTALL_DIR) $(1)/etc/init.d + #$(INSTALL_BIN) ./files/forked-daapd.init $(1)/etc/init.d/forked-daapd +endef + +$(eval $(call BuildPackage,forked-daapd)) diff --git a/sound/forked-daapd/files/forked-daapd.conf b/sound/forked-daapd/files/forked-daapd.conf new file mode 100644 index 0000000000..d7c2a80ca6 --- /dev/null +++ b/sound/forked-daapd/files/forked-daapd.conf @@ -0,0 +1,414 @@ +# A quick guide to configuring forked-daapd: +# +# For regular use, the most important setting to configure is "directories", +# which should be the location of your media. Whatever user you have set as +# "uid" must have read access to this location. If the location is a network +# mount, please see the README. +# +# In all likelihood, that's all you need to do! + +general { + # Username + # Make sure the user has read access to the library directories you set + # below, and full access to the databases, log and local audio + uid = "root" + + # Database location + db_path = "/opt/forked-daapd/songs3.db" + + # Log file and level + # Available levels: fatal, log, warning, info, debug, spam + logfile = "/var/log/forked-daapd.log" + loglevel = log + + # Admin password for the web interface + # Note that access to the web interface from computers in + # "trusted_network" (see below) does not require password +# admin_password = "" + + # Websocket port for the web interface. +# websocket_port = 3688 + + # Sets who is allowed to connect without authorisation. This applies to + # client types like Remotes, DAAP clients (iTunes) and to the web + # interface. Options are "any", "localhost" or the prefix to one or + # more ipv4/6 networks. The default is { "localhost", "192.168", "fd" } +# trusted_networks = { "localhost", "192.168", "fd" } + + # Enable/disable IPv6 + ipv6 = no + + # Location of cache database + cache_path = "/var/forked-daapd-cache.db" + + # DAAP requests that take longer than this threshold (in msec) get their + # replies cached for next time. Set to 0 to disable caching. +# cache_daap_threshold = 1000 + + # When starting playback, autoselect speaker (if none of the previously + # selected speakers/outputs are available) +# speaker_autoselect = no + + # Most modern systems have a high-resolution clock, but if you are on an + # unusual platform and experience audio drop-outs, you can try changing + # this option +# high_resolution_clock = yes +} + +# Library configuration +library { + # Name of the library as displayed by the clients (%h: hostname). If you + # change the name after pairing with Remote you may have to re-pair. + name = "My Music on %h" + + # TCP port to listen on. Default port is 3689 (daap) + port = 3689 + + # Password for the library. Optional. +# password = "" + + # Directories to index + directories = { "/opt/music" } + + # Follow symlinks. Default: true. +# follow_symlinks = true + + # Directories containing podcasts + # For each directory that is indexed the path is matched against these + # names. If there is a match all items in the directory are marked as + # podcasts. Eg. if you index /srv/music, and your podcasts are in + # /srv/music/Podcasts, you can set this to "/Podcasts". + # (changing this setting only takes effect after rescan, see the README) + podcasts = { "/Podcasts" } + + # Directories containing audiobooks + # For each directory that is indexed the path is matched against these + # names. If there is a match all items in the directory are marked as + # audiobooks. + # (changing this setting only takes effect after rescan, see the README) + audiobooks = { "/Audiobooks" } + + # Directories containing compilations (eg soundtracks) + # For each directory that is indexed the path is matched against these + # names. If there is a match all items in the directory are marked as + # compilations. + # (changing this setting only takes effect after rescan, see the README) + compilations = { "/Compilations" } + + # Compilations usually have many artists, and sometimes no album artist. + # If you don't want every artist to be listed in artist views, you can + # set a single name which will be used for all compilation tracks + # without an album artist, and for all tracks in the compilation + # directories. + # (changing this setting only takes effect after rescan, see the README) + compilation_artist = "Various Artists" + + # If your album and artist lists are cluttered, you can choose to hide + # albums and artists with only one track. The tracks will still be + # visible in other lists, e.g. songs and playlists. This setting + # currently only works in some remotes. +# hide_singles = false + + # Internet streams in your playlists will by default be shown in the + # "Radio" library, like iTunes does. However, some clients (like + # TunesRemote+) won't show the "Radio" library. If you would also like + # to have them shown like normal playlists, you can enable this option. +# radio_playlists = false + + # These are the default playlists. If you want them to have other names, + # you can set it here. +# name_library = "Library" +# name_music = "Music" +# name_movies = "Movies" +# name_tvshows = "TV Shows" +# name_podcasts = "Podcasts" +# name_audiobooks = "Audiobooks" +# name_radio = "Radio" + + # Artwork file names (without file type extension) + # forked-daapd will look for jpg and png files with these base names +# artwork_basenames = { "artwork", "cover", "Folder" } + + # Enable searching for artwork corresponding to each individual media + # file instead of only looking for album artwork. This is disabled by + # default to reduce cache size. +# artwork_individual = false + + # File types the scanner should ignore + # Non-audio files will never be added to the database, but here you + # can prevent the scanner from even probing them. This might improve + # scan time. By default .db, .ini, .db-journal, .pdf and .metadata are + # ignored. +# filetypes_ignore = { ".db", ".ini", ".db-journal", ".pdf", ".metadata" } + + # File paths the scanner should ignore + # If you want to exclude files on a more advanced basis you can enter + # one or more POSIX regular expressions, and any file with a matching + # path will be ignored. +# filepath_ignore = { "myregex" } + + # Disable startup file scanning + # When forked-daapd starts it will do an initial file scan of your + # library (and then watch it for changes). If you are sure your library + # never changes while forked-daapd is not running, you can disable the + # initial file scan and save some system ressources. Disabling this scan + # may lead to forked-daapd's database coming out of sync with the + # library. If that happens read the instructions in the README on how + # to trigger a rescan. +# filescan_disable = false + + # Should metadata from m3u playlists, e.g. artist and title in EXTINF, + # override the metadata we get from radio streams? +# m3u_overrides = false + + # Should iTunes metadata override ours? +# itunes_overrides = false + + # Should we import the content of iTunes smart playlists? +# itunes_smartpl = false + + # Decoding options for DAAP clients + # Since iTunes has native support for mpeg, mp4a, mp4v, alac and wav, + # such files will be sent as they are. Any other formats will be decoded + # to raw wav. If forked-daapd detects a non-iTunes DAAP client, it is + # assumed to only support mpeg and wav, other formats will be decoded. + # Here you can change when to decode. Note that these settings have no + # effect on AirPlay. + # Formats: mp4a, mp4v, mpeg, alac, flac, mpc, ogg, wma, wmal, wmav, aif, wav + # Formats that should never be decoded +# no_decode = { "format", "format" } + # Formats that should always be decoded +# force_decode = { "format", "format" } + + # Watch named pipes in the library for data and autostart playback when + # there is data to be read. To exclude specific pipes from watching, + # consider using the above _ignore options. +# pipe_autostart = true + + # Enable automatic rating updates + # If enabled, rating is automatically updated after a song has either been + # played or skipped (only skipping to the next song is taken into account). + # The calculation is taken from the beets plugin "mpdstats" (see + # https://beets.readthedocs.io/en/latest/plugins/mpdstats.html). + # It consist of calculating a stable rating based only on the play- and + # skipcount and a rolling rating based on the current rating and the action + # (played or skipped). Both results are combined with a mix-factor of 0.75: + # new rating = 0.75 * stable rating + 0.25 * rolling rating) +# rating_updates = false + + # Allows creating, deleting and modifying m3u playlists in the library directories. + # Only supported by the player web interface and some mpd clients + # Defaults to being disabled. +# allow_modifying_stored_playlists = false + + # A directory in one of the library directories that will be used as the default + # playlist directory. forked-dapd creates new playlists in this directory if only + # a playlist name is provided (requires "allow_modify_stored_playlists" set to true). +# default_playlist_directory = "" +} + +# Local audio output +audio { + # Name - used in the speaker list in Remote + nickname = "OpenWrt" + + # Type of the output (alsa, pulseaudio, dummy or disabled) +# type = "alsa" + + # For pulseaudio output, an optional server hostname or IP can be + # specified (e.g. "localhost"). If not set, connection is made via local + # socket. +# server = "" + + # Audio PCM device name for local audio output - ALSA only +# card = "default" + + # Mixer channel to use for volume control - ALSA only + # If not set, PCM will be used if available, otherwise Master. +# mixer = "" + + # Mixer device to use for volume control - ALSA only + # If not set, the value for "card" will be used. +# mixer_device = "" + + # Enable or disable audio resampling to keep local audio in sync with + # e.g. Airplay. This feature relies on accurate ALSA measurements of + # delay, and some devices don't provide that. If that is the case you + # are better off disabling the feature. +# sync_disable = false + + # Here you can adjust when local audio is started relative to other + # speakers, e.g. Airplay. Negative values correspond to moving local + # audio ahead, positive correspond to delaying it. The unit is + # milliseconds. The offset must be between -1000 and 1000 (+/- 1 sec). +# offset_ms = 0 + + # To calculate what and if resampling is required, local audio delay is + # measured each second. After a period the collected measurements are + # used to estimate drift and latency, which determines if corrections + # are required. This setting sets the length of that period in seconds. +# adjust_period_seconds = 100 +} + +# ALSA device settings +# If you have multiple ALSA devices you can configure them individually via +# sections like the below. Make sure to set the "card name" correctly. See the +# README about ALSA for details. Note that these settings will override the ALSA +# settings in the "audio" section above. +#alsa "card name" { + # Name - used in the speaker list in Remote + # If not set, the card name will be used +# nickname = "Computer" + + # Mixer channel to use for volume control + # If not set, PCM will be used if available, otherwise Master +# mixer = "" + + # Mixer device to use for volume control + # If not set, the card name will be used +# mixer_device = "" +#} + +# Pipe output +# Allows forked-daapd to output audio data to a named pipe +#fifo { +# nickname = "fifo" +# path = "/path/to/fifo" +#} + +# AirPlay settings common to all devices +#airplay_shared { + # UDP ports used when airplay devices make connections back to forked-daapd + # (choosing specific ports may be helpful when running forked-daapd behind a firewall) +# control_port = 0 +# timing_port = 0 +#} + +# AirPlay per device settings +# (make sure you get the capitalization of the device name right) +#airplay "My AirPlay device" { + # forked-daapd's volume goes to 11! If that's more than you can handle + # you can set a lower value here +# max_volume = 11 + + # Enable this option to exclude a particular AirPlay device from the + # speaker list +# exclude = false + + # Enable this option to keep a particular AirPlay device in the speaker + # list and thus ignore mdns notifications about it no longer being + # present. The speaker will remain until restart of forked-daapd. +# permanent = false + + # Some devices spuriously disconnect during playback, and based on the + # device type forked-daapd may attempt to reconnect. Setting this option + # overrides this so reconnecting is either always enabled or disabled. +# reconnect = false + + # AirPlay password +# password = "s1kr3t" +#} + +# Chromecast settings +# (make sure you get the capitalization of the device name right) +#chromecast "My Chromecast device" { + # Enable this option to exclude a particular device from the speaker + # list +# exclude = false +#} + +# Spotify settings (only have effect if Spotify enabled - see README/INSTALL) +spotify { + # Directory where user settings should be stored (credentials) +# settings_dir = "/var/cache/forked-daapd/libspotify" + + # Cache directory +# cache_dir = "/tmp" + + # Set preferred bitrate for music streaming + # 0: No preference (default), 1: 96kbps, 2: 160kbps, 3: 320kbps +# bitrate = 0 + + # Your Spotify playlists will by default be put in a "Spotify" playlist + # folder. If you would rather have them together with your other + # playlists you can set this option to true. +# base_playlist_disable = false + + # Spotify playlists usually have many artist, and if you don't want + # every artist to be listed when artist browsing in Remote, you can set + # the artist_override flag to true. This will use the compilation_artist + # as album artist for Spotify items. +# artist_override = false + + # Similar to the different artists in Spotify playlists, the playlist + # items belong to different albums, and if you do not want every album + # to be listed when browsing in Remote, you can set the album_override + # flag to true. This will use the playlist name as album name for + # Spotify items. Notice that if an item is in more than one playlist, + # it will only appear in one album when browsing (in which album is + # random). +# album_override = false +} + +# MPD configuration (only have effect if MPD enabled - see README/INSTALL) +mpd { + # TCP port to listen on for MPD client requests. + # Default port is 6600, set to 0 to disable MPD support. +# port = 6600 + + # HTTP port to listen for artwork requests (only supported by some MPD + # clients and will need additional configuration in the MPD client to + # work). Set to 0 to disable serving artwork over http. +# http_port = 0 + + # By default forked-daapd will - like iTunes - clear the playqueue if + # playback stops. Setting clear_queue_on_stop_disable to true will keep + # the playlist like MPD does. Note that some dacp clients do not show + # the playqueue if playback is stopped. +# clear_queue_on_stop_disable = false +} + +# SQLite configuration (allows to modify the operation of the SQLite databases) +# Make sure to read the SQLite documentation for the corresponding PRAGMA +# statements as changing them from the defaults may increase the possibility of +# database corruptions! By default the SQLite default values are used. +sqlite { + # Cache size in number of db pages for the library database + # (SQLite default page size is 1024 bytes and cache size is 2000 pages) +# pragma_cache_size_library = 2000 + + # Cache size in number of db pages for the daap cache database + # (SQLite default page size is 1024 bytes and cache size is 2000 pages) +# pragma_cache_size_cache = 2000 + + # Sets the journal mode for the database + # DELETE (default), TRUNCATE, PERSIST, MEMORY, WAL, OFF +# pragma_journal_mode = DELETE + + # Change the setting of the "synchronous" flag + # 0: OFF, 1: NORMAL, 2: FULL (default) +# pragma_synchronous = 2 + + # Number of bytes set aside for memory-mapped I/O for the library database + # (requires sqlite 3.7.17 or later) + # 0: disables mmap (default), any other value > 0: number of bytes for mmap +# pragma_mmap_size_library = 0 + + # Number of bytes set aside for memory-mapped I/O for the cache database + # (requires sqlite 3.7.17 or later) + # 0: disables mmap (default), any other value > 0: number of bytes for mmap +# pragma_mmap_size_cache = 0 + + # Should the database be vacuumed on startup? (increases startup time, + # but may reduce database size). Default is yes. +# vacuum = yes +} + +# Streaming audio settings for remote connections (ie stream.mp3) +streaming { + # Sample rate, typically 44100 or 48000 +# sample_rate = 44100 + + # Set the MP3 streaming bit rate (in kbps), valid options: 64 / 96 / 128 / 192 / 320 +# bit_rate = 192 +} diff --git a/sound/forked-daapd/files/forked-daapd.init b/sound/forked-daapd/files/forked-daapd.init new file mode 100644 index 0000000000..3ae38f9ab5 --- /dev/null +++ b/sound/forked-daapd/files/forked-daapd.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2014 OpenWrt.org + +START=99 +BIN=/usr/sbin/forked-daapd +PID=/var/run/forked-daapd.pid +SSD=start-stop-daemon + +start() { + $SSD -p $PID -S -x $BIN -- -P $PID +} + +stop() { + $SSD -p $PID -K -s SIGINT +} From 4832dc4c87580859923763df3312f9deff5dc920 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 16 Nov 2024 15:13:37 +0800 Subject: [PATCH 31/88] oscam: add package --- net/oscam/Config.in | 241 ++++++++++++++++++ net/oscam/Makefile | 156 ++++++++++++ net/oscam/files/oscam-watchdog.sh | 31 +++ net/oscam/files/oscam.conf | 48 ++++ net/oscam/files/oscam.dvbapi | 31 +++ net/oscam/files/oscam.init | 45 ++++ net/oscam/files/oscam.server | 14 + net/oscam/files/oscam.user | 27 ++ net/trojan/Makefile | 67 +++++ .../patches/001-force-openssl-version.patch | 11 + 10 files changed, 671 insertions(+) create mode 100644 net/oscam/Config.in create mode 100644 net/oscam/Makefile create mode 100755 net/oscam/files/oscam-watchdog.sh create mode 100644 net/oscam/files/oscam.conf create mode 100755 net/oscam/files/oscam.dvbapi create mode 100755 net/oscam/files/oscam.init create mode 100755 net/oscam/files/oscam.server create mode 100755 net/oscam/files/oscam.user create mode 100644 net/trojan/Makefile create mode 100644 net/trojan/patches/001-force-openssl-version.patch diff --git a/net/oscam/Config.in b/net/oscam/Config.in new file mode 100644 index 0000000000..0b86f66952 --- /dev/null +++ b/net/oscam/Config.in @@ -0,0 +1,241 @@ +menu "OSCam build options" + depends on PACKAGE_oscam + +config OSCAM_USE_LIBCRYPTO + bool "Build with OpenSSL libcrypto" + help + "Use OpenSSL libcrypto instead of OSCam internal crypto functions" + default y + +config OSCAM_USE_LIBUSB + bool + default y + + menu "Protocols" + depends on PACKAGE_oscam + + config OSCAM_MODULE_CAMD33 + bool "camd 3.3" + default y + + config OSCAM_MODULE_CAMD35 + bool "camd 3.5 UDP" + default y + + config OSCAM_MODULE_CAMD35_TCP + bool "camd 3.5 TCP" + default y + + config OSCAM_MODULE_NEWCAMD + bool "newcamd" + default y + + config OSCAM_MODULE_CCCAM + bool "CCcam" + default y + + config OSCAM_MODULE_CCCSHARE + bool "CCcam share" + default y + + config OSCAM_MODULE_GBOX + bool "gbox" + default y + + config OSCAM_MODULE_RADEGAST + bool "radegast" + default y + + config OSCAM_MODULE_SERIAL + bool "Serial" + default y + + config OSCAM_MODULE_CONSTCW + bool "constant CW" + default y + + config OSCAM_MODULE_PANDORA + bool "Pandora" + default y + + config OSCAM_MODULE_GHTTP + bool "Ghttp" + default y + + config OSCAM_MODULE_SCAM + bool "scam" + default y + + endmenu + + menu "Readers" + depends on PACKAGE_oscam + + config OSCAM_READER_NAGRA + bool "Nagravision" + default y + + config OSCAM_READER_IRDETO + bool "Irdeto" + default y + + config OSCAM_READER_CONAX + bool "Conax" + default y + + config OSCAM_READER_CRYPTOWORKS + bool "Cryptoworks" + default y + + config OSCAM_READER_SECA + bool "Seca" + default y + + config OSCAM_READER_VIACCESS + bool "Viaccess" + default y + + config OSCAM_READER_VIDEOGUARD + bool "NDS Videoguard" + default y + + config OSCAM_READER_DRE + bool "DRE Crypt" + default y + + config OSCAM_READER_TONGFANG + bool "Tongfang" + default y + + config OSCAM_READER_BULCRYPT + bool "Bulcrypt" + default y + + config OSCAM_READER_GRIFFIN + bool "Griffin" + default y + + config OSCAM_READER_DGCRYPT + bool "DGCrypt" + default y + + endmenu + + menu "Card readers" + depends on PACKAGE_oscam + + config OSCAM_USE_PCSC + bool "PCSC compatible readers" + select OSCAM_USE_LIBUSB + default y + + config OSCAM_CARDREADER_PHOENIX + bool "Phoenix/mouse USB readers" + select OSCAM_USE_LIBUSB + default y + + config OSCAM_CARDREADER_SC8IN1 + bool "SC8in1" + select OSCAM_USE_LIBUSB + default y + + config OSCAM_CARDREADER_MP35 + bool "AD-Teknik MP 3.6/USB Phoenix" + select OSCAM_USE_LIBUSB + default y + + config OSCAM_CARDREADER_SMARGO + bool "Argolis Smargo Smartreader" + select OSCAM_USE_LIBUSB + default y + + config OSCAM_CARDREADER_STINGER + bool "Stinger USB Dual Smartcard Reader" + select OSCAM_USE_LIBUSB + default y + + config OSCAM_CARDREADER_DRECAS + bool "DRECAS reader" + default y + + endmenu + +comment "Addons" +config OSCAM_HAVE_DVBAPI + bool "DVB API" + default y + +config OSCAM_READ_SDT_CHARSETS + bool "DVB API read-sdt charsets" + default y + +config OSCAM_IRDETO_GUESSING + bool "Irdeto guessing" + default y + +config OSCAM_CS_ANTICASC + bool "Anti cascading" + default y + +config OSCAM_WITH_DEBUG + bool "Debug messages" + default y + +config OSCAM_MODULE_MONITOR + bool "Monitor" + default y + +config OSCAM_WITH_LB + bool "Loadbalancing" + default y + +config OSCAM_S_CACHEEX + bool "Cache exchange" + default y + +config OSCAM_CW_CYCLE_CHECK + bool "CW Cycle Check" + default y + +config OSCAM_LCDSUPPORT + bool "LCD support" + default n + +config OSCAM_LEDSUPPORT + bool "LED support" + default n + +config OSCAM_CLOCKFIX + bool "Clockfix (disable on old systems!)" + default y + +config OSCAM_IPV6SUPPORT + bool "IPv6 support (experimental)" + default n + +config OSCAM_WEBIF + bool "Web Interface" + default y + + config OSCAM_WEBIF_LIVELOG + bool "LiveLog" + depends on OSCAM_WEBIF + default y + + config OSCAM_WEBIF_JQUERY + bool "Jquery onboard (if disabled webload)" + depends on OSCAM_WEBIF + default y + + config OSCAM_TOUCH + bool "Touch Web Interface" + depends on OSCAM_WEBIF + default y + + config OSCAM_WITH_SSL + bool "SSL support" + depends on OSCAM_WEBIF + select OSCAM_USE_LIBCRYPTO + default y + +endmenu diff --git a/net/oscam/Makefile b/net/oscam/Makefile new file mode 100644 index 0000000000..1b258cdfcf --- /dev/null +++ b/net/oscam/Makefile @@ -0,0 +1,156 @@ +# +# Copyright (C) 2016-2017 Tomasz Maciej Nowak +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=oscam +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/nx111/oscam.git +PKG_SOURCE_DATE:=2020-12-12 +PKG_SOURCE_VERSION:=aafda4bca3c347698ef1dc32f7ebeff76378d55a +PKG_MIRROR_HASH:=d2cd4508ef80a3cbd8ef950e5446f2f754b339f179c4f774ef8660b39fd5c4c1 + +PKG_LICENSE:=GPL-3.0 +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Tomasz Maciej Nowak + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/oscam/config + source "$(SOURCE)/Config.in" +endef + +define Package/oscam + SECTION:=net + CATEGORY:=Network + TITLE:=Open Source Conditional Access Modul + URL:=http://www.streamboard.tv/oscam + DEPENDS:=+OSCAM_USE_LIBCRYPTO:libopenssl +OSCAM_USE_LIBUSB:libusb-1.0 +OSCAM_USE_PCSC:pcscd +endef + +define Package/list-smargo + SECTION:=net + CATEGORY:=Network + TITLE:=List Smargo readers + URL:=http://www.streamboard.tv/oscam + DEPENDS:=oscam @OSCAM_CARDREADER_SMARGO +endef + +CONFIGURE_CMD:=./config.sh +CONFIGURE_ARGS+= \ + --restore \ + $(if $(CONFIG_OSCAM_WEBIF),--enable,--disable) WEBIF \ + $(if $(CONFIG_OSCAM_WEBIF_LIVELOG),--enable,--disable) WEBIF_LIVELOG \ + $(if $(CONFIG_OSCAM_WEBIF_JQUERY),--enable,--disable) WEBIF_JQUERY \ + $(if $(CONFIG_OSCAM_TOUCH),--enable,--disable) TOUCH \ + $(if $(CONFIG_OSCAM_WITH_SSL),--enable,--disable) WITH_SSL \ + $(if $(CONFIG_OSCAM_HAVE_DVBAPI),--enable,--disable) HAVE_DVBAPI \ + $(if $(CONFIG_OSCAM_READ_SDT_CHARSETS),--enable,--disable) READ_SDT_CHARSETS \ + $(if $(CONFIG_OSCAM_IRDETO_GUESSING),--enable,--disable) IRDETO_GUESSING \ + $(if $(CONFIG_OSCAM_CS_ANTICASC),--enable,--disable) CS_ANTICASC \ + $(if $(CONFIG_OSCAM_WITH_DEBUG),--enable,--disable) WITH_DEBUG \ + $(if $(CONFIG_OSCAM_MODULE_MONITOR),--enable,--disable) MODULE_MONITOR \ + $(if $(CONFIG_OSCAM_WITH_LB),--enable,--disable) WITH_LB \ + $(if $(CONFIG_OSCAM_CS_CACHEEX),--enable,--disable) CS_CACHEEX \ + $(if $(CONFIG_OSCAM_CW_CYCLE_CHECK),--enable,--disable) CW_CYCLE_CHECK \ + $(if $(CONFIG_OSCAM_LCDSUPPORT),--enable,--disable) LCDSUPPORT \ + $(if $(CONFIG_OSCAM_LEDSUPPORT),--enable,--disable) LEDSUPPORT \ + $(if $(CONFIG_OSCAM_CLOCKFIX),--enable,--disable) CLOCKFIX \ + $(if $(CONFIG_OSCAM_IPV6SUPPORT),--enable,--disable) IPV6SUPPORT \ + $(if $(CONFIG_OSCAM_MODULE_CAMD33),--enable,--disable) MODULE_CAMD33 \ + $(if $(CONFIG_OSCAM_MODULE_CAMD35),--enable,--disable) MODULE_CAMD35 \ + $(if $(CONFIG_OSCAM_MODULE_CAMD35_TCP),--enable,--disable) MODULE_CAMD35_TCP \ + $(if $(CONFIG_OSCAM_MODULE_NEWCAMD),--enable,--disable) MODULE_NEWCAMD \ + $(if $(CONFIG_OSCAM_MODULE_CCCAM),--enable,--disable) MODULE_CCCAM \ + $(if $(CONFIG_OSCAM_MODULE_CCCSHARE),--enable,--disable) MODULE_CCCSHARE \ + $(if $(CONFIG_OSCAM_MODULE_GBOX),--enable,--disable) MODULE_GBOX \ + $(if $(CONFIG_OSCAM_MODULE_RADEGAST),--enable,--disable) MODULE_RADEGAST \ + $(if $(CONFIG_OSCAM_MODULE_SCAM),--enable,--disable) MODULE_SCAM \ + $(if $(CONFIG_OSCAM_MODULE_SERIAL),--enable,--disable) MODULE_SERIAL \ + $(if $(CONFIG_OSCAM_MODULE_CONSTCW),--enable,--disable) MODULE_CONSTCW \ + $(if $(CONFIG_OSCAM_MODULE_PANDORA),--enable,--disable) MODULE_PANDORA \ + $(if $(CONFIG_OSCAM_MODULE_GHTTP),--enable,--disable) MODULE_GHTTP \ + $(if $(CONFIG_OSCAM_READER_NAGRA),--enable,--disable) READER_NAGRA \ + $(if $(CONFIG_OSCAM_READER_IRDETO),--enable,--disable) READER_IRDETO \ + $(if $(CONFIG_OSCAM_READER_CONAX),--enable,--disable) READER_CONAX \ + $(if $(CONFIG_OSCAM_READER_CRYPTOWORKS),--enable,--disable) READER_CRYPTOWORKS \ + $(if $(CONFIG_OSCAM_READER_SECA),--enable,--disable) READER_SECA \ + $(if $(CONFIG_OSCAM_READER_VIACCESS),--enable,--disable) READER_VIACCESS \ + $(if $(CONFIG_OSCAM_READER_VIDEOGUARD),--enable,--disable) READER_VIDEOGUARD \ + $(if $(CONFIG_OSCAM_READER_DRE),--enable,--disable) READER_DRE \ + $(if $(CONFIG_OSCAM_READER_TONGFANG),--enable,--disable) READER_TONGFANG \ + $(if $(CONFIG_OSCAM_READER_BULCRYPT),--enable,--disable) READER_BULCRYPT \ + $(if $(CONFIG_OSCAM_READER_GRIFFIN),--enable,--disable) READER_GRIFFIN \ + $(if $(CONFIG_OSCAM_READER_DGCRYPT),--enable,--disable) READER_DGCRYPT \ + $(if $(CONFIG_OSCAM_CARDREADER_PHOENIX),--enable,--disable) CARDREADER_PHOENIX \ + $(if $(CONFIG_OSCAM_CARDREADER_SC8IN1),--enable,--disable) CARDREADER_SC8IN1 \ + $(if $(CONFIG_OSCAM_CARDREADER_MP35),--enable,--disable) CARDREADER_MP35 \ + $(if $(CONFIG_OSCAM_CARDREADER_SMARGO),--enable,--disable) CARDREADER_SMARGO \ + $(if $(CONFIG_OSCAM_CARDREADER_STINGER),--enable,--disable) CARDREADER_STINGER \ + $(if $(CONFIG_OSCAM_CARDREADER_DRECAS),--enable,--disable) CARDREADER_DRECAS \ + --disable CARDREADER_INTERNAL_AZBOX \ + --disable CARDREADER_INTERNAL_COOLAPI \ + --disable CARDREADER_INTERNAL_COOLAPI2 \ + --disable CARDREADER_INTERNAL_SCI \ + --disable CARDREADER_DB2COM \ + --disable CARDREADER_STAPI \ + --disable CARDREADER_STAPI5 + +ifeq ($(CONFIG_OSCAM_USE_LIBUSB),y) + MAKE_FLAGS += USE_LIBUSB=1 +endif + +ifeq ($(CONFIG_OSCAM_USE_PCSC),y) + MAKE_FLAGS += USE_PCSC=1 +endif + +ifeq ($(CONFIG_OSCAM_USE_LIBCRYPTO),y) + MAKE_FLAGS += USE_LIBCRYPTO=1 +endif + +ifeq ($(CONFIG_OSCAM_WITH_SSL),y) + MAKE_FLAGS += USE_SSL=1 +endif + +MAKE_FLAGS += \ + CONF_DIR=/etc/oscam \ + OSCAM_BIN=Distribution/oscam \ + LIST_SMARGO_BIN=Distribution/list-smargo + +define Package/oscam/conffiles +/etc/oscam/ +endef + +define Package/oscam/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/Distribution/oscam $(1)/usr/bin/oscam + + $(INSTALL_DIR) $(1)/etc/oscam + # $(CP) $(PKG_BUILD_DIR)/Distribution/doc/example/* $(1)/etc/oscam/ + $(INSTALL_CONF) ./files/oscam.conf $(1)/etc/oscam/oscam.conf + $(INSTALL_CONF) ./files/oscam.user $(1)/etc/oscam/oscam.user + $(INSTALL_CONF) ./files/oscam.dvbapi $(1)/etc/oscam/oscam.dvbapi + $(INSTALL_CONF) ./files/oscam.server $(1)/etc/oscam/oscam.server + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/oscam.init $(1)/etc/init.d/oscam + + $(INSTALL_DIR) $(1)/usr/share/oscam + $(INSTALL_BIN) ./files/oscam-watchdog.sh $(1)/usr/share/oscam/oscam-watchdog.sh + +endef + +define Package/list-smargo/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/Distribution/list-smargo $(1)/usr/bin/list-smargo +endef + +$(eval $(call BuildPackage,oscam)) +$(eval $(call BuildPackage,list-smargo)) diff --git a/net/oscam/files/oscam-watchdog.sh b/net/oscam/files/oscam-watchdog.sh new file mode 100755 index 0000000000..d998af0f12 --- /dev/null +++ b/net/oscam/files/oscam-watchdog.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +sleeptime=60 +logfile="/var/log/oscam.log" +OSCAM_PATH=/usr/bin +enable=$(uci get oscam.config.enabled 2>/dev/null) + +oscam_log(){ + logrow=$(grep -c "" ${logfile}) + if [ $logrow -ge 500 ];then + cat /dev/null > ${logfile} + echo "$curtime Log条数超限,清空处理!" >> ${logfile} + fi +} + +while [ $enable -eq 1 ]; +do + oscam_log + curtime=`date "+%H:%M:%S"` + echo "$curtime online! " + + if ! pidof oscam>/dev/null; then + service_start ${OSCAM_PATH}/oscam -b -r 2 -u + echo "$curtime 重启服务!" >> ${logfile} + fi + +sleep ${sleeptime} +continue +done + + diff --git a/net/oscam/files/oscam.conf b/net/oscam/files/oscam.conf new file mode 100644 index 0000000000..dff8e53973 --- /dev/null +++ b/net/oscam/files/oscam.conf @@ -0,0 +1,48 @@ +# oscam.conf generated automatically by Streamboard OSCAM 1.20-unstable_svn SVN r11390 +# Read more: http://www.streamboard.tv/svn/oscam/trunk/Distribution/doc/txt/oscam.conf.txt + +[global] +disablelog = 1 +logfile = /var/log/oscam/oscam.log +nice = 0 +maxlogsize = 1000 +preferlocalcards = 1 +lb_mode = 3 +lb_min_ecmcount = 8 + +[cache] + +[dvbapi] +enabled = 1 +au = 1 +pmt_mode = 4 +request_mode = 1 +listen_port = 9000 +delayer = 80 +user = TVH +boxtype = pc + +[camd33] +port = 44444 +serverip = 127.0.0.1 +nocrypt = 127.0.0.1 + +[cccam] +port = 12000 +nodeid = 178EC950108E1442 +version = 2.3.0 +reshare = 1 +ignorereshare = 1 +stealth = 1 + +[webif] +httpport = 8888 +httpuser = oscam +httppwd = oscam +httpshowmeminfo = 1 +httpshowuserinfo = 1 +httpshowecminfo = 1 +httpshowloadinfo = 1 +httpallowed = 0.0.0.0-255.255.255.255 +aulow = 120 +httputf8 diff --git a/net/oscam/files/oscam.dvbapi b/net/oscam/files/oscam.dvbapi new file mode 100755 index 0000000000..68fc1c0275 --- /dev/null +++ b/net/oscam/files/oscam.dvbapi @@ -0,0 +1,31 @@ +P: 0500:040620 # NTV+ (36Е) +P: 0500:041200 # NTV+ (36Е) +P: 0500:060A00 # NTV+ (36E) +P: 0500:060C00 # NTV+ (36E) +P: 0500:023100 # trk football (Shara)(5Е) +P: 0500:041200 # trk football (Shara)(5Е) +P: 0500:041700 # Dorcel TV (13Е) +P: 0500:042300 # rtvi (13Е) +P: 0500:042700 # SCT, S1-7-HQ,HD (13Е) +P: 0500:042800 # Absat/BisTV (13Е) +P: 0500:043800 # REDLIGHT HD, Redlight Premium & Daring! TV (13Е) +P: 0100:000068 # Cyfra+ 13e +P: 09CD:0 # Sky 13e +P: 1803:007001 # Polsat (13Е) +P: 1803:007101 # Polsat (13Е) +P: 1803:000000 # Polsat (13Е) +P: 090D:0 # yes 4w +P: 090F:0 # viasat baltic 5e + +# EMU +P: 2600:000000 # BISS +P: 0500:023800 # srg (EMU)(13Е) +P: 0E00:000000 # PowerVU +P: 0500:007400 +P: 0D00:000000 +P: 0D05:000000 +P: 0D02:000000 +P: 1801:000000 + +# Ignor +I:0 diff --git a/net/oscam/files/oscam.init b/net/oscam/files/oscam.init new file mode 100755 index 0000000000..78f7029c25 --- /dev/null +++ b/net/oscam/files/oscam.init @@ -0,0 +1,45 @@ +#!/bin/sh /etc/rc.common + +START=99 +OSCAM_PATH=/usr/bin + +[ -f /tmp/oscam ] && +{ + OSCAM_PATH=/tmp + [ -x /tmp/oscam ] || chmod +x /tmp/oscam +} + +start() { + enable=$(uci get oscam.config.enabled 2>/dev/null) + kill -9 $(ps | grep oscam-watchdog.sh | grep -v "grep" | awk '{print $1}') >/dev/null 2>&1 + if [ $enable -eq 1 ]; then + /etc/init.d/pcscd enable + /etc/init.d/pcscd start + if pidof oscam >/dev/null; then + kill $(pidof oscam) >/dev/null 2>&1 || killall -9 oscam >/dev/null 2>&1 + sleep 1 + fi + echo "enable" + [ -d /var/log/oscam ] || mkdir -p /var/log/oscam + service_start ${OSCAM_PATH}/oscam -b -r 2 -u + nohup /usr/share/oscam/oscam-watchdog.sh > /var/log/oscam.log 2>&1 & + fi +} + +stop() { + enable=$(uci get oscam.config.enabled 2>/dev/null) + if [ $enable -ne 1 ]; then + echo "stop!" + kill -9 $(ps | grep oscam-watchdog.sh | grep -v "grep" | awk '{print $1}') >/dev/null 2>&1 + kill $(pidof oscam) >/dev/null 2>&1 || killall -9 oscam >/dev/null 2>&1 + /etc/init.d/pcscd stop + /etc/init.d/pcscd disable + fi +} + +restart(){ + stop + sleep 2 + start + echo "oscam Server has restarted." +} \ No newline at end of file diff --git a/net/oscam/files/oscam.server b/net/oscam/files/oscam.server new file mode 100755 index 0000000000..0b337bda6d --- /dev/null +++ b/net/oscam/files/oscam.server @@ -0,0 +1,14 @@ +# oscam.server generated automatically by Streamboard OSCAM 1.20-unstable_svn SVN r11401 +# Read more: http://www.streamboard.tv/svn/oscam/trunk/Distribution/doc/txt/oscam.server.txt + +[reader] +label = emulator +protocol = emu +device = emulator +caid = 0D00,0D02,090F,0500,1801,0604,2600,FFFF,0E00 +detect = cd +ident = 0D00:000000,000004,000010,000014,000020,0000C0,0000C4,0000C8,0000CC;0D02:000000,00008C,0000A0,0000A4,0000A8;090F:000000;0500:000000,030B00,023800,021110,007400,007800;1801:000000,007301,001101;0604:000000;2600:000000;FFFF:000000;0E00:000000 +group = 1 +emmcache = 2,3,2,0 +emu_auproviders = 0500:030B00;0604:010200;0E00:000000 + diff --git a/net/oscam/files/oscam.user b/net/oscam/files/oscam.user new file mode 100755 index 0000000000..5e02dd83e3 --- /dev/null +++ b/net/oscam/files/oscam.user @@ -0,0 +1,27 @@ +# oscam.user generated automatically by Streamboard OSCAM 1.20-unstable_svn SVN r11401 +# Read more: http://www.streamboard.tv/svn/oscam/trunk/Distribution/doc/txt/oscam.user.txt + +[account] +user = tvheadend_x +pwd = tvheadend_x +monlevel = 4 +au = 1 +group = 1 +max_connections = 100 +cccreshare = 1 + +[account] +user = user1 +pwd = user1 +monlevel = 4 +au = 1 +group = 1 +max_connections = 100 +cccreshare = 1 + +[account] +user = monitor +pwd = monitor +monlevel = 4 +group = 1 + diff --git a/net/trojan/Makefile b/net/trojan/Makefile new file mode 100644 index 0000000000..d16dd5175d --- /dev/null +++ b/net/trojan/Makefile @@ -0,0 +1,67 @@ +# +# Copyright (C) 2018-2019 wongsyrone +# +# This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=trojan +PKG_VERSION:=1.16.0 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/trojan-gfw/trojan/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=86cdb2685bb03a63b62ce06545c41189952f1ec4a0cd9147450312ed70956cbc + +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_DEPENDS:=openssl + +PKG_LICENSE:=GPL-3.0 +PKG_LICENSE_FILE:=LICENSE +PKG_MAINTAINER:=GreaterFire + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +TARGET_CXXFLAGS += -Wall -Wextra +TARGET_CXXFLAGS += $(FPIC) + +# LTO +TARGET_CXXFLAGS += -flto +TARGET_LDFLAGS += -flto + +# CXX standard +TARGET_CXXFLAGS += -std=c++11 +TARGET_CXXFLAGS := $(filter-out -O%,$(TARGET_CXXFLAGS)) -O3 +TARGET_CXXFLAGS += -ffunction-sections -fdata-sections +TARGET_LDFLAGS += -Wl,--gc-sections + +CMAKE_OPTIONS += \ + -DENABLE_MYSQL=OFF \ + -DENABLE_NAT=ON \ + -DENABLE_REUSE_PORT=ON \ + -DENABLE_SSL_KEYLOG=ON \ + -DENABLE_TLS13_CIPHERSUITES=ON \ + -DFORCE_TCP_FASTOPEN=OFF \ + -DSYSTEMD_SERVICE=OFF \ + -DOPENSSL_USE_STATIC_LIBS=FALSE \ + -DBoost_DEBUG=ON \ + -DBoost_NO_BOOST_CMAKE=ON + +define Package/trojan + SECTION:=net + CATEGORY:=Network + TITLE:=An unidentifiable mechanism that helps you bypass GFW + URL:=https://github.com/trojan-gfw/trojan + DEPENDS:= \ + +libpthread +libstdcpp +libopenssl \ + +boost +boost-system +boost-program_options +boost-date_time +endef + +define Package/trojan/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/trojan $(1)/usr/sbin/trojan +endef + +$(eval $(call BuildPackage,trojan)) diff --git a/net/trojan/patches/001-force-openssl-version.patch b/net/trojan/patches/001-force-openssl-version.patch new file mode 100644 index 0000000000..7ee8f631cc --- /dev/null +++ b/net/trojan/patches/001-force-openssl-version.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,7 +43,7 @@ if(MSVC) + add_definitions(-DBOOST_DATE_TIME_NO_LIB) + endif() + +-find_package(OpenSSL 1.1.0 REQUIRED) ++find_package(OpenSSL 1.1.1 REQUIRED) + include_directories(${OPENSSL_INCLUDE_DIR}) + target_link_libraries(trojan ${OPENSSL_LIBRARIES}) + if(OPENSSL_VERSION VERSION_GREATER_EQUAL 1.1.1) From 0ad6c23ccda4176124c8ad03130997f5c583c9cd Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 17 Nov 2024 11:10:17 +0800 Subject: [PATCH 32/88] ffmpeg: update to 5.1.4 --- multimedia/ffmpeg/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/ffmpeg/Makefile b/multimedia/ffmpeg/Makefile index 41f4121095..dfde9b4589 100644 --- a/multimedia/ffmpeg/Makefile +++ b/multimedia/ffmpeg/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ffmpeg -PKG_VERSION:=5.1.2 +PKG_VERSION:=5.1.4 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://ffmpeg.org/releases/ -PKG_HASH:=619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc +PKG_HASH:=54383bb890a1cd62580e9f1eaa8081203196ed53bde9e98fb6b0004423f49063 PKG_MAINTAINER:=Ted Hess , \ Ian Leonard From d822390763e146673dfb98bd81557d1425095172 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 22 Nov 2024 16:13:51 +0800 Subject: [PATCH 33/88] xtables-addons: fix kernel 6.12 support --- net/xtables-addons/Makefile | 6 +++--- .../patches/211-fix-build-with-kernel-6.12.patch | 11 +++++++++++ .../patches/300-fix-path-Makefile.extra.patch | 11 +++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 net/xtables-addons/patches/211-fix-build-with-kernel-6.12.patch create mode 100644 net/xtables-addons/patches/300-fix-path-Makefile.extra.patch diff --git a/net/xtables-addons/Makefile b/net/xtables-addons/Makefile index 272e95917c..8484adf987 100644 --- a/net/xtables-addons/Makefile +++ b/net/xtables-addons/Makefile @@ -7,9 +7,9 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=xtables-addons -PKG_VERSION:=3.24 -PKG_RELEASE:=2 -PKG_HASH:=3e823f71720519ced31c4c7d2bfaf7120d9c01c59a0843dfcbe93c95c64d81c1 +PKG_VERSION:=3.27 +PKG_RELEASE:=1 +PKG_HASH:=e47ea8febe73c12ecab09d2c93578c5dc72d76f17fdf673397758f519cce6828 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://inai.de/files/xtables-addons/ diff --git a/net/xtables-addons/patches/211-fix-build-with-kernel-6.12.patch b/net/xtables-addons/patches/211-fix-build-with-kernel-6.12.patch new file mode 100644 index 0000000000..e2449ccf9f --- /dev/null +++ b/net/xtables-addons/patches/211-fix-build-with-kernel-6.12.patch @@ -0,0 +1,11 @@ +--- a/extensions/rtsp/nf_conntrack_rtsp.c ++++ b/extensions/rtsp/nf_conntrack_rtsp.c +@@ -735,7 +735,7 @@ + } + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) +- strlcpy(hlpr->name, tmpname, sizeof(hlpr->name)); ++ strscpy(hlpr->name, tmpname, sizeof(hlpr->name)); + #else + hlpr->name = tmpname; + #endif diff --git a/net/xtables-addons/patches/300-fix-path-Makefile.extra.patch b/net/xtables-addons/patches/300-fix-path-Makefile.extra.patch new file mode 100644 index 0000000000..34791746c1 --- /dev/null +++ b/net/xtables-addons/patches/300-fix-path-Makefile.extra.patch @@ -0,0 +1,11 @@ +--- a/extensions/ACCOUNT/Makefile.am ++++ b/extensions/ACCOUNT/Makefile.am +@@ -3,7 +3,7 @@ + AM_CPPFLAGS = ${regular_CPPFLAGS} -I${abs_top_srcdir}/extensions + AM_CFLAGS = ${regular_CFLAGS} ${libxtables_CFLAGS} + +-include ${top_srcdir}/Makefile.extra ++include ../../Makefile.extra + + sbin_PROGRAMS = iptaccount + iptaccount_LDADD = libxt_ACCOUNT_cl.la From 2263fd5d0082a2b293abf44ef9cdf25b791d7ab8 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 23 Nov 2024 00:41:04 +0800 Subject: [PATCH 34/88] mdio-tools: add package --- kernel/mdio-netlink/Makefile | 39 ++++++++++++++++++++++++++++++++ net/mdio-tools/Makefile | 44 ++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 kernel/mdio-netlink/Makefile create mode 100644 net/mdio-tools/Makefile diff --git a/kernel/mdio-netlink/Makefile b/kernel/mdio-netlink/Makefile new file mode 100644 index 0000000000..cd8acf6acb --- /dev/null +++ b/kernel/mdio-netlink/Makefile @@ -0,0 +1,39 @@ +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=mdio-netlink +PKG_VERSION:=1.3.1 +PKG_RELEASE:=2 + +PKG_SOURCE_URL:=https://github.com/wkz/mdio-tools +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=f74eaf38dbda441df4fcaeb21ca4465957953a2f +PKG_MIRROR_HASH:=97dfd25d8cdf5994eeb8cb0a5862c993b8aef373b280bca567d41d4113f494a9 + +PKG_LICENSE:=GPL-2.0-only +PKG_LICENSE_FILES:=COPYING + +PKG_MAINTAINER:=Damien Mascord + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/mdio-netlink + SECTION:=kernel + CATEGORY:=Kernel modules + SUBMENU:=Network Support + TITLE:=mdio-netlink Linux MDIO netlink kernel module + KCONFIG:=CONFIG_PHYLIB=y CONFIG_MDIO_BUS=y + URL:=https://github.com/wkz/mdio-tools.git + FILES:=$(PKG_BUILD_DIR)/kernel/mdio-netlink.ko + AUTOLOAD:=$(call AutoProbe,mdio-netlink) +endef + +define KernelPackage/mdio-netlink/description + mdio-netlink Linux MDIO netlink kernel module +endef + +define Build/Compile + $(KERNEL_MAKE) M=$(PKG_BUILD_DIR)/kernel modules +endef + +$(eval $(call KernelPackage,mdio-netlink)) diff --git a/net/mdio-tools/Makefile b/net/mdio-tools/Makefile new file mode 100644 index 0000000000..323cb1bd31 --- /dev/null +++ b/net/mdio-tools/Makefile @@ -0,0 +1,44 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=mdio-tools +PKG_VERSION:=1.3.1 +PKG_RELEASE:=2 + +PKG_SOURCE_URL:=https://github.com/wkz/mdio-tools +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=f74eaf38dbda441df4fcaeb21ca4465957953a2f +PKG_MIRROR_HASH:=b7973284dc3dffef4bd2a904e3f7aa7fd3caab4aecf85ac57488f5acbf341aba + +PKG_FIXUP:=autoreconf + +PKG_LICENSE:=GPL-2.0-only +PKG_LICENSE_FILES:=COPYING + +PKG_MAINTAINER:=Damien Mascord + +include $(INCLUDE_DIR)/package.mk + +define Package/mdio-tools + SECTION:=net + CATEGORY:=Utilities + TITLE:=mdio-tools Linux MDIO register access + URL:=https://github.com/wkz/mdio-tools.git + DEPENDS:=+kmod-mdio-netlink +libmnl +endef + +define Package/mdio-tools/description + mdio-tools Linux MDIO register access +endef + +define Package/mdio-tools/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mdio/mdio $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mvls/mvls $(1)/usr/bin/ +endef + +define Build/Prepare + $(call Build/Prepare/Default) + $(SED) 's/m4_esyscmd_s(.*)/$(PKG_VERSION)/' $(PKG_BUILD_DIR)/configure.ac +endef + +$(eval $(call BuildPackage,mdio-tools)) From 95fa4ae65ca315af8aa12be729684b267575491b Mon Sep 17 00:00:00 2001 From: teleostnacl <109426830+teleostnacl@users.noreply.github.com> Date: Thu, 28 Nov 2024 10:30:42 +0800 Subject: [PATCH 35/88] speedtest-go: update to 1.7.9 (#869) Update speedtest-go version to 1.7.9 Signed-off-by: TeleostNaCl Dai --- net/speedtest-go/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/speedtest-go/Makefile b/net/speedtest-go/Makefile index 393151315f..1d864dec42 100644 --- a/net/speedtest-go/Makefile +++ b/net/speedtest-go/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=speedtest-go -PKG_VERSION:=1.7.7 +PKG_VERSION:=1.7.9 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/showwin/speedtest-go/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=68609998d91e6ac159b41cf85c758058805527044e1af3d557fd67bb4fabd9de +PKG_HASH:=1273ad19dc8ecc4ff40204c62c372bb90c81c73c1cf3a9b208bab7f1035dfa67 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE From 97ab90bf2976d7a2386b4c18e766c5fe48664a78 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 28 Nov 2024 16:28:56 +0800 Subject: [PATCH 36/88] rblibtorrent: update to v1.2.19 --- libs/rblibtorrent/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/rblibtorrent/Makefile b/libs/rblibtorrent/Makefile index 9af292d82e..398512dcae 100644 --- a/libs/rblibtorrent/Makefile +++ b/libs/rblibtorrent/Makefile @@ -1,15 +1,15 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rblibtorrent -PKG_VERSION:=1.2.18 +PKG_VERSION:=1.2.19 PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/arvidn/libtorrent.git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=855c44be6370dc90ec1f3dff4223770dd47a5208 +PKG_SOURCE_VERSION:=aa9512a5ea1b723c7a57b77ad117da79608ea2fc PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_MIRROR_HASH:=da0626afc80287c8ee6825bfed2d52fe24e8fd9abff9952034292bdc00a2dac1 +PKG_MIRROR_HASH:=94de09d468ecc0b211ee261a1e8815f02057e97296e9e7d23951d3e291b062be PKG_LICENSE:=BSD PKG_LICENSE_FILES:=COPYING From 8fee5c51e16d1ae573021d9afbdb16cd6d1b93b0 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 30 Nov 2024 01:39:00 +0800 Subject: [PATCH 37/88] socat: update to 1.8.0.0 --- net/socat/Makefile | 15 +++++---- net/socat/files/socat.config | 6 ---- net/socat/files/socat.init | 61 ------------------------------------ 3 files changed, 7 insertions(+), 75 deletions(-) delete mode 100644 net/socat/files/socat.config delete mode 100644 net/socat/files/socat.init diff --git a/net/socat/Makefile b/net/socat/Makefile index 2f3ca78f4f..7b7e32fcb7 100644 --- a/net/socat/Makefile +++ b/net/socat/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=socat -PKG_VERSION:=1.7.4.4 -PKG_RELEASE:=1 +PKG_VERSION:=1.8.0.0 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://www.dest-unreach.org/socat/download -PKG_HASH:=fbd42bd2f0e54a3af6d01bdf15385384ab82dbc0e4f1a5e153b3e0be1b6380ac +PKG_HASH:=e1de683dd22ee0e3a6c6bbff269abe18ab0c9d7eb650204f125155b9005faca7 PKG_MAINTAINER:=Ted Hess PKG_LICENSE:=GPL-2.0-or-later OpenSSL @@ -58,6 +58,9 @@ CONFIGURE_ARGS += \ --disable-readline \ --enable-termios +## procan.c fails to compile when ccache is enabled +MAKE_FLAGS += CC="$(TARGET_CC_NOCACHE)" + ifneq ($(CONFIG_SOCAT_SSL),y) CONFIGURE_ARGS+= --disable-openssl endif @@ -84,10 +87,6 @@ CONFIGURE_VARS += \ define Package/socat/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/socat $(1)/usr/bin/ - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./files/socat.config $(1)/etc/config/socat - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/socat.init $(1)/etc/init.d/socat endef -$(eval $(call BuildPackage,socat)) +$(eval $(call BuildPackage,socat)) \ No newline at end of file diff --git a/net/socat/files/socat.config b/net/socat/files/socat.config deleted file mode 100644 index 196ab9c477..0000000000 --- a/net/socat/files/socat.config +++ /dev/null @@ -1,6 +0,0 @@ -# forward port 8000 on IPv6 to IPv4 host port 80 -# change enable to '1' to use this example -config socat 'http' - option enable '0' - option SocatOptions '-d -d TCP6-LISTEN:8000,fork TCP4:192.168.1.20:80' - option user 'nobody' diff --git a/net/socat/files/socat.init b/net/socat/files/socat.init deleted file mode 100644 index 03573a01ee..0000000000 --- a/net/socat/files/socat.init +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2008-2014 OpenWrt.org - -START=99 -STOP=99 - -USE_PROCD=1 -PROG=/usr/bin/socat -NAME=socat - -validate_section_socat() -{ - uci_load_validate socat socat "$1" "$2" \ - 'enable:bool:1' \ - 'SocatOptions:or(string, list(string))' \ - 'user:string:root' -} - -append_param_command() -{ - procd_append_param command "$1" -} - -socat_instance() -{ - local is_list - local user - - [ "$2" = 0 ] || { - echo "validation failed" - return 1 - } - - [ "$enable" = "0" ] && return 1 - - procd_open_instance - procd_set_param command "$PROG" - config_get is_list "$1" SocatOptions_LENGTH - if [ -z "$is_list" ]; then - procd_append_param command $SocatOptions - else - config_list_foreach "$1" SocatOptions append_param_command - fi - config_get user "$1" user - if [ -n "$user" ]; then - procd_set_param user $user - fi - procd_set_param stdout 1 - procd_set_param stderr 1 - procd_close_instance -} - -start_service () { - config_load "$NAME" - config_foreach validate_section_socat socat socat_instance -} - -service_triggers() { - procd_add_reload_trigger "$NAME" - procd_add_validation validate_section_socat -} From dd09eddf99d032d4e8cc4a9d2e8daa10b6f38cf6 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 30 Nov 2024 14:55:24 +0800 Subject: [PATCH 38/88] xray-core: update to 24.11.30 --- net/xray-core/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/xray-core/Makefile b/net/xray-core/Makefile index 3758b997af..c36099d0ee 100644 --- a/net/xray-core/Makefile +++ b/net/xray-core/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xray-core -PKG_VERSION:=24.10.16 +PKG_VERSION:=24.11.30 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/XTLS/Xray-core/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=2964cf0cc7cb1b631591cc49c49160d1a478d2f83e4f0a1081e0bc6cc38d8725 +PKG_HASH:=1ed728cf32cf9227c73e1b3651465eb089c6d2f42367cf40df62c4ba0edfc765 PKG_MAINTAINER:=Tianling Shen PKG_LICENSE:=MPL-2.0 From 33b43c290ae25ebfc14053d6764547b2449abb5d Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 3 Dec 2024 14:30:31 +0800 Subject: [PATCH 39/88] libs/glib2: update to 2.82.0 --- libs/glib2/Makefile | 59 +++++++++++-------- .../patches/003-valgrind.h-mips16-fix.patch | 2 +- libs/glib2/patches/006-c99.patch | 2 +- libs/glib2/patches/010-pcre.patch | 10 ---- libs/glib2/patches/020-locale.patch | 24 -------- 5 files changed, 37 insertions(+), 60 deletions(-) delete mode 100644 libs/glib2/patches/010-pcre.patch delete mode 100644 libs/glib2/patches/020-locale.patch diff --git a/libs/glib2/Makefile b/libs/glib2/Makefile index 5ded2fbddf..a24a2f3450 100644 --- a/libs/glib2/Makefile +++ b/libs/glib2/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=glib2 -PKG_VERSION:=2.74.0 -PKG_RELEASE:=5 +PKG_VERSION:=2.82.0 +PKG_RELEASE:=1 PKG_SOURCE:=glib-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNOME/glib/$(basename $(PKG_VERSION)) -PKG_HASH:=3652c7f072d7b031a6b5edd623f77ebc5dcd2ae698598abcc89ff39ca75add30 +PKG_HASH:=f4c82ada51366bddace49d7ba54b33b4e4d6067afa3008e4847f41cb9b5c38d3 PKG_MAINTAINER:=Peter Wagner PKG_LICENSE:=LGPL-2.1-or-later @@ -26,7 +26,7 @@ PKG_FORTIFY_SOURCE:=0 PKG_BUILD_FLAGS:=gc-sections HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/glib-$(PKG_VERSION) -HOST_BUILD_DEPENDS:=pcre2/host libffi/host +HOST_BUILD_DEPENDS:=pcre2/host libffi/host libiconv-full/host include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk @@ -45,26 +45,31 @@ define Package/glib2/description The GLib library of C routines endef -COMP_ARGS= \ - -Dselinux=disabled \ - -Dlibmount=disabled \ - -Dman=false \ - -Ddtrace=false \ - -Dsystemtap=false \ - -Dsysprof=disabled \ - -Dgtk_doc=false \ - -Dbsymbolic_functions=true \ - -Dforce_posix_threads=true \ - -Dtests=false \ - -Dinstalled_tests=false \ - -Doss_fuzz=disabled \ - -Dglib_debug=disabled \ - -Dglib_assert=false \ - -Dglib_checks=true \ - -Dlibelf=disabled - -MESON_HOST_ARGS += $(COMP_ARGS) -Dxattr=false -Ddefault_library=static -Dnls=disabled -MESON_ARGS += $(COMP_ARGS) -Dxattr=true -Db_lto=true -Ddefault_library=both -Dnls=$(if $(CONFIG_BUILD_NLS),en,dis)abled +COMP_ARGS:= + +# default feature=auto see meson_options.txt +COMP_ARGS+=-Dglib_debug=disabled + +# default feature=auto see meson_options.txt +COMP_ARGS+=-Dlibmount=disabled + +# default feature=auto see meson_options.txt +COMP_ARGS+=-Dselinux=disabled + +# default boolean=true see meson_options.txt +COMP_ARGS+=-Dglib_assert=false + +# default boolean=true see meson_options.txt +COMP_ARGS+=-Dtests=false + +# default feature=auto see meson_options.txt +COMP_ARGS+=-Dintrospection=disabled + +# set runtime dir to /var/run +COMP_ARGS+=-Druntime_dir=/var/run + +MESON_HOST_ARGS += $(COMP_ARGS) -Dxattr=false -Dnls=disabled +MESON_ARGS += $(COMP_ARGS) -Dxattr=true -Db_lto=true -Dnls=$(if $(CONFIG_BUILD_NLS),en,dis)abled define Build/InstallDev $(INSTALL_DIR) $(1)/usr/bin @@ -96,6 +101,12 @@ define Build/InstallDev $(INSTALL_DATA) \ $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \ $(1)/usr/lib/pkgconfig + $(foreach BIN,glib_genmarshal glib_mkenums, + $(SED) 's/^$(BIN)=$$$${bindir}\/\(.*\)/$(BIN)=$$$${prefix_hostpkg}\/bin\/\1/' $(1)/usr/lib/pkgconfig/glib-2.0.pc + ) + $(foreach BIN,glib_compile_resources glib_compile_schemas gdbus_codegen, + $(SED) 's/^$(BIN)=$$$${bindir}\/\(.*\)/$(BIN)=$$$${prefix_hostpkg}\/bin\/\1/' $(1)/usr/lib/pkgconfig/gio-2.0.pc + ) $(INSTALL_DIR) $(2)/share/aclocal/ $(INSTALL_DATA) \ diff --git a/libs/glib2/patches/003-valgrind.h-mips16-fix.patch b/libs/glib2/patches/003-valgrind.h-mips16-fix.patch index d0c5c80394..ca35972b74 100644 --- a/libs/glib2/patches/003-valgrind.h-mips16-fix.patch +++ b/libs/glib2/patches/003-valgrind.h-mips16-fix.patch @@ -1,6 +1,6 @@ --- a/glib/valgrind.h +++ b/glib/valgrind.h -@@ -158,7 +158,7 @@ +@@ -159,7 +159,7 @@ # define PLAT_s390x_linux 1 #elif defined(__linux__) && defined(__mips__) && (__mips==64) # define PLAT_mips64_linux 1 diff --git a/libs/glib2/patches/006-c99.patch b/libs/glib2/patches/006-c99.patch index de348d3850..98c17db0f2 100644 --- a/libs/glib2/patches/006-c99.patch +++ b/libs/glib2/patches/006-c99.patch @@ -1,6 +1,6 @@ --- a/meson.build +++ b/meson.build -@@ -1045,7 +1045,7 @@ if host_system == 'windows' and (cc.get_ +@@ -1189,7 +1189,7 @@ if host_system == 'windows' and (cc.get_ glib_conf.set('HAVE_C99_SNPRINTF', false) glib_conf.set('HAVE_C99_VSNPRINTF', false) glib_conf.set('HAVE_UNIX98_PRINTF', false) diff --git a/libs/glib2/patches/010-pcre.patch b/libs/glib2/patches/010-pcre.patch deleted file mode 100644 index 87b32e73e9..0000000000 --- a/libs/glib2/patches/010-pcre.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/glib/meson.build -+++ b/glib/meson.build -@@ -365,6 +365,7 @@ pcre2_static_args = [] - - if use_pcre2_static_flag - pcre2_static_args = ['-DPCRE2_STATIC'] -+ pcre2 = pcre2.as_link_whole() - endif - - glib_c_args = ['-DG_LOG_DOMAIN="GLib"', '-DGLIB_COMPILATION'] + pcre2_static_args + glib_hidden_visibility_args diff --git a/libs/glib2/patches/020-locale.patch b/libs/glib2/patches/020-locale.patch deleted file mode 100644 index e171d58e13..0000000000 --- a/libs/glib2/patches/020-locale.patch +++ /dev/null @@ -1,24 +0,0 @@ -From ebcc3c01db27b79af38b42c3c52a79d0225f744c Mon Sep 17 00:00:00 2001 -From: Seungha Yang -Date: Sun, 14 Aug 2022 04:56:20 +0900 -Subject: [PATCH] glib-mkenums: Specify output encoding as UTF-8 explicitly for - non-English locale - -Fixup regression introduced by -https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2797 ---- - gobject/glib-mkenums.in | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/gobject/glib-mkenums.in -+++ b/gobject/glib-mkenums.in -@@ -19,6 +19,9 @@ import errno - import codecs - import locale - -+# Non-english locale systems might complain to unrecognized character -+sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding='utf-8') -+ - VERSION_STR = '''glib-mkenums version @VERSION@ - glib-mkenums comes with ABSOLUTELY NO WARRANTY. - You may redistribute copies of glib-mkenums under the terms of From 5c4514c60068ebb5d65869e44b7d9480b96a0e9e Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 4 Dec 2024 14:05:11 +0800 Subject: [PATCH 40/88] zmq: update to 4.3.5 --- libs/zmq/Makefile | 6 +- ... 010-fix-openpgm-linking-for-zeromq.patch} | 6 +- libs/zmq/patches/020-no-libbsd.patch | 127 ++---------------- 3 files changed, 14 insertions(+), 125 deletions(-) rename libs/zmq/patches/{0001-fix-openpgm-linking-for-zeromq.patch => 010-fix-openpgm-linking-for-zeromq.patch} (92%) diff --git a/libs/zmq/Makefile b/libs/zmq/Makefile index 25266b981d..c9dccd0a7b 100644 --- a/libs/zmq/Makefile +++ b/libs/zmq/Makefile @@ -10,12 +10,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zeromq -PKG_VERSION:=4.3.4 -PKG_RELEASE:=3 +PKG_VERSION:=4.3.5 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/zeromq/libzmq/releases/download/v$(PKG_VERSION) -PKG_HASH:=c593001a89f5a85dd2ddf564805deb860e02471171b3f204944857336295c3e5 +PKG_HASH:=6653ef5910f17954861fe72332e68b03ca6e4d9c7160eb3a8de5a5a913bfab43 PKG_MAINTAINER:=Dirk Chang PKG_LICENSE:=GPL-3.0-or-later diff --git a/libs/zmq/patches/0001-fix-openpgm-linking-for-zeromq.patch b/libs/zmq/patches/010-fix-openpgm-linking-for-zeromq.patch similarity index 92% rename from libs/zmq/patches/0001-fix-openpgm-linking-for-zeromq.patch rename to libs/zmq/patches/010-fix-openpgm-linking-for-zeromq.patch index c699aa2abc..2fc711bdf4 100644 --- a/libs/zmq/patches/0001-fix-openpgm-linking-for-zeromq.patch +++ b/libs/zmq/patches/010-fix-openpgm-linking-for-zeromq.patch @@ -9,7 +9,7 @@ Subject: [PATCH] fix-openpgm-linking-for-zeromq --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -793,7 +793,7 @@ else() +@@ -809,7 +809,7 @@ else() # message(FATAL_ERROR "WITH_OPENPGM not implemented") if(NOT OPENPGM_PKGCONFIG_NAME) @@ -18,7 +18,7 @@ Subject: [PATCH] fix-openpgm-linking-for-zeromq endif() set(OPENPGM_PKGCONFIG_NAME -@@ -804,6 +804,8 @@ else() +@@ -820,6 +820,8 @@ else() if(OPENPGM_FOUND) message(STATUS ${OPENPGM_PKGCONFIG_NAME}" found") @@ -27,7 +27,7 @@ Subject: [PATCH] fix-openpgm-linking-for-zeromq set(pkg_config_names_private "${pkg_config_names_private} ${OPENPGM_PKGCONFIG_NAME}") else() message( -@@ -1447,6 +1449,10 @@ if(BUILD_SHARED) +@@ -1494,6 +1496,10 @@ if(BUILD_SHARED) endif() endif() diff --git a/libs/zmq/patches/020-no-libbsd.patch b/libs/zmq/patches/020-no-libbsd.patch index 0ed003945e..641b69b6e5 100644 --- a/libs/zmq/patches/020-no-libbsd.patch +++ b/libs/zmq/patches/020-no-libbsd.patch @@ -7,38 +7,13 @@ libbsd is only used once and as part of a larger, incorrect function. I rewrote the code that used it without the need for it. --- CMakeLists.txt | 41 ++++++----------------------- - Makefile.am | 12 ++++----- builds/cmake/platform.hpp.in | 2 -- - configure.ac | 39 +-------------------------- - packaging/debian/control | 2 -- - packaging/debian/zeromq.dsc | 2 +- - packaging/redhat/zeromq.spec | 2 +- src/compat.hpp | 51 +++++++++++++++++++++++------------- 8 files changed, 50 insertions(+), 101 deletions(-) --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -240,19 +240,6 @@ if(NOT ZMQ_USE_GNUTLS) - endif() - endif() - --if(NOT MSVC) -- option(WITH_LIBBSD "Use libbsd instead of builtin strlcpy" ON) -- if(WITH_LIBBSD) -- pkg_check_modules(LIBBSD "libbsd") -- if(LIBBSD_FOUND) -- message(STATUS "Using libbsd") -- set(pkg_config_names_private "${pkg_config_names_private} libbsd") -- set(ZMQ_HAVE_LIBBSD 1) -- endif() -- endif() -- check_cxx_symbol_exists(strlcpy string.h ZMQ_HAVE_STRLCPY) --endif() -- - # Select curve encryption library, defaults to tweetnacl To use libsodium instead, use --with-libsodium(must be - # installed) To disable curve, use --disable-curve - -@@ -1437,10 +1424,6 @@ if(BUILD_SHARED) +@@ -1484,10 +1484,6 @@ if(BUILD_SHARED) target_link_libraries(libzmq ${NSS3_LIBRARIES}) endif() @@ -49,8 +24,8 @@ I rewrote the code that used it without the need for it. if(SODIUM_FOUND) target_link_libraries(libzmq ${SODIUM_LIBRARIES}) # On Solaris, libsodium depends on libssp -@@ -1482,10 +1465,6 @@ if(BUILD_STATIC) - target_link_libraries(libzmq-static ${GNUTLS_LIBRARIES}) +@@ -1534,10 +1530,6 @@ if(BUILD_STATIC) + target_include_directories(libzmq-static PRIVATE "${GNUTLS_INCLUDE_DIR}") endif() - if(LIBBSD_FOUND) @@ -60,8 +35,8 @@ I rewrote the code that used it without the need for it. if(NSS3_FOUND) target_link_libraries(libzmq-static ${NSS3_LIBRARIES}) endif() -@@ -1550,10 +1529,6 @@ if(BUILD_SHARED) - target_link_libraries(${perf-tool} ${GNUTLS_LIBRARIES}) +@@ -1607,10 +1599,6 @@ if(BUILD_SHARED) + target_include_directories(${perf-tool} PRIVATE "${GNUTLS_INCLUDE_DIR}") endif() - if(LIBBSD_FOUND) @@ -71,40 +46,9 @@ I rewrote the code that used it without the need for it. if(NSS3_FOUND) target_link_libraries(${perf-tool} ${NSS3_LIBRARIES}) endif() ---- a/Makefile.am -+++ b/Makefile.am -@@ -351,11 +351,11 @@ if HAVE_VSCRIPT_COMPLEX - src_libzmq_la_LDFLAGS += $(VSCRIPT_LDFLAGS),$(srcdir)/src/libzmq.vers - endif - --src_libzmq_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) $(LIBUNWIND_CFLAGS) $(LIBBSD_CFLAGS) --src_libzmq_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(LIBUNWIND_CFLAGS) $(LIBBSD_CFLAGS) -+src_libzmq_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) $(LIBUNWIND_CFLAGS) -+src_libzmq_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(LIBUNWIND_CFLAGS) - src_libzmq_la_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@ $(CODE_COVERAGE_CXXFLAGS) \ -- $(LIBUNWIND_CFLAGS) $(LIBBSD_CFLAGS) --src_libzmq_la_LIBADD = $(CODE_COVERAGE_LDFLAGS) $(LIBUNWIND_LIBS) $(LIBBSD_LIBS) -+ $(LIBUNWIND_CFLAGS) -+src_libzmq_la_LIBADD = $(CODE_COVERAGE_LDFLAGS) $(LIBUNWIND_LIBS) - - if USE_NSS - src_libzmq_la_CPPFLAGS += ${NSS3_CFLAGS} -@@ -849,10 +849,10 @@ tests_test_security_curve_SOURCES += \ - endif - - tests_test_security_curve_LDADD = \ -- ${TESTUTIL_LIBS} src/libzmq.la $(LIBUNWIND_LIBS) $(LIBBSD_LIBS) -+ ${TESTUTIL_LIBS} src/libzmq.la $(LIBUNWIND_LIBS) - tests_test_security_curve_CPPFLAGS = \ - ${TESTUTIL_CPPFLAGS} \ -- ${LIBUNWIND_CFLAGS} ${LIBBSD_CFLAGS} -+ ${LIBUNWIND_CFLAGS} - - if USE_LIBSODIUM - tests_test_security_curve_CPPFLAGS += \ --- a/builds/cmake/platform.hpp.in +++ b/builds/cmake/platform.hpp.in -@@ -52,8 +52,6 @@ +@@ -56,8 +56,6 @@ #cmakedefine ZMQ_HAVE_PTHREAD_SET_AFFINITY #cmakedefine HAVE_ACCEPT4 #cmakedefine HAVE_STRNLEN @@ -112,65 +56,10 @@ I rewrote the code that used it without the need for it. -#cmakedefine ZMQ_HAVE_LIBBSD #cmakedefine ZMQ_HAVE_IPC - ---- a/configure.ac -+++ b/configure.ac -@@ -12,7 +12,7 @@ AC_CONFIG_AUX_DIR(config) - AC_CONFIG_MACRO_DIR(config) - AC_CONFIG_HEADERS([src/platform.hpp]) - AM_INIT_AUTOMAKE(foreign subdir-objects tar-ustar dist-zip) --# Allow "configure --disable-maintainer-mode" to disable timestamp checking -+# Allow "configure --disable-maintainer-mode" to disable timestamp checking - AM_MAINTAINER_MODE([enable]) - - m4_pattern_allow([AC_PROG_CC_C99]) -@@ -806,43 +806,6 @@ AC_COMPILE_IFELSE( - ],[ - AC_MSG_RESULT([no]) - ]) -- --AC_ARG_ENABLE([libbsd], -- [AS_HELP_STRING([--enable-libbsd], -- [enable libbsd [default=auto]])], -- [enable_libbsd=$enableval], -- [enable_libbsd="auto"]) -- --if test "x$enable_libbsd" != "xno"; then -- PKG_CHECK_MODULES(LIBBSD, [libbsd], -- [ -- AC_DEFINE(ZMQ_HAVE_LIBBSD, 1, [The libbsd library is to be used]) -- AC_SUBST([LIBBSD_CFLAGS]) -- AC_SUBST([LIBBSD_LIBS]) -- PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE libbsd" -- found_libbsd="yes" -- ], -- [ -- found_libbsd="no" -- if test "x$enable_libbsd" = "xyes"; then -- AC_MSG_ERROR([Cannot find libbsd]) -- else -- AC_MSG_WARN([Cannot find libbsd]) -- fi -- ]) --fi --AC_MSG_CHECKING([whether strlcpy is available]) --AC_COMPILE_IFELSE( -- [AC_LANG_PROGRAM( -- [[#include ]], -- [[char buf [100]; size_t bar = strlcpy (buf, "foo", 100); (void)bar; return 0;]]) -- ],[ -- AC_MSG_RESULT([yes]) -- AC_DEFINE(ZMQ_HAVE_STRLCPY, [1], -- [strlcpy is available]) -- ],[ -- AC_MSG_RESULT([no]) --]) - - # pthread_setname is non-posix, and there are at least 4 different implementations - AC_MSG_CHECKING([whether signature of pthread_setname_np() has 1 argument]) + #cmakedefine ZMQ_HAVE_STRUCT_SOCKADDR_UN --- a/src/compat.hpp +++ b/src/compat.hpp -@@ -37,26 +37,41 @@ +@@ -10,26 +10,41 @@ #define strcasecmp _stricmp #define strtok_r strtok_s #else From 45df3bee2ce14d3050e45a26daac166ae233da3c Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 4 Dec 2024 18:07:14 +0800 Subject: [PATCH 41/88] Revert "libs/glib2: update to 2.82.0" This reverts commit 33b43c290ae25ebfc14053d6764547b2449abb5d. --- libs/glib2/Makefile | 59 ++++++++----------- .../patches/003-valgrind.h-mips16-fix.patch | 2 +- libs/glib2/patches/006-c99.patch | 2 +- libs/glib2/patches/010-pcre.patch | 10 ++++ libs/glib2/patches/020-locale.patch | 24 ++++++++ 5 files changed, 60 insertions(+), 37 deletions(-) create mode 100644 libs/glib2/patches/010-pcre.patch create mode 100644 libs/glib2/patches/020-locale.patch diff --git a/libs/glib2/Makefile b/libs/glib2/Makefile index a24a2f3450..5ded2fbddf 100644 --- a/libs/glib2/Makefile +++ b/libs/glib2/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=glib2 -PKG_VERSION:=2.82.0 -PKG_RELEASE:=1 +PKG_VERSION:=2.74.0 +PKG_RELEASE:=5 PKG_SOURCE:=glib-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNOME/glib/$(basename $(PKG_VERSION)) -PKG_HASH:=f4c82ada51366bddace49d7ba54b33b4e4d6067afa3008e4847f41cb9b5c38d3 +PKG_HASH:=3652c7f072d7b031a6b5edd623f77ebc5dcd2ae698598abcc89ff39ca75add30 PKG_MAINTAINER:=Peter Wagner PKG_LICENSE:=LGPL-2.1-or-later @@ -26,7 +26,7 @@ PKG_FORTIFY_SOURCE:=0 PKG_BUILD_FLAGS:=gc-sections HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/glib-$(PKG_VERSION) -HOST_BUILD_DEPENDS:=pcre2/host libffi/host libiconv-full/host +HOST_BUILD_DEPENDS:=pcre2/host libffi/host include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk @@ -45,31 +45,26 @@ define Package/glib2/description The GLib library of C routines endef -COMP_ARGS:= - -# default feature=auto see meson_options.txt -COMP_ARGS+=-Dglib_debug=disabled - -# default feature=auto see meson_options.txt -COMP_ARGS+=-Dlibmount=disabled - -# default feature=auto see meson_options.txt -COMP_ARGS+=-Dselinux=disabled - -# default boolean=true see meson_options.txt -COMP_ARGS+=-Dglib_assert=false - -# default boolean=true see meson_options.txt -COMP_ARGS+=-Dtests=false - -# default feature=auto see meson_options.txt -COMP_ARGS+=-Dintrospection=disabled - -# set runtime dir to /var/run -COMP_ARGS+=-Druntime_dir=/var/run - -MESON_HOST_ARGS += $(COMP_ARGS) -Dxattr=false -Dnls=disabled -MESON_ARGS += $(COMP_ARGS) -Dxattr=true -Db_lto=true -Dnls=$(if $(CONFIG_BUILD_NLS),en,dis)abled +COMP_ARGS= \ + -Dselinux=disabled \ + -Dlibmount=disabled \ + -Dman=false \ + -Ddtrace=false \ + -Dsystemtap=false \ + -Dsysprof=disabled \ + -Dgtk_doc=false \ + -Dbsymbolic_functions=true \ + -Dforce_posix_threads=true \ + -Dtests=false \ + -Dinstalled_tests=false \ + -Doss_fuzz=disabled \ + -Dglib_debug=disabled \ + -Dglib_assert=false \ + -Dglib_checks=true \ + -Dlibelf=disabled + +MESON_HOST_ARGS += $(COMP_ARGS) -Dxattr=false -Ddefault_library=static -Dnls=disabled +MESON_ARGS += $(COMP_ARGS) -Dxattr=true -Db_lto=true -Ddefault_library=both -Dnls=$(if $(CONFIG_BUILD_NLS),en,dis)abled define Build/InstallDev $(INSTALL_DIR) $(1)/usr/bin @@ -101,12 +96,6 @@ define Build/InstallDev $(INSTALL_DATA) \ $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \ $(1)/usr/lib/pkgconfig - $(foreach BIN,glib_genmarshal glib_mkenums, - $(SED) 's/^$(BIN)=$$$${bindir}\/\(.*\)/$(BIN)=$$$${prefix_hostpkg}\/bin\/\1/' $(1)/usr/lib/pkgconfig/glib-2.0.pc - ) - $(foreach BIN,glib_compile_resources glib_compile_schemas gdbus_codegen, - $(SED) 's/^$(BIN)=$$$${bindir}\/\(.*\)/$(BIN)=$$$${prefix_hostpkg}\/bin\/\1/' $(1)/usr/lib/pkgconfig/gio-2.0.pc - ) $(INSTALL_DIR) $(2)/share/aclocal/ $(INSTALL_DATA) \ diff --git a/libs/glib2/patches/003-valgrind.h-mips16-fix.patch b/libs/glib2/patches/003-valgrind.h-mips16-fix.patch index ca35972b74..d0c5c80394 100644 --- a/libs/glib2/patches/003-valgrind.h-mips16-fix.patch +++ b/libs/glib2/patches/003-valgrind.h-mips16-fix.patch @@ -1,6 +1,6 @@ --- a/glib/valgrind.h +++ b/glib/valgrind.h -@@ -159,7 +159,7 @@ +@@ -158,7 +158,7 @@ # define PLAT_s390x_linux 1 #elif defined(__linux__) && defined(__mips__) && (__mips==64) # define PLAT_mips64_linux 1 diff --git a/libs/glib2/patches/006-c99.patch b/libs/glib2/patches/006-c99.patch index 98c17db0f2..de348d3850 100644 --- a/libs/glib2/patches/006-c99.patch +++ b/libs/glib2/patches/006-c99.patch @@ -1,6 +1,6 @@ --- a/meson.build +++ b/meson.build -@@ -1189,7 +1189,7 @@ if host_system == 'windows' and (cc.get_ +@@ -1045,7 +1045,7 @@ if host_system == 'windows' and (cc.get_ glib_conf.set('HAVE_C99_SNPRINTF', false) glib_conf.set('HAVE_C99_VSNPRINTF', false) glib_conf.set('HAVE_UNIX98_PRINTF', false) diff --git a/libs/glib2/patches/010-pcre.patch b/libs/glib2/patches/010-pcre.patch new file mode 100644 index 0000000000..87b32e73e9 --- /dev/null +++ b/libs/glib2/patches/010-pcre.patch @@ -0,0 +1,10 @@ +--- a/glib/meson.build ++++ b/glib/meson.build +@@ -365,6 +365,7 @@ pcre2_static_args = [] + + if use_pcre2_static_flag + pcre2_static_args = ['-DPCRE2_STATIC'] ++ pcre2 = pcre2.as_link_whole() + endif + + glib_c_args = ['-DG_LOG_DOMAIN="GLib"', '-DGLIB_COMPILATION'] + pcre2_static_args + glib_hidden_visibility_args diff --git a/libs/glib2/patches/020-locale.patch b/libs/glib2/patches/020-locale.patch new file mode 100644 index 0000000000..e171d58e13 --- /dev/null +++ b/libs/glib2/patches/020-locale.patch @@ -0,0 +1,24 @@ +From ebcc3c01db27b79af38b42c3c52a79d0225f744c Mon Sep 17 00:00:00 2001 +From: Seungha Yang +Date: Sun, 14 Aug 2022 04:56:20 +0900 +Subject: [PATCH] glib-mkenums: Specify output encoding as UTF-8 explicitly for + non-English locale + +Fixup regression introduced by +https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2797 +--- + gobject/glib-mkenums.in | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/gobject/glib-mkenums.in ++++ b/gobject/glib-mkenums.in +@@ -19,6 +19,9 @@ import errno + import codecs + import locale + ++# Non-english locale systems might complain to unrecognized character ++sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding='utf-8') ++ + VERSION_STR = '''glib-mkenums version @VERSION@ + glib-mkenums comes with ABSOLUTELY NO WARRANTY. + You may redistribute copies of glib-mkenums under the terms of From d2a80288518836e3df1d3732fb2e37007c3daa94 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 4 Dec 2024 19:27:14 +0800 Subject: [PATCH 42/88] xupnpd: ignore init script install --- multimedia/xupnpd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/xupnpd/Makefile b/multimedia/xupnpd/Makefile index bfc0045378..bf66b79418 100644 --- a/multimedia/xupnpd/Makefile +++ b/multimedia/xupnpd/Makefile @@ -59,7 +59,7 @@ define Package/xupnpd/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/xupnpd $(1)/usr/bin $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/xupnpd.init $(1)/etc/init.d/xupnpd +# $(INSTALL_BIN) ./files/xupnpd.init $(1)/etc/init.d/xupnpd $(INSTALL_DIR) $(1)/usr/share/xupnpd $(CP) $(PKG_BUILD_DIR)/src/*.lua $(1)/usr/share/xupnpd $(INSTALL_DIR) $(1)/usr/share/xupnpd/ui From d2dcd551a867e523236c2c1a718183df1098c6fa Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 4 Dec 2024 21:22:54 +0800 Subject: [PATCH 43/88] libtins: update to 4.5 --- libs/libtins/Makefile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libs/libtins/Makefile b/libs/libtins/Makefile index 11b7c2f11e..34a1f9b114 100644 --- a/libs/libtins/Makefile +++ b/libs/libtins/Makefile @@ -8,18 +8,20 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libtins -PKG_VERSION:=4.4 -PKG_RELEASE:=$(AUTORELEASE) +PKG_VERSION:=4.5 +PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://codeload.github.com/mfontanini/libtins/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=ff0121b4ec070407e29720c801b7e1a972042300d37560a62c57abadc9635634 +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=v$(PKG_VERSION) +PKG_SOURCE_URL:=https://github.com/mfontanini/libtins +PKG_MIRROR_HASH:=85c5a15beca56552ba3f33e10f2a82ee4c47be2b3334d163304362188a37b13a PKG_MAINTAINER:= Steven Hessing PKG_LICENSE:=BSD-2-Clause PKG_LICENSE_FILES:=LICENSE CMAKE_INSTALL:=1 +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -52,8 +54,7 @@ CMAKE_OPTIONS += \ -DLIBTINS_ENABLE_TCP_STREAM_CUSTOM_DATA=$(if $(CONFIG_LIBTINS_ENABLE_TCP_STREAM_CUSTOM_DATA),ON,OFF) \ -DLIBTINS_ENABLE_WPA2=$(if $(CONFIG_LIBTINS_ENABLE_WPA2),ON,OFF) -TARGET_CXXFLAGS += -ffunction-sections -fdata-sections -flto -TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed +TARGET_LDFLAGS += -Wl,--as-needed define Package/libtins/install $(INSTALL_DIR) $(1)/usr/lib From eac3fc6c2411ecb2e05ef2df68329c88d49d61d8 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 4 Dec 2024 21:24:13 +0800 Subject: [PATCH 44/88] php7: drop package --- lang/php7-pecl-swoole/Makefile | 38 - lang/php7-pecl-yaf/Makefile | 30 - lang/php7/Makefile | 668 ------------------ lang/php7/files/php.ini | 134 ---- lang/php7/files/php7-fastcgi.config | 3 - lang/php7/files/php7-fastcgi.init | 29 - lang/php7/files/php7-fpm-www.conf | 392 ---------- lang/php7/files/php7-fpm.conf | 121 ---- lang/php7/files/php7-fpm.config | 2 - lang/php7/files/php7-fpm.init | 28 - ...-use-of-the-system-timezone-database.patch | 665 ----------------- .../patches/0032-Use-system-timezone.patch | 41 -- ...ove-build-timestamps-from-generated-.patch | 102 --- ...ation-icon-to-not-expose-the-reader-.patch | 23 - .../0050-remove-build-timestamps.patch | 28 - ...xt-opcache-fix-detection-of-shm-mmap.patch | 46 -- .../patches/1004-disable-phar-command.patch | 32 - lang/php7/pecl.mk | 52 -- lang/php7/test.sh | 23 - 19 files changed, 2457 deletions(-) delete mode 100644 lang/php7-pecl-swoole/Makefile delete mode 100644 lang/php7-pecl-yaf/Makefile delete mode 100644 lang/php7/Makefile delete mode 100644 lang/php7/files/php.ini delete mode 100644 lang/php7/files/php7-fastcgi.config delete mode 100644 lang/php7/files/php7-fastcgi.init delete mode 100644 lang/php7/files/php7-fpm-www.conf delete mode 100644 lang/php7/files/php7-fpm.conf delete mode 100644 lang/php7/files/php7-fpm.config delete mode 100644 lang/php7/files/php7-fpm.init delete mode 100644 lang/php7/patches/0013-Add-support-for-use-of-the-system-timezone-database.patch delete mode 100644 lang/php7/patches/0032-Use-system-timezone.patch delete mode 100644 lang/php7/patches/0041-Add-patch-to-remove-build-timestamps-from-generated-.patch delete mode 100644 lang/php7/patches/0042-Remove-W3C-validation-icon-to-not-expose-the-reader-.patch delete mode 100644 lang/php7/patches/0050-remove-build-timestamps.patch delete mode 100644 lang/php7/patches/1001-ext-opcache-fix-detection-of-shm-mmap.patch delete mode 100644 lang/php7/patches/1004-disable-phar-command.patch delete mode 100644 lang/php7/pecl.mk delete mode 100644 lang/php7/test.sh diff --git a/lang/php7-pecl-swoole/Makefile b/lang/php7-pecl-swoole/Makefile deleted file mode 100644 index 0d1e668989..0000000000 --- a/lang/php7-pecl-swoole/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PECL_NAME:=swoole -PECL_LONGNAME:=Bindings for the libswoole library - -PKG_VERSION:=4.8.12 -PKG_RELEASE:=1 -PKG_HASH:=0a0b844992d26c974957749ada86a9ff7a88daa512b7255db4fc41afa062f4a4 - -PKG_NAME:=php7-pecl-$(PECL_NAME) -PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz -PKG_SOURCE_URL:=http://pecl.php.net/get/ -PKG_MAINTAINER:=Lean -PKG_LICENSE:=Apache2.0 -PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_DEPENDS:=php7 -PKG_BUILD_DIR:=$(BUILD_DIR)/pecl-php7/$(PECL_NAME)-$(PKG_VERSION) -PKG_BUILD_PARALLEL:=1 - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/nls.mk -include $(TOPDIR)/feeds/packages/lang/php7/pecl.mk - - -# CONFIGURE_ARGS+= \ -# --enable-openssl \ -# --enable-http2 \ -# --enable-sockets \ -# --enable-debug \ -# --enable-debug-log - -$(eval $(call PHP7PECLPackage,$(PECL_NAME),$(PECL_LONGNAME),+libstdcpp,15)) -$(eval $(call BuildPackage,$(PKG_NAME))) \ No newline at end of file diff --git a/lang/php7-pecl-yaf/Makefile b/lang/php7-pecl-yaf/Makefile deleted file mode 100644 index ac786ba68b..0000000000 --- a/lang/php7-pecl-yaf/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PECL_NAME:=yaf -PECL_LONGNAME:=Yaf is a PHP framework similar to zend framework - -PKG_VERSION:=3.3.5 -PKG_RELEASE:=1 -PKG_HASH:=cbbe7f2abbd2bb93074c6749c40fe4b660846361c0d9e258eee2b4005f8ac620 - -PKG_NAME:=php7-pecl-$(PECL_NAME) -PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz -PKG_SOURCE_URL:=http://pecl.php.net/get/ -PKG_MAINTAINER:=Lean -PKG_LICENSE:=Apache2.0 -PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_DEPENDS:=php7 -PKG_BUILD_DIR:=$(BUILD_DIR)/pecl-php7/$(PECL_NAME)-$(PKG_VERSION) -PKG_BUILD_PARALLEL:=1 - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/nls.mk -include $(TOPDIR)/feeds/packages/lang/php7/pecl.mk - -$(eval $(call PHP7PECLPackage,$(PECL_NAME),$(PECL_LONGNAME),+libstdcpp,15)) -$(eval $(call BuildPackage,$(PKG_NAME))) \ No newline at end of file diff --git a/lang/php7/Makefile b/lang/php7/Makefile deleted file mode 100644 index b3cd36da40..0000000000 --- a/lang/php7/Makefile +++ /dev/null @@ -1,668 +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:=php -PKG_VERSION:=7.4.30 -PKG_RELEASE:=1 - -PKG_MAINTAINER:=Michael Heimpold -PKG_LICENSE:=PHP-3.01 -PKG_LICENSE_FILES:=LICENSE -PKG_CPE_ID:=cpe:/a:php:php - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=http://www.php.net/distributions/ -PKG_HASH:=ea72a34f32c67e79ac2da7dfe96177f3c451c3eefae5810ba13312ed398ba70d - -PKG_BUILD_PARALLEL:=1 -PKG_USE_MIPS16:=0 - -PHP7_MODULES= \ - bcmath \ - calendar ctype curl \ - dom \ - exif \ - fileinfo filter ftp \ - gettext gd gmp \ - iconv imap intl \ - json \ - ldap \ - mbstring mysqli mysqlnd \ - opcache openssl \ - pcntl pdo pdo-mysql pdo-pgsql pdo-sqlite pgsql phar \ - session shmop simplexml snmp soap sockets sqlite3 sysvmsg sysvsem sysvshm \ - tokenizer \ - xml xmlreader xmlwriter \ - zip - -PKG_CONFIG_DEPENDS:= \ - $(patsubst %,CONFIG_PACKAGE_php7-mod-%,$(PHP7_MODULES)) \ - CONFIG_PHP7_LIBXML CONFIG_PHP7_SYSTEMTZDATA - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/nls.mk - -define Package/php7/Default - SUBMENU:=PHP7 - SECTION:=lang - CATEGORY:=Languages - TITLE:=PHP7 Hypertext preprocessor - URL:=http://www.php.net/ - DEPENDS:=php7 -endef - -define Package/php7/Default/description - PHP is a widely-used general-purpose scripting language that is especially - suited for Web development and can be embedded into HTML. -endef - -define Package/php7/config - config PHP7_LIBXML - bool "PHP7 LIBXML support" - depends on PACKAGE_php7-cli || PACKAGE_php7-cgi - - config PHP7_SYSTEMTZDATA - bool "Use system timezone data instead of php's built-in database" - depends on PACKAGE_php7-cli || PACKAGE_php7-cgi - default y - help - Enabling this feature automatically selects the zoneinfo-core package - which contains data for UTC timezone. To use other timezones you have - to install the corresponding zoneinfo-... package(s). -endef - -define Package/php7 - $(call Package/php7/Default) - - DEPENDS:=+libpcre2 +zlib \ - +PHP7_LIBXML:libxml2 \ - +PHP7_SYSTEMTZDATA:zoneinfo-core -endef - -define Package/php7/description - $(call Package/php7/Default/description) - This package contains only the PHP config file. You must actually choose - your PHP flavour (cli, cgi or fastcgi). - - Please note, that installing php5 and php7 in parallel on the same target - is not supported in OpenWrt/LEDE. -endef - -define Package/php7-cli - $(call Package/php7/Default) - DEPENDS+= +PACKAGE_php7-mod-intl:libstdcpp - TITLE+= (CLI) -endef - -define Package/php7-cli/description - $(call Package/php7/Default/description) - This package contains the CLI version of the PHP7 interpreter. -endef - -define Package/php7-cgi - $(call Package/php7/Default) - DEPENDS+= +PACKAGE_php7-mod-intl:libstdcpp - TITLE+= (CGI & FastCGI) -endef - -define Package/php7-cgi/description - $(call Package/php7/Default/description) - This package contains the CGI version of the PHP7 interpreter. -endef - -define Package/php7-fastcgi - $(call Package/php7/Default) - DEPENDS+= +php7-cgi - TITLE:=FastCGI startup script -endef - -define Package/php7-fastcgi/description - As FastCGI support is now a core feature the php7-fastcgi package now depends - on the php7-cgi package, containing just the startup script. -endef - -define Package/php7-fpm - $(call Package/php7/Default) - DEPENDS+= +PACKAGE_php7-mod-intl:libstdcpp - TITLE+= (FPM) -endef - -define Package/php7-fpm/description - $(call Package/php7/Default/description) - This package contains the FastCGI Process Manager of the PHP7 interpreter. -endef - -define Package/php7-mod-intl/config - config PHP7_FULLICUDATA - bool "Add dependency to full ICU Data" - depends on PACKAGE_php7-mod-intl - default n -endef - -define Package/php7-mod-intl/description - Note that this package depends in ICU library which is built without data - by default. This is to satisfy programs build and run dependencies but to - keep the installed footprint small on the target system(s). - However, the data is required to make the ICU library useful - and thus - directly affects PHPs ICU extension, too - so consider to also - select/install package 'icu-full-data'. -endef - -# not everything groks --disable-nls -DISABLE_NLS:= - -CONFIGURE_ARGS+= \ - --enable-cli \ - --enable-cgi \ - --enable-fpm \ - --enable-shared \ - --disable-static \ - --with-pic \ - --disable-rpath \ - --disable-debug \ - --disable-phpdbg \ - --without-pear \ - \ - --with-config-file-path=/etc \ - --with-config-file-scan-dir=/etc/php7 \ - --disable-short-tags \ - \ - --without-valgrind \ - --with-external-pcre \ - --with-zlib="$(STAGING_DIR)/usr" - -ifeq ($(CONFIG_LIBC_USE_GLIBC),y) -TARGET_LDFLAGS += -ldl -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-bcmath),) - CONFIGURE_ARGS+= --enable-bcmath=shared -else - CONFIGURE_ARGS+= --disable-bcmath -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-calendar),) - CONFIGURE_ARGS+= --enable-calendar=shared -else - CONFIGURE_ARGS+= --disable-calendar -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ctype),) - CONFIGURE_ARGS+= --enable-ctype=shared -else - CONFIGURE_ARGS+= --disable-ctype -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-curl),) - CONFIGURE_ARGS+= --with-curl=shared -else - CONFIGURE_ARGS+= --without-curl -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-dom),) - CONFIGURE_ARGS+= --enable-dom=shared -else - CONFIGURE_ARGS+= --disable-dom -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-exif),) - CONFIGURE_ARGS+= --enable-exif=shared -else - CONFIGURE_ARGS+= --disable-exif -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-fileinfo),) - CONFIGURE_ARGS+= --enable-fileinfo=shared,"$(STAGING_DIR)/usr" -else - CONFIGURE_ARGS+= --disable-fileinfo -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-filter),) - CONFIGURE_ARGS+= --enable-filter=shared,"$(STAGING_DIR)/usr" -else - CONFIGURE_ARGS+= --disable-filter -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ftp),) - CONFIGURE_ARGS+= --enable-ftp=shared -else - CONFIGURE_ARGS+= --disable-ftp -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gd),) - CONFIGURE_ARGS+= \ - --enable-gd=shared,"$(STAGING_DIR)/usr" \ - --with-external-gd -else - CONFIGURE_ARGS+= --disable-gd -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gettext),) - CONFIGURE_ARGS+= --with-gettext=shared,"$(STAGING_DIR)/usr/lib/libintl-full" -else - CONFIGURE_ARGS+= --without-gettext -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gmp),) - CONFIGURE_ARGS+= --with-gmp=shared,"$(STAGING_DIR)/usr" -else - CONFIGURE_ARGS+= --without-gmp -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-iconv),) - ifeq ($(CONFIG_BUILD_NLS),y) - CONFIGURE_VARS+= iconv_impl_name="gnu_libiconv" - CONFIGURE_ARGS+= --with-iconv=shared,"$(ICONV_PREFIX)" - else - CONFIGURE_VARS+= ac_cv_func_iconv=yes - CONFIGURE_ARGS+= --with-iconv=shared - endif -else - CONFIGURE_ARGS+= --without-iconv -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-imap),) - CONFIGURE_ARGS+= \ - --with-imap=shared,"$(STAGING_DIR)/usr" \ - --with-kerberos=no \ - --with-imap-ssl="$(STAGING_DIR)/usr" -else - CONFIGURE_ARGS+= --without-imap -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-intl),) - CONFIGURE_ARGS+= --enable-intl=shared - TARGET_CXXFLAGS+= -std=c++0x -else - CONFIGURE_ARGS+= --disable-intl -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-json),) - CONFIGURE_ARGS+= --enable-json=shared -else - CONFIGURE_ARGS+= --disable-json -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ldap),) - CONFIGURE_ARGS+= \ - --with-ldap=shared,"$(STAGING_DIR)/usr" \ - --with-ldap-sasl -else - CONFIGURE_ARGS+= --without-ldap -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-mbstring),) - CONFIGURE_ARGS+= \ - --enable-mbstring=shared \ - --enable-mbregex -else - CONFIGURE_ARGS+= --disable-mbstring -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-mysqli),) - CONFIGURE_ARGS+= --with-mysqli=shared -else - CONFIGURE_ARGS+= --without-mysqli -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-mysqlnd),) - CONFIGURE_ARGS+= --enable-mysqlnd=shared -else - CONFIGURE_ARGS+= --disable-mysqlnd -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-opcache),) - CONFIGURE_ARGS+= --enable-opcache=shared -else - CONFIGURE_ARGS+= --disable-opcache -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-openssl)$(CONFIG_PACKAGE_php7-mod-ftp)$(CONFIG_PACKAGE_php7-mod-imap)$(CONFIG_PACKAGE_php7-mod-snmp),) - CONFIGURE_ARGS+= \ - --with-openssl=shared \ - --with-kerberos=no \ - --with-openssl-dir="$(STAGING_DIR)/usr" -else - CONFIGURE_ARGS+= --without-openssl -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pcntl),) - CONFIGURE_ARGS+= --enable-pcntl=shared -else - CONFIGURE_ARGS+= --disable-pcntl -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo),) - CONFIGURE_ARGS+= --enable-pdo=shared - ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-mysql),) - CONFIGURE_ARGS+= --with-pdo-mysql=shared - else - CONFIGURE_ARGS+= --without-pdo-mysql - endif - ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-pgsql),) - CONFIGURE_ARGS+= --with-pdo-pgsql=shared,"$(STAGING_DIR)/usr" - else - CONFIGURE_ARGS+= --without-pdo-pgsql - endif - ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-sqlite),) - CONFIGURE_ARGS+= --with-pdo-sqlite=shared - else - CONFIGURE_ARGS+= --without-pdo-sqlite - endif -else - CONFIGURE_ARGS+= --disable-pdo -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pgsql),) - CONFIGURE_ARGS+= --with-pgsql=shared,"$(STAGING_DIR)/usr" -else - CONFIGURE_ARGS+= --without-pgsql -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-phar),) - CONFIGURE_ARGS+= --enable-phar=shared -else - CONFIGURE_ARGS+= --disable-phar -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-session),) - CONFIGURE_ARGS+= --enable-session=shared -else - CONFIGURE_ARGS+= --disable-session -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-shmop),) - CONFIGURE_ARGS+= --enable-shmop=shared -else - CONFIGURE_ARGS+= --disable-shmop -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-simplexml),) - CONFIGURE_ARGS+= --enable-simplexml=shared -else - CONFIGURE_ARGS+= --disable-simplexml -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-snmp),) - CONFIGURE_ARGS+= --with-snmp=shared,"$(STAGING_DIR)/usr" -else - CONFIGURE_ARGS+= --without-snmp -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-soap),) - CONFIGURE_ARGS+= --enable-soap=shared -else - CONFIGURE_ARGS+= --disable-soap -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sockets),) - CONFIGURE_ARGS+= --enable-sockets=shared -else - CONFIGURE_ARGS+= --disable-sockets -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sqlite3),) - CONFIGURE_ARGS+= --with-sqlite3=shared -else - CONFIGURE_ARGS+= --without-sqlite3 -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvmsg),) - CONFIGURE_ARGS+= --enable-sysvmsg=shared -else - CONFIGURE_ARGS+= --disable-sysvmsg -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvsem),) - CONFIGURE_ARGS+= --enable-sysvsem=shared -else - CONFIGURE_ARGS+= --disable-sysvsem -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvshm),) - CONFIGURE_ARGS+= --enable-sysvshm=shared -else - CONFIGURE_ARGS+= --disable-sysvshm -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-tokenizer),) - CONFIGURE_ARGS+= --enable-tokenizer=shared -else - CONFIGURE_ARGS+= --disable-tokenizer -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xml),) - CONFIGURE_ARGS+= --enable-xml=shared,"$(STAGING_DIR)/usr" - ifneq ($(CONFIG_PHP7_LIBXML),y) - CONFIGURE_ARGS+= --with-expat - endif -else - CONFIGURE_ARGS+= --disable-xml -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xmlreader),) - CONFIGURE_ARGS+= --enable-xmlreader=shared,"$(STAGING_DIR)/usr" -else - CONFIGURE_ARGS+= --disable-xmlreader -endif - -ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xmlwriter),) - CONFIGURE_ARGS+= --enable-xmlwriter=shared,"$(STAGING_DIR)/usr" -else - CONFIGURE_ARGS+= --disable-xmlwriter -endif - -ifneq ($(CONFIG_PACKAGE_php7-mod-zip),) - CONFIGURE_ARGS+= --with-zip=shared,"$(STAGING_DIR)/usr" -else - CONFIGURE_ARGS+= --without-zip -endif - -ifneq ($(SDK)$(CONFIG_PHP7_LIBXML),) - CONFIGURE_ARGS+= --with-libxml -else - CONFIGURE_ARGS+= --without-libxml -endif - -ifneq ($(CONFIG_PHP7_SYSTEMTZDATA),) - CONFIGURE_ARGS+= --with-system-tzdata -else - CONFIGURE_ARGS+= --without-system-tzdata -endif - -CONFIGURE_VARS+= \ - ac_cv_c_bigendian_php=$(if $(CONFIG_BIG_ENDIAN),yes,no) \ - php_cv_cc_rpath="no" \ - ac_cv_php_xml2_config_path="$(STAGING_DIR)/host/bin/xml2-config" \ - ac_cv_u8t_decompose=yes \ - ac_cv_have_pcre2_jit=no - -define Package/php7/conffiles -/etc/php.ini -/etc/php7/ -endef - -define Package/php7/install - $(INSTALL_DIR) $(1)/etc - $(INSTALL_DATA) ./files/php.ini $(1)/etc/ -endef - -define Package/php7-cli/install - $(INSTALL_DIR) $(1)/usr/bin - $(CP) $(PKG_BUILD_DIR)/sapi/cli/php $(1)/usr/bin/php-cli -endef - -define Package/php7-cgi/install - $(INSTALL_DIR) $(1)/usr/bin - $(CP) $(PKG_BUILD_DIR)/sapi/cgi/php-cgi $(1)/usr/bin/php-cgi - ln -sf php-cgi $(1)/usr/bin/php-fcgi -endef - -define Package/php7-fastcgi/install - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_DATA) ./files/php7-fastcgi.config $(1)/etc/config/php7-fastcgi - - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/php7-fastcgi.init $(1)/etc/init.d/php7-fastcgi -endef - -define Package/php7-fastcgi/conffiles -/etc/config/php7-fastcgi -endef - -define Package/php7-fpm/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/sapi/fpm/php-fpm $(1)/usr/bin/php-fpm - - $(INSTALL_DIR) $(1)/etc - $(INSTALL_DATA) ./files/php7-fpm.conf $(1)/etc/php7-fpm.conf - - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_DATA) ./files/php7-fpm.config $(1)/etc/config/php7-fpm - - $(INSTALL_DIR) $(1)/etc/php7-fpm.d - $(INSTALL_DATA) ./files/php7-fpm-www.conf $(1)/etc/php7-fpm.d/www.conf - - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/php7-fpm.init $(1)/etc/init.d/php7-fpm -endef - -define Package/php7-fpm/conffiles -/etc/php7-fpm.conf -/etc/php7-fpm.d/ -/etc/config/php7-fpm -endef - -define Package/php7-mod-openssl/postinst -#!/bin/sh -[ -n "$$IPKG_INSTROOT" ] || { - if [ -e "/etc/php7/20_openssl.ini" ] && [ -e "/etc/php7/15_openssl.ini" ]; then - echo "Renaming PHP ini file '/etc/php7/20_openssl.ini' -> '/etc/php7/15_openssl.ini'" - mv /etc/php7/20_openssl.ini /etc/php7/15_openssl.ini - fi -} -endef - -define Package/php7-mod-mysqli/postinst -#!/bin/sh -[ -n "$$IPKG_INSTROOT" ] || { - if [ -e "/etc/php7/20_mysqli.ini" ] && [ -e "/etc/php7/30_mysqli.ini" ]; then - echo "Renaming PHP ini file '/etc/php7/20_mysqli.ini' -> '/etc/php7/30_mysqli.ini'" - mv /etc/php7/20_mysqli.ini /etc/php7/30_mysqli.ini - fi -} -endef - -define Build/Prepare - $(call Build/Prepare/Default) - $(if $(QUILT),,( cd $(PKG_BUILD_DIR); touch configure.ac; ./buildconf --force )) -endef - -define Build/Configure - $(if $(QUILT),( cd $(PKG_BUILD_DIR); touch configure.ac; ./buildconf --force )) - $(call Build/Configure/Default) -endef - -define Build/InstallDev - rm -rf $(PKG_BUILD_DIR)/staging - make -C $(PKG_BUILD_DIR) install INSTALL_ROOT=$(PKG_BUILD_DIR)/staging - rm -rf $(PKG_BUILD_DIR)/staging/usr/{share,man,sbin} - rm -f $(PKG_BUILD_DIR)/staging/usr/bin/{php,php-cgi,php-cli} - mv $(PKG_BUILD_DIR)/staging/usr/bin/phpize $(PKG_BUILD_DIR)/staging/usr/bin/phpize7 - mv $(PKG_BUILD_DIR)/staging/usr/bin/php-config $(PKG_BUILD_DIR)/staging/usr/bin/php7-config - mv $(PKG_BUILD_DIR)/staging/usr/include/php $(PKG_BUILD_DIR)/staging/usr/include/php7 - mv $(PKG_BUILD_DIR)/staging/usr/lib/php $(PKG_BUILD_DIR)/staging/usr/lib/php7 - - $(CP) $(PKG_BUILD_DIR)/staging/usr $(STAGING_DIR)/ - - sed -i -e "s#prefix='/usr'#prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize7 - sed -i -e "s#exec_prefix=\"\`eval echo /usr\`\"#exec_prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize7 - sed -i -e "s#/include\`/php\"#/include\`/php7\"#" $(STAGING_DIR)/usr/bin/phpize7 - sed -i -e "s#/lib/php\`/build\"#/lib/php7\`/build\"#" $(STAGING_DIR)/usr/bin/phpize7 - - sed -i -e "s#prefix=\"/usr\"#prefix=\"$(STAGING_DIR)/usr\"#" $(STAGING_DIR)/usr/bin/php7-config - sed -i -e "s#/include/php\"#/include/php7\"#" $(STAGING_DIR)/usr/bin/php7-config -endef - -define BuildModule - - define Package/php7-mod-$(1) - $(call Package/php7/Default) - - ifneq ($(3),) - DEPENDS+=$(3) - endif - - TITLE:=$(2) shared module - endef - - define Package/php7-mod-$(1)/install - $(INSTALL_DIR) $$(1)/usr/lib/php - $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php/ - $(INSTALL_DIR) $$(1)/etc/php7 - ifeq ($(5),zend) - echo "zend_extension=/usr/lib/php/$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini - else - echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini - endif - endef - - $$(eval $$(call BuildPackage,php7-mod-$(1))) - -endef - -$(eval $(call BuildPackage,php7)) -$(eval $(call BuildPackage,php7-cgi)) -$(eval $(call BuildPackage,php7-cli)) -$(eval $(call BuildPackage,php7-fastcgi)) -$(eval $(call BuildPackage,php7-fpm)) - -#$(eval $(call BuildModule,NAME,TITLE[,PKG DEPENDS])) -$(eval $(call BuildModule,bcmath,Bcmath)) -$(eval $(call BuildModule,calendar,Calendar)) -$(eval $(call BuildModule,ctype,Ctype)) -$(eval $(call BuildModule,curl,cURL,+PACKAGE_php7-mod-curl:libcurl)) -$(eval $(call BuildModule,dom,DOM,+@PHP7_LIBXML +PACKAGE_php7-mod-dom:libxml2)) -$(eval $(call BuildModule,exif,EXIF)) -$(eval $(call BuildModule,fileinfo,Fileinfo)) -$(eval $(call BuildModule,filter,Filter)) -$(eval $(call BuildModule,ftp,FTP,+PACKAGE_php7-mod-ftp:libopenssl)) -$(eval $(call BuildModule,gd,GD graphics,+PACKAGE_php7-mod-gd:libgd-full)) -$(eval $(call BuildModule,gettext,Gettext,+PACKAGE_php7-mod-gettext:libintl-full)) -$(eval $(call BuildModule,gmp,GMP,+PACKAGE_php7-mod-gmp:libgmp)) -$(eval $(call BuildModule,iconv,iConv,$(ICONV_DEPENDS))) -$(eval $(call BuildModule,imap,IMAP,+PACKAGE_php7-mod-imap:libopenssl +PACKAGE_libpam:libpam +PACKAGE_php7-mod-imap:uw-imap)) -$(eval $(call BuildModule,intl,Internationalization Functions,+PACKAGE_php7-mod-intl:icu +PHP7_FULLICUDATA:icu-full-data)) -$(eval $(call BuildModule,json,JSON)) -$(eval $(call BuildModule,ldap,LDAP,+PACKAGE_php7-mod-ldap:libopenldap +PACKAGE_php7-mod-ldap:libsasl2)) -$(eval $(call BuildModule,mbstring,MBString,+PACKAGE_php7-mod-mbstring:oniguruma)) -$(eval $(call BuildModule,mysqli,MySQL Improved Extension,+PACKAGE_php7-mod-mysqli:php7-mod-mysqlnd,30)) -$(eval $(call BuildModule,mysqlnd,MySQL Native Driver,+PACKAGE_php7-mod-openssl:php7-mod-openssl)) -$(eval $(call BuildModule,opcache,OPcache,,,zend)) -$(eval $(call BuildModule,openssl,OpenSSL,+PACKAGE_php7-mod-openssl:libopenssl,15)) -$(eval $(call BuildModule,pcntl,PCNTL)) -$(eval $(call BuildModule,pdo,PHP Data Objects)) -$(eval $(call BuildModule,pdo-mysql,PDO driver for MySQL,+php7-mod-pdo +PACKAGE_php7-mod-pdo-mysql:php7-mod-mysqlnd)) -$(eval $(call BuildModule,pdo-pgsql,PDO driver for PostgreSQL,+php7-mod-pdo +PACKAGE_php7-mod-pdo-pgsql:libpq)) -$(eval $(call BuildModule,pdo-sqlite,PDO driver for SQLite 3.x,+php7-mod-pdo +PACKAGE_php7-mod-pdo-sqlite:libsqlite3 +PACKAGE_php7-mod-pdo-sqlite:librt)) -$(eval $(call BuildModule,pgsql,PostgreSQL,+PACKAGE_php7-mod-pgsql:libpq)) -$(eval $(call BuildModule,phar,Phar Archives)) -$(eval $(call BuildModule,session,Session)) -$(eval $(call BuildModule,shmop,Shared Memory)) -$(eval $(call BuildModule,simplexml,SimpleXML,+@PHP7_LIBXML +PACKAGE_php7-mod-simplexml:libxml2)) -$(eval $(call BuildModule,snmp,SNMP,+PACKAGE_php7-mod-snmp:libnetsnmp +PACKAGE_php7-mod-snmp:libopenssl)) -$(eval $(call BuildModule,soap,SOAP,+@PHP7_LIBXML +PACKAGE_php7-mod-soap:libxml2)) -$(eval $(call BuildModule,sockets,Sockets)) -$(eval $(call BuildModule,sqlite3,SQLite3,+PACKAGE_php7-mod-sqlite3:libsqlite3)) -$(eval $(call BuildModule,sysvmsg,System V messages)) -$(eval $(call BuildModule,sysvsem,System V shared memory)) -$(eval $(call BuildModule,sysvshm,System V semaphore)) -$(eval $(call BuildModule,tokenizer,Tokenizer)) -$(eval $(call BuildModule,xml,XML,+PHP7_LIBXML:libxml2 +!PHP7_LIBXML:libexpat)) -$(eval $(call BuildModule,xmlreader,XMLReader,+@PHP7_LIBXML +PACKAGE_php7-mod-dom:php7-mod-dom +PACKAGE_php7-mod-xmlreader:libxml2)) -$(eval $(call BuildModule,xmlwriter,XMLWriter,+@PHP7_LIBXML +PACKAGE_php7-mod-xmlwriter:libxml2)) -$(eval $(call BuildModule,zip,ZIP,+PACKAGE_php7-mod-zip:libzip)) diff --git a/lang/php7/files/php.ini b/lang/php7/files/php.ini deleted file mode 100644 index b387c62e13..0000000000 --- a/lang/php7/files/php.ini +++ /dev/null @@ -1,134 +0,0 @@ -[PHP] - -;;;;;;;;;;;;;;;;;;;; -; Language Options ; -;;;;;;;;;;;;;;;;;;;; - -engine = On -;short_open_tag = Off -precision = 12 -output_buffering = Off -;output_handler = -zlib.output_compression = Off -;zlib.output_compression_level = -1 -;zlib.output_handler = -implicit_flush = Off -unserialize_callback_func = -;unserialize_max_depth = 4096 -serialize_precision = 100 -;open_basedir = -disable_functions = -disable_classes = -;highlight.string = #DD0000 -;highlight.comment = #FF9900 -;highlight.keyword = #007700 -;highlight.bg = #FFFFFF -;highlight.default = #0000BB -;highlight.html = #000000 -;ignore_user_abort = On -;realpath_cache_size = 16k -;realpath_cache_ttl = 120 -;zend.enable_gc = On -;zend.multibyte = Off -;zend.script_encoding = -;zend.exception_ignore_args = On - -;;;;;;;;;;;;;;;;; -; Miscellaneous ; -;;;;;;;;;;;;;;;;; - -expose_php = On - -;;;;;;;;;;;;;;;;;;; -; Resource Limits ; -;;;;;;;;;;;;;;;;;;; - -max_execution_time = 30 -max_input_time = 60 -;max_input_nesting_level = 64 -;max_input_vars = 1000 -memory_limit = 8M - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Error handling and logging ; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT -display_errors = On -display_startup_errors = Off -log_errors = Off -log_errors_max_len = 1024 -ignore_repeated_errors = Off -ignore_repeated_source = Off -report_memleaks = On -;report_zend_debug = 0 -track_errors = Off -;html_errors = Off -;docref_root = "/phpmanual/" -;docref_ext = .html -;error_prepend_string = "" -;error_append_string = "" -;error_log = syslog -;syslog.ident = php -;syslog.facility = user -;syslog.filter = ascii - -;;;;;;;;;;;;;;;;; -; Data Handling ; -;;;;;;;;;;;;;;;;; - -;arg_separator.output = "&" -;arg_separator.input = ";&" -variables_order = "EGPCS" -request_order = "GP" -register_argc_argv = On -auto_globals_jit = On -;enable_post_data_reading = Off -post_max_size = 8M -auto_prepend_file = -auto_append_file = -default_mimetype = "text/html" -;default_charset = "UTF-8" -;internal_encoding = -;input_encoding = -;output_encoding = - -;;;;;;;;;;;;;;;;;;;;;;;;; -; Paths and Directories ; -;;;;;;;;;;;;;;;;;;;;;;;;; - -;include_path = ".:/php/includes" -doc_root = "/www" -user_dir = -extension_dir = "/usr/lib/php" -;sys_temp_dir = "/tmp" -enable_dl = On -;cgi.force_redirect = 1 -;cgi.nph = 1 -;cgi.redirect_status_env = -cgi.fix_pathinfo = 1 -;cgi.discard_path = 1 -;fastcgi.impersonate = 1 -;fastcgi.logging = 0 -;cgi.rfc2616_headers = 0 -;cgi.check_shebang_line = 1 - -;;;;;;;;;;;;;;;; -; File Uploads ; -;;;;;;;;;;;;;;;; - -file_uploads = On -upload_tmp_dir = "/tmp" -upload_max_filesize = 2M -max_file_uploads = 20 - -;;;;;;;;;;;;;;;;;; -; Fopen wrappers ; -;;;;;;;;;;;;;;;;;; - -allow_url_fopen = On -allow_url_include = Off -;from = "john@doe.com" -;user_agent = "PHP" -default_socket_timeout = 60 -;auto_detect_line_endings = Off diff --git a/lang/php7/files/php7-fastcgi.config b/lang/php7/files/php7-fastcgi.config deleted file mode 100644 index 22e9998c06..0000000000 --- a/lang/php7/files/php7-fastcgi.config +++ /dev/null @@ -1,3 +0,0 @@ -config php7-fastcgi - option enabled 1 - option port '1026' diff --git a/lang/php7/files/php7-fastcgi.init b/lang/php7/files/php7-fastcgi.init deleted file mode 100644 index 6106b4f81b..0000000000 --- a/lang/php7/files/php7-fastcgi.init +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=50 - -SERVICE_DAEMONIZE=1 -SERVICE_WRITE_PID=1 - -start_instance() { - local section="$1" - local enabled - local port - - config_get_bool enabled "$section" 'enabled' 0 - config_get port "$section" 'port' - - [ $enabled -gt 0 ] || return 1 - - PHP_FCGI_CHILDREN='' \ - service_start /usr/bin/php-fcgi ${port:+-b $port} -} - -start() { - config_load 'php7-fastcgi' - config_foreach start_instance 'php7-fastcgi' -} - -stop() { - service_stop /usr/bin/php-fcgi -} diff --git a/lang/php7/files/php7-fpm-www.conf b/lang/php7/files/php7-fpm-www.conf deleted file mode 100644 index d3a32224f7..0000000000 --- a/lang/php7/files/php7-fpm-www.conf +++ /dev/null @@ -1,392 +0,0 @@ -; Start a new pool named 'www'. -; the variable $pool can we used in any directive and will be replaced by the -; pool name ('www' here) -[www] - -; Per pool prefix -; It only applies on the following directives: -; - 'slowlog' -; - 'listen' (unixsocket) -; - 'chroot' -; - 'chdir' -; - 'php_values' -; - 'php_admin_values' -; When not set, the global prefix (or /usr) applies instead. -; Note: This directive can also be relative to the global prefix. -; Default Value: none -;prefix = /path/to/pools/$pool - -; Unix user/group of processes -; Note: The user is mandatory. If the group is not set, the default user's group -; will be used. -user = nobody -;group = - -; The address on which to accept FastCGI requests. -; Valid syntaxes are: -; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on -; a specific port; -; 'port' - to listen on a TCP socket to all addresses on a -; specific port; -; '/path/to/unix/socket' - to listen on a unix socket. -; Note: This value is mandatory. -listen = /var/run/php7-fpm.sock - -; Set listen(2) backlog. -; Default Value: 128 (-1 on FreeBSD and OpenBSD) -;listen.backlog = 128 - -; Set permissions for unix socket, if one is used. In Linux, read/write -; permissions must be set in order to allow connections from a web server. Many -; BSD-derived systems allow connections regardless of permissions. -; Default Values: user and group are set as the running user -; mode is set to 0666 -;listen.owner = www-data -;listen.group = www-data -;listen.mode = 0666 - -; List of ipv4 addresses of FastCGI clients which are allowed to connect. -; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original -; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address -; must be separated by a comma. If this value is left blank, connections will be -; accepted from any ip address. -; Default Value: any -;listen.allowed_clients = 127.0.0.1 - -; Specify the nice(2) priority to apply to the pool processes (only if set) -; The value can vary from -19 (highest priority) to 20 (lower priority) -; Note: - It will only work if the FPM master process is launched as root -; - The pool processes will inherit the master process priority -; unless it specified otherwise -; Default Value: no set -; priority = -19 - -; Choose how the process manager will control the number of child processes. -; Possible Values: -; static - a fixed number (pm.max_children) of child processes; -; dynamic - the number of child processes are set dynamically based on the -; following directives. With this process management, there will be -; always at least 1 children. -; pm.max_children - the maximum number of children that can -; be alive at the same time. -; pm.start_servers - the number of children created on startup. -; pm.min_spare_servers - the minimum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is less than this -; number then some children will be created. -; pm.max_spare_servers - the maximum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is greater than this -; number then some children will be killed. -; ondemand - no children are created at startup. Children will be forked when -; new requests will connect. The following parameter are used: -; pm.max_children - the maximum number of children that -; can be alive at the same time. -; pm.process_idle_timeout - The number of seconds after which -; an idle process will be killed. -; Note: This value is mandatory. -pm = dynamic - -; The number of child processes to be created when pm is set to 'static' and the -; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. -; This value sets the limit on the number of simultaneous requests that will be -; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. -; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP -; CGI. The below defaults are based on a server without much resources. Don't -; forget to tweak pm.* to fit your needs. -; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' -; Note: This value is mandatory. -pm.max_children = 5 - -; The number of child processes created on startup. -; Note: Used only when pm is set to 'dynamic' -; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 -pm.start_servers = 2 - -; The desired minimum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.min_spare_servers = 1 - -; The desired maximum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.max_spare_servers = 3 - -; The number of seconds after which an idle process will be killed. -; Note: Used only when pm is set to 'ondemand' -; Default Value: 10s -;pm.process_idle_timeout = 10s; - -; The number of requests each child process should execute before respawning. -; This can be useful to work around memory leaks in 3rd party libraries. For -; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. -; Default Value: 0 -;pm.max_requests = 500 - -; The URI to view the FPM status page. If this value is not set, no URI will be -; recognized as a status page. It shows the following informations: -; pool - the name of the pool; -; process manager - static, dynamic or ondemand; -; start time - the date and time FPM has started; -; start since - number of seconds since FPM has started; -; accepted conn - the number of request accepted by the pool; -; listen queue - the number of request in the queue of pending -; connections (see backlog in listen(2)); -; max listen queue - the maximum number of requests in the queue -; of pending connections since FPM has started; -; listen queue len - the size of the socket queue of pending connections; -; idle processes - the number of idle processes; -; active processes - the number of active processes; -; total processes - the number of idle + active processes; -; max active processes - the maximum number of active processes since FPM -; has started; -; max children reached - number of times, the process limit has been reached, -; when pm tries to start more children (works only for -; pm 'dynamic' and 'ondemand'); -; Value are updated in real time. -; Example output: -; pool: www -; process manager: static -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 62636 -; accepted conn: 190460 -; listen queue: 0 -; max listen queue: 1 -; listen queue len: 42 -; idle processes: 4 -; active processes: 11 -; total processes: 15 -; max active processes: 12 -; max children reached: 0 -; -; By default the status page output is formatted as text/plain. Passing either -; 'html', 'xml' or 'json' in the query string will return the corresponding -; output syntax. Example: -; http://www.foo.bar/status -; http://www.foo.bar/status?json -; http://www.foo.bar/status?html -; http://www.foo.bar/status?xml -; -; By default the status page only outputs short status. Passing 'full' in the -; query string will also return status for each pool process. -; Example: -; http://www.foo.bar/status?full -; http://www.foo.bar/status?json&full -; http://www.foo.bar/status?html&full -; http://www.foo.bar/status?xml&full -; The Full status returns for each process: -; pid - the PID of the process; -; state - the state of the process (Idle, Running, ...); -; start time - the date and time the process has started; -; start since - the number of seconds since the process has started; -; requests - the number of requests the process has served; -; request duration - the duration in µs of the requests; -; request method - the request method (GET, POST, ...); -; request URI - the request URI with the query string; -; content length - the content length of the request (only with POST); -; user - the user (PHP_AUTH_USER) (or '-' if not set); -; script - the main script called (or '-' if not set); -; last request cpu - the %cpu the last request consumed -; it's always 0 if the process is not in Idle state -; because CPU calculation is done when the request -; processing has terminated; -; last request memory - the max amount of memory the last request consumed -; it's always 0 if the process is not in Idle state -; because memory calculation is done when the request -; processing has terminated; -; If the process is in Idle state, then informations are related to the -; last request the process has served. Otherwise informations are related to -; the current request being served. -; Example output: -; ************************ -; pid: 31330 -; state: Running -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 63087 -; requests: 12808 -; request duration: 1250261 -; request method: GET -; request URI: /test_mem.php?N=10000 -; content length: 0 -; user: - -; script: /home/fat/web/docs/php/test_mem.php -; last request cpu: 0.00 -; last request memory: 0 -; -; Note: There is a real-time FPM status monitoring sample web page available -; It's available in: ${prefix}/share/fpm/status.html -; -; Note: The value must start with a leading slash (/). The value can be -; anything, but it may not be a good idea to use the .php extension or it -; may conflict with a real PHP file. -; Default Value: not set -;pm.status_path = /status - -; The ping URI to call the monitoring page of FPM. If this value is not set, no -; URI will be recognized as a ping page. This could be used to test from outside -; that FPM is alive and responding, or to -; - create a graph of FPM availability (rrd or such); -; - remove a server from a group if it is not responding (load balancing); -; - trigger alerts for the operating team (24/7). -; Note: The value must start with a leading slash (/). The value can be -; anything, but it may not be a good idea to use the .php extension or it -; may conflict with a real PHP file. -; Default Value: not set -;ping.path = /ping - -; This directive may be used to customize the response of a ping request. The -; response is formatted as text/plain with a 200 response code. -; Default Value: pong -;ping.response = pong - -; The access log file -; Default: not set -;access.log = log/$pool.access.log - -; The access log format. -; The following syntax is allowed -; %%: the '%' character -; %C: %CPU used by the request -; it can accept the following format: -; - %{user}C for user CPU only -; - %{system}C for system CPU only -; - %{total}C for user + system CPU (default) -; %d: time taken to serve the request -; it can accept the following format: -; - %{seconds}d (default) -; - %{miliseconds}d -; - %{mili}d -; - %{microseconds}d -; - %{micro}d -; %e: an environment variable (same as $_ENV or $_SERVER) -; it must be associated with embraces to specify the name of the env -; variable. Some exemples: -; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e -; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e -; %f: script filename -; %l: content-length of the request (for POST request only) -; %m: request method -; %M: peak of memory allocated by PHP -; it can accept the following format: -; - %{bytes}M (default) -; - %{kilobytes}M -; - %{kilo}M -; - %{megabytes}M -; - %{mega}M -; %n: pool name -; %o: ouput header -; it must be associated with embraces to specify the name of the header: -; - %{Content-Type}o -; - %{X-Powered-By}o -; - %{Transfert-Encoding}o -; - .... -; %p: PID of the child that serviced the request -; %P: PID of the parent of the child that serviced the request -; %q: the query string -; %Q: the '?' character if query string exists -; %r: the request URI (without the query string, see %q and %Q) -; %R: remote IP address -; %s: status (response code) -; %t: server time the request was received -; it can accept a strftime(3) format: -; %d/%b/%Y:%H:%M:%S %z (default) -; %T: time the log has been written (the request has finished) -; it can accept a strftime(3) format: -; %d/%b/%Y:%H:%M:%S %z (default) -; %u: remote user -; -; Default: "%R - %u %t \"%m %r\" %s" -;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" - -; The log file for slow requests -; Default Value: not set -; Note: slowlog is mandatory if request_slowlog_timeout is set -;slowlog = log/$pool.log.slow - -; The timeout for serving a single request after which a PHP backtrace will be -; dumped to the 'slowlog' file. A value of '0s' means 'off'. -; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) -; Default Value: 0 -;request_slowlog_timeout = 0 - -; The timeout for serving a single request after which the worker process will -; be killed. This option should be used when the 'max_execution_time' ini option -; does not stop script execution for some reason. A value of '0' means 'off'. -; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) -; Default Value: 0 -;request_terminate_timeout = 0 - -; Set open file descriptor rlimit. -; Default Value: system defined value -;rlimit_files = 1024 - -; Set max core size rlimit. -; Possible Values: 'unlimited' or an integer greater or equal to 0 -; Default Value: system defined value -;rlimit_core = 0 - -; Chroot to this directory at the start. This value must be defined as an -; absolute path. When this value is not set, chroot is not used. -; Note: you can prefix with '$prefix' to chroot to the pool prefix or one -; of its subdirectories. If the pool prefix is not set, the global prefix -; will be used instead. -; Note: chrooting is a great security feature and should be used whenever -; possible. However, all PHP paths will be relative to the chroot -; (error_log, sessions.save_path, ...). -; Default Value: not set -;chroot = - -; Chdir to this directory at the start. -; Note: relative path can be used. -; Default Value: current directory or / when chroot -chdir = / - -; Redirect worker stdout and stderr into main error log. If not set, stdout and -; stderr will be redirected to /dev/null according to FastCGI specs. -; Note: on highloaded environement, this can cause some delay in the page -; process time (several ms). -; Default Value: no -;catch_workers_output = yes - -; Limits the extensions of the main script FPM will allow to parse. This can -; prevent configuration mistakes on the web server side. You should only limit -; FPM to .php extensions to prevent malicious users to use other extensions to -; exectute php code. -; Note: set an empty value to allow all extensions. -; Default Value: .php -;security.limit_extensions = .php .php3 .php4 .php5 - -; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from -; the current environment. -; Default Value: clean env -;env[HOSTNAME] = $HOSTNAME -;env[PATH] = /usr/local/bin:/usr/bin:/bin -;env[TMP] = /tmp -;env[TMPDIR] = /tmp -;env[TEMP] = /tmp - -; Additional php.ini defines, specific to this pool of workers. These settings -; overwrite the values previously defined in the php.ini. The directives are the -; same as the PHP SAPI: -; php_value/php_flag - you can set classic ini defines which can -; be overwritten from PHP call 'ini_set'. -; php_admin_value/php_admin_flag - these directives won't be overwritten by -; PHP call 'ini_set' -; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. - -; Defining 'extension' will load the corresponding shared extension from -; extension_dir. Defining 'disable_functions' or 'disable_classes' will not -; overwrite previously defined php.ini values, but will append the new value -; instead. - -; Note: path INI options can be relative and will be expanded with the prefix -; (pool, global or /usr) - -; Default Value: nothing is defined by default except the values in php.ini and -; specified at startup with the -d argument -;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com -;php_flag[display_errors] = off -;php_admin_value[error_log] = /var/log/fpm-php.www.log -;php_admin_flag[log_errors] = on -;php_admin_value[memory_limit] = 32M diff --git a/lang/php7/files/php7-fpm.conf b/lang/php7/files/php7-fpm.conf deleted file mode 100644 index c980b21909..0000000000 --- a/lang/php7/files/php7-fpm.conf +++ /dev/null @@ -1,121 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;; -; FPM Configuration ; -;;;;;;;;;;;;;;;;;;;;; - -; All relative paths in this configuration file are relative to PHP's install -; prefix (/usr). This prefix can be dynamically changed by using the -; '-p' argument from the command line. - -; Include one or more files. If glob(3) exists, it is used to include a bunch of -; files from a glob(3) pattern. This directive can be used everywhere in the -; file. -; Relative path can also be used. They will be prefixed by: -; - the global prefix if it's been set (-p argument) -; - /usr otherwise -;include=/etc/php7/fpm/*.conf - -;;;;;;;;;;;;;;;;;; -; Global Options ; -;;;;;;;;;;;;;;;;;; - -[global] -; Pid file -; Note: the default prefix is /var -; Default Value: none -pid = /var/run/php7-fpm.pid - -; Error log file -; If it's set to "syslog", log is sent to syslogd instead of being written -; in a local file. -; Note: the default prefix is /var -; Default Value: log/php-fpm.log -error_log = /var/log/php7-fpm.log - -; syslog_facility is used to specify what type of program is logging the -; message. This lets syslogd specify that messages from different facilities -; will be handled differently. -; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON) -; Default Value: daemon -;syslog.facility = daemon - -; syslog_ident is prepended to every message. If you have multiple FPM -; instances running on the same server, you can change the default value -; which must suit common needs. -; Default Value: php-fpm -;syslog.ident = php-fpm - -; Log level -; Possible Values: alert, error, warning, notice, debug -; Default Value: notice -;log_level = notice - -; If this number of child processes exit with SIGSEGV or SIGBUS within the time -; interval set by emergency_restart_interval then FPM will restart. A value -; of '0' means 'Off'. -; Default Value: 0 -;emergency_restart_threshold = 0 - -; Interval of time used by emergency_restart_interval to determine when -; a graceful restart will be initiated. This can be useful to work around -; accidental corruptions in an accelerator's shared memory. -; Available Units: s(econds), m(inutes), h(ours), or d(ays) -; Default Unit: seconds -; Default Value: 0 -;emergency_restart_interval = 0 - -; Time limit for child processes to wait for a reaction on signals from master. -; Available units: s(econds), m(inutes), h(ours), or d(ays) -; Default Unit: seconds -; Default Value: 0 -;process_control_timeout = 0 - -; The maximum number of processes FPM will fork. This has been design to control -; the global number of processes when using dynamic PM within a lot of pools. -; Use it with caution. -; Note: A value of 0 indicates no limit -; Default Value: 0 -; process.max = 128 - -; Specify the nice(2) priority to apply to the master process (only if set) -; The value can vary from -19 (highest priority) to 20 (lower priority) -; Note: - It will only work if the FPM master process is launched as root -; - The pool process will inherit the master process priority -; unless it specified otherwise -; Default Value: no set -; process.priority = -19 - -; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging. -; Default Value: yes -;daemonize = yes - -; Set open file descriptor rlimit for the master process. -; Default Value: system defined value -;rlimit_files = 1024 - -; Set max core size rlimit for the master process. -; Possible Values: 'unlimited' or an integer greater or equal to 0 -; Default Value: system defined value -;rlimit_core = 0 - -; Specify the event mechanism FPM will use. The following is available: -; - select (any POSIX os) -; - poll (any POSIX os) -; - epoll (linux >= 2.5.44) -; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0) -; - /dev/poll (Solaris >= 7) -; - port (Solaris >= 10) -; Default Value: not set (auto detection) -; events.mechanism = epoll - -;;;;;;;;;;;;;;;;;;;; -; Pool Definitions ; -;;;;;;;;;;;;;;;;;;;; - -; Multiple pools of child processes may be started with different listening -; ports and different management options. The name of the pool will be -; used in logs and stats. There is no limitation on the number of pools which -; FPM can handle. Your system will tell you anyway :) - -; To configure the pools it is recommended to have one .conf file per -; pool in the following directory: -include=/etc/php7-fpm.d/*.conf diff --git a/lang/php7/files/php7-fpm.config b/lang/php7/files/php7-fpm.config deleted file mode 100644 index 3a893c6f2d..0000000000 --- a/lang/php7/files/php7-fpm.config +++ /dev/null @@ -1,2 +0,0 @@ -config php7-fpm - option enabled 1 diff --git a/lang/php7/files/php7-fpm.init b/lang/php7/files/php7-fpm.init deleted file mode 100644 index c913a2b6f0..0000000000 --- a/lang/php7/files/php7-fpm.init +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=50 - -PROG=/usr/bin/php-fpm -CONFIG=/etc/php7-fpm.conf - -SERVICE_PID_FILE=/var/run/php7-fpm.pid - -start_instance() { - local section="$1" - local enabled - - config_get_bool enabled "$section" 'enabled' 0 - - [ $enabled -gt 0 ] || return 1 - - service_start $PROG -y $CONFIG -g $SERVICE_PID_FILE -} - -start() { - config_load 'php7-fpm' - config_foreach start_instance 'php7-fpm' -} - -stop() { - service_stop $PROG -} diff --git a/lang/php7/patches/0013-Add-support-for-use-of-the-system-timezone-database.patch b/lang/php7/patches/0013-Add-support-for-use-of-the-system-timezone-database.patch deleted file mode 100644 index f9ef5e4dbf..0000000000 --- a/lang/php7/patches/0013-Add-support-for-use-of-the-system-timezone-database.patch +++ /dev/null @@ -1,665 +0,0 @@ -From: Debian PHP Maintainers -Date: Thu, 7 Mar 2019 19:42:35 +0000 -Subject: Add-support-for-use-of-the-system-timezone-database - -# License: MIT -# http://opensource.org/licenses/MIT - -# License: MIT -# http://opensource.org/licenses/MIT - -Add support for use of the system timezone database, rather -than embedding a copy. Discussed upstream but was not desired. - -History: -r18: adapt for autotool change in 7.3.3RC1 -r17: adapt for timelib 2018.01 (in 7.3.2RC1) -r16: adapt for timelib 2017.06 (in 7.2.3RC1) -r15: adapt for timelib 2017.05beta7 (in 7.2.0RC1) -r14: improve check for valid tz file -r13: adapt for upstream changes to use PHP allocator -r12: adapt for upstream changes for new zic -r11: use canonical names to avoid more case sensitivity issues - round lat/long from zone.tab towards zero per builtin db -r10: make timezone case insensitive -r9: fix another compile error without --with-system-tzdata configured (Michael Heimpold) -r8: fix compile error without --with-system-tzdata configured -r7: improve check for valid timezone id to exclude directories -r6: fix fd leak in r5, fix country code/BC flag use in - timezone_identifiers_list() using system db, - fix use of PECL timezonedb to override system db, -r5: reverts addition of "System/Localtime" fake tzname. - updated for 5.3.0, parses zone.tab to pick up mapping between - timezone name, country code and long/lat coords -r4: added "System/Localtime" tzname which uses /etc/localtime -r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert) -r2: add filesystem trawl to set up name alias index -r1: initial revision ---- - ext/date/config0.m4 | 13 ++ - ext/date/lib/parse_tz.c | 535 +++++++++++++++++++++++++++++++++++++++++++++++- - 2 files changed, 545 insertions(+), 3 deletions(-) - ---- a/ext/date/config0.m4 -+++ b/ext/date/config0.m4 -@@ -4,6 +4,19 @@ AC_CHECK_HEADERS([io.h]) - dnl Check for strtoll, atoll - AC_CHECK_FUNCS(strtoll atoll) - -+PHP_ARG_WITH(system-tzdata, for use of system timezone data, -+[ --with-system-tzdata[=DIR] to specify use of system timezone data], -+no, no) -+ -+if test "$PHP_SYSTEM_TZDATA" != "no"; then -+ AC_DEFINE(HAVE_SYSTEM_TZDATA, 1, [Define if system timezone data is used]) -+ -+ if test "$PHP_SYSTEM_TZDATA" != "yes"; then -+ AC_DEFINE_UNQUOTED(HAVE_SYSTEM_TZDATA_PREFIX, "$PHP_SYSTEM_TZDATA", -+ [Define for location of system timezone data]) -+ fi -+fi -+ - PHP_DATE_CFLAGS="-I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1" - timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c - lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c" ---- a/ext/date/lib/parse_tz.c -+++ b/ext/date/lib/parse_tz.c -@@ -26,8 +26,21 @@ - #include "timelib.h" - #include "timelib_private.h" - -+#ifdef HAVE_SYSTEM_TZDATA -+#include -+#include -+#include -+#include -+#include -+ -+#include "php_scandir.h" -+ -+#else - #define TIMELIB_SUPPORTS_V2DATA - #include "timezonedb.h" -+#endif -+ -+#include - - #if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__)) - # if defined(__LITTLE_ENDIAN__) -@@ -88,6 +101,11 @@ static int read_php_preamble(const unsig - { - uint32_t version; - -+ if (memcmp(*tzf, "TZif", 4) == 0) { -+ *tzf += 20; -+ return 0; -+ } -+ - /* read ID */ - version = (*tzf)[3] - '0'; - *tzf += 4; -@@ -412,7 +430,429 @@ void timelib_dump_tzinfo(timelib_tzinfo - } - } - --static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb) -+#ifdef HAVE_SYSTEM_TZDATA -+ -+#ifdef HAVE_SYSTEM_TZDATA_PREFIX -+#define ZONEINFO_PREFIX HAVE_SYSTEM_TZDATA_PREFIX -+#else -+#define ZONEINFO_PREFIX "/usr/share/zoneinfo" -+#endif -+ -+/* System timezone database pointer. */ -+static const timelib_tzdb *timezonedb_system; -+ -+/* Hash table entry for the cache of the zone.tab mapping table. */ -+struct location_info { -+ char code[2]; -+ double latitude, longitude; -+ char name[64]; -+ char *comment; -+ struct location_info *next; -+}; -+ -+/* Cache of zone.tab. */ -+static struct location_info **system_location_table; -+ -+/* Size of the zone.tab hash table; a random-ish prime big enough to -+ * prevent too many collisions. */ -+#define LOCINFO_HASH_SIZE (1021) -+ -+/* Compute a case insensitive hash of str */ -+static uint32_t tz_hash(const char *str) -+{ -+ const unsigned char *p = (const unsigned char *)str; -+ uint32_t hash = 5381; -+ int c; -+ -+ while ((c = tolower(*p++)) != '\0') { -+ hash = (hash << 5) ^ hash ^ c; -+ } -+ -+ return hash % LOCINFO_HASH_SIZE; -+} -+ -+/* Parse an ISO-6709 date as used in zone.tab. Returns end of the -+ * parsed string on success, or NULL on parse error. On success, -+ * writes the parsed number to *result. */ -+static char *parse_iso6709(char *p, double *result) -+{ -+ double v, sign; -+ char *pend; -+ size_t len; -+ -+ if (*p == '+') -+ sign = 1.0; -+ else if (*p == '-') -+ sign = -1.0; -+ else -+ return NULL; -+ -+ p++; -+ for (pend = p; *pend >= '0' && *pend <= '9'; pend++) -+ ;; -+ -+ /* Annoying encoding used by zone.tab has no decimal point, so use -+ * the length to determine the format: -+ * -+ * 4 = DDMM -+ * 5 = DDDMM -+ * 6 = DDMMSS -+ * 7 = DDDMMSS -+ */ -+ len = pend - p; -+ if (len < 4 || len > 7) { -+ return NULL; -+ } -+ -+ /* p => [D]DD */ -+ v = (p[0] - '0') * 10.0 + (p[1] - '0'); -+ p += 2; -+ if (len == 5 || len == 7) -+ v = v * 10.0 + (*p++ - '0'); -+ /* p => MM[SS] */ -+ v += (10.0 * (p[0] - '0') -+ + p[1] - '0') / 60.0; -+ p += 2; -+ /* p => [SS] */ -+ if (len > 5) { -+ v += (10.0 * (p[0] - '0') -+ + p[1] - '0') / 3600.0; -+ p += 2; -+ } -+ -+ /* Round to five decimal place, not because it's a good idea, -+ * but, because the builtin data uses rounded data, so, match -+ * that. */ -+ *result = trunc(v * sign * 100000.0) / 100000.0; -+ -+ return p; -+} -+ -+/* This function parses the zone.tab file to build up the mapping of -+ * timezone to country code and geographic location, and returns a -+ * hash table. The hash table is indexed by the function: -+ * -+ * tz_hash(timezone-name) -+ */ -+static struct location_info **create_location_table(void) -+{ -+ struct location_info **li, *i; -+ char zone_tab[PATH_MAX]; -+ char line[512]; -+ FILE *fp; -+ -+ strncpy(zone_tab, ZONEINFO_PREFIX "/zone.tab", sizeof zone_tab); -+ -+ fp = fopen(zone_tab, "r"); -+ if (!fp) { -+ return NULL; -+ } -+ -+ li = calloc(LOCINFO_HASH_SIZE, sizeof *li); -+ -+ while (fgets(line, sizeof line, fp)) { -+ char *p = line, *code, *name, *comment; -+ uint32_t hash; -+ double latitude, longitude; -+ -+ while (isspace(*p)) -+ p++; -+ -+ if (*p == '#' || *p == '\0' || *p == '\n') -+ continue; -+ -+ if (!isalpha(p[0]) || !isalpha(p[1]) || p[2] != '\t') -+ continue; -+ -+ /* code => AA */ -+ code = p; -+ p[2] = 0; -+ p += 3; -+ -+ /* coords => [+-][D]DDMM[SS][+-][D]DDMM[SS] */ -+ p = parse_iso6709(p, &latitude); -+ if (!p) { -+ continue; -+ } -+ p = parse_iso6709(p, &longitude); -+ if (!p) { -+ continue; -+ } -+ -+ if (!p || *p != '\t') { -+ continue; -+ } -+ -+ /* name = string */ -+ name = ++p; -+ while (*p != '\t' && *p && *p != '\n') -+ p++; -+ -+ *p++ = '\0'; -+ -+ /* comment = string */ -+ comment = p; -+ while (*p != '\t' && *p && *p != '\n') -+ p++; -+ -+ if (*p == '\n' || *p == '\t') -+ *p = '\0'; -+ -+ hash = tz_hash(name); -+ i = malloc(sizeof *i); -+ memcpy(i->code, code, 2); -+ strncpy(i->name, name, sizeof i->name); -+ i->comment = strdup(comment); -+ i->longitude = longitude; -+ i->latitude = latitude; -+ i->next = li[hash]; -+ li[hash] = i; -+ /* printf("%s [%u, %f, %f]\n", name, hash, latitude, longitude); */ -+ } -+ -+ fclose(fp); -+ -+ return li; -+} -+ -+/* Return location info from hash table, using given timezone name. -+ * Returns NULL if the name could not be found. */ -+const struct location_info *find_zone_info(struct location_info **li, -+ const char *name) -+{ -+ uint32_t hash = tz_hash(name); -+ const struct location_info *l; -+ -+ if (!li) { -+ return NULL; -+ } -+ -+ for (l = li[hash]; l; l = l->next) { -+ if (timelib_strcasecmp(l->name, name) == 0) -+ return l; -+ } -+ -+ return NULL; -+} -+ -+/* Filter out some non-tzdata files and the posix/right databases, if -+ * present. */ -+static int index_filter(const struct dirent *ent) -+{ -+ return strcmp(ent->d_name, ".") != 0 -+ && strcmp(ent->d_name, "..") != 0 -+ && strcmp(ent->d_name, "posix") != 0 -+ && strcmp(ent->d_name, "posixrules") != 0 -+ && strcmp(ent->d_name, "right") != 0 -+ && strstr(ent->d_name, ".list") == NULL -+ && strstr(ent->d_name, ".tab") == NULL; -+} -+ -+static int sysdbcmp(const void *first, const void *second) -+{ -+ const timelib_tzdb_index_entry *alpha = first, *beta = second; -+ -+ return timelib_strcasecmp(alpha->id, beta->id); -+} -+ -+ -+/* Create the zone identifier index by trawling the filesystem. */ -+static void create_zone_index(timelib_tzdb *db) -+{ -+ size_t dirstack_size, dirstack_top; -+ size_t index_size, index_next; -+ timelib_tzdb_index_entry *db_index; -+ char **dirstack; -+ -+ /* LIFO stack to hold directory entries to scan; each slot is a -+ * directory name relative to the zoneinfo prefix. */ -+ dirstack_size = 32; -+ dirstack = malloc(dirstack_size * sizeof *dirstack); -+ dirstack_top = 1; -+ dirstack[0] = strdup(""); -+ -+ /* Index array. */ -+ index_size = 64; -+ db_index = malloc(index_size * sizeof *db_index); -+ index_next = 0; -+ -+ do { -+ struct dirent **ents; -+ char name[PATH_MAX], *top; -+ int count; -+ -+ /* Pop the top stack entry, and iterate through its contents. */ -+ top = dirstack[--dirstack_top]; -+ snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s", top); -+ -+ count = php_scandir(name, &ents, index_filter, php_alphasort); -+ -+ while (count > 0) { -+ struct stat st; -+ const char *leaf = ents[count - 1]->d_name; -+ -+ snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s/%s", -+ top, leaf); -+ -+ if (strlen(name) && stat(name, &st) == 0) { -+ /* Name, relative to the zoneinfo prefix. */ -+ const char *root = top; -+ -+ if (root[0] == '/') root++; -+ -+ snprintf(name, sizeof name, "%s%s%s", root, -+ *root ? "/": "", leaf); -+ -+ if (S_ISDIR(st.st_mode)) { -+ if (dirstack_top == dirstack_size) { -+ dirstack_size *= 2; -+ dirstack = realloc(dirstack, -+ dirstack_size * sizeof *dirstack); -+ } -+ dirstack[dirstack_top++] = strdup(name); -+ } -+ else { -+ if (index_next == index_size) { -+ index_size *= 2; -+ db_index = realloc(db_index, -+ index_size * sizeof *db_index); -+ } -+ -+ db_index[index_next++].id = strdup(name); -+ } -+ } -+ -+ free(ents[--count]); -+ } -+ -+ if (count != -1) free(ents); -+ free(top); -+ } while (dirstack_top); -+ -+ qsort(db_index, index_next, sizeof *db_index, sysdbcmp); -+ -+ db->index = db_index; -+ db->index_size = index_next; -+ -+ free(dirstack); -+} -+ -+#define FAKE_HEADER "1234\0??\1??" -+#define FAKE_UTC_POS (7 - 4) -+ -+/* Create a fake data segment for database 'sysdb'. */ -+static void fake_data_segment(timelib_tzdb *sysdb, -+ struct location_info **info) -+{ -+ size_t n; -+ char *data, *p; -+ -+ data = malloc(3 * sysdb->index_size + 7); -+ -+ p = mempcpy(data, FAKE_HEADER, sizeof(FAKE_HEADER) - 1); -+ -+ for (n = 0; n < sysdb->index_size; n++) { -+ const struct location_info *li; -+ timelib_tzdb_index_entry *ent; -+ -+ ent = (timelib_tzdb_index_entry *)&sysdb->index[n]; -+ -+ /* Lookup the timezone name in the hash table. */ -+ if (strcmp(ent->id, "UTC") == 0) { -+ ent->pos = FAKE_UTC_POS; -+ continue; -+ } -+ -+ li = find_zone_info(info, ent->id); -+ if (li) { -+ /* If found, append the BC byte and the -+ * country code; set the position for this -+ * section of timezone data. */ -+ ent->pos = (p - data) - 4; -+ *p++ = '\1'; -+ *p++ = li->code[0]; -+ *p++ = li->code[1]; -+ } -+ else { -+ /* If not found, the timezone data can -+ * point at the header. */ -+ ent->pos = 0; -+ } -+ } -+ -+ sysdb->data = (unsigned char *)data; -+} -+ -+/* Returns true if the passed-in stat structure describes a -+ * probably-valid timezone file. */ -+static int is_valid_tzfile(const struct stat *st, int fd) -+{ -+ if (fd) { -+ char buf[20]; -+ if (read(fd, buf, 20)!=20) { -+ return 0; -+ } -+ lseek(fd, SEEK_SET, 0); -+ if (memcmp(buf, "TZif", 4)) { -+ return 0; -+ } -+ } -+ return S_ISREG(st->st_mode) && st->st_size > 20; -+} -+ -+/* To allow timezone names to be used case-insensitively, find the -+ * canonical name for this timezone, if possible. */ -+static const char *canonical_tzname(const char *timezone) -+{ -+ if (timezonedb_system) { -+ timelib_tzdb_index_entry *ent, lookup; -+ -+ lookup.id = (char *)timezone; -+ -+ ent = bsearch(&lookup, timezonedb_system->index, -+ timezonedb_system->index_size, sizeof lookup, -+ sysdbcmp); -+ if (ent) { -+ return ent->id; -+ } -+ } -+ -+ return timezone; -+} -+ -+/* Return the mmap()ed tzfile if found, else NULL. On success, the -+ * length of the mapped data is placed in *length. */ -+static char *map_tzfile(const char *timezone, size_t *length) -+{ -+ char fname[PATH_MAX]; -+ struct stat st; -+ char *p; -+ int fd; -+ -+ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) { -+ return NULL; -+ } -+ -+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone)); -+ -+ fd = open(fname, O_RDONLY); -+ if (fd == -1) { -+ return NULL; -+ } else if (fstat(fd, &st) != 0 || !is_valid_tzfile(&st, fd)) { -+ close(fd); -+ return NULL; -+ } -+ -+ *length = st.st_size; -+ p = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0); -+ close(fd); -+ -+ return p != MAP_FAILED ? p : NULL; -+} -+ -+#endif -+ -+static int inmem_seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb) - { - int left = 0, right = tzdb->index_size - 1; - -@@ -438,9 +878,48 @@ static int seek_to_tz_position(const uns - return 0; - } - -+static int seek_to_tz_position(const unsigned char **tzf, char *timezone, -+ char **map, size_t *maplen, -+ const timelib_tzdb *tzdb) -+{ -+#ifdef HAVE_SYSTEM_TZDATA -+ if (tzdb == timezonedb_system) { -+ char *orig; -+ -+ orig = map_tzfile(timezone, maplen); -+ if (orig == NULL) { -+ return 0; -+ } -+ -+ (*tzf) = (unsigned char *)orig; -+ *map = orig; -+ return 1; -+ } -+ else -+#endif -+ { -+ return inmem_seek_to_tz_position(tzf, timezone, tzdb); -+ } -+} -+ - const timelib_tzdb *timelib_builtin_db(void) - { -+#ifdef HAVE_SYSTEM_TZDATA -+ if (timezonedb_system == NULL) { -+ timelib_tzdb *tmp = malloc(sizeof *tmp); -+ -+ tmp->version = "0.system"; -+ tmp->data = NULL; -+ create_zone_index(tmp); -+ system_location_table = create_location_table(); -+ fake_data_segment(tmp, system_location_table); -+ timezonedb_system = tmp; -+ } -+ -+ return timezonedb_system; -+#else - return &timezonedb_builtin; -+#endif - } - - const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_tzdb *tzdb, int *count) -@@ -452,7 +931,30 @@ const timelib_tzdb_index_entry *timelib_ - int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb) - { - const unsigned char *tzf; -- return (seek_to_tz_position(&tzf, timezone, tzdb)); -+ -+#ifdef HAVE_SYSTEM_TZDATA -+ if (tzdb == timezonedb_system) { -+ char fname[PATH_MAX]; -+ struct stat st; -+ -+ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) { -+ return 0; -+ } -+ -+ if (system_location_table) { -+ if (find_zone_info(system_location_table, timezone) != NULL) { -+ /* found in cache */ -+ return 1; -+ } -+ } -+ -+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone)); -+ -+ return stat(fname, &st) == 0 && is_valid_tzfile(&st, 0); -+ } -+#endif -+ -+ return (inmem_seek_to_tz_position(&tzf, timezone, tzdb)); - } - - static int skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz) -@@ -494,12 +996,14 @@ static timelib_tzinfo* timelib_tzinfo_ct - timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb, int *error_code) - { - const unsigned char *tzf; -+ char *memmap = NULL; -+ size_t maplen; - timelib_tzinfo *tmp; - int version; - int transitions_result, types_result; - unsigned int type; /* TIMELIB_TZINFO_PHP or TIMELIB_TZINFO_ZONEINFO */ - -- if (seek_to_tz_position(&tzf, timezone, tzdb)) { -+ if (seek_to_tz_position(&tzf, timezone, &memmap, &maplen, tzdb)) { - tmp = timelib_tzinfo_ctor(timezone); - - version = read_preamble(&tzf, tmp, &type); -@@ -534,11 +1038,36 @@ timelib_tzinfo *timelib_parse_tzfile(cha - } - skip_posix_string(&tzf, tmp); - -+#ifdef HAVE_SYSTEM_TZDATA -+ if (memmap) { -+ const struct location_info *li; -+ -+ /* TZif-style - grok the location info from the system database, -+ * if possible. */ -+ -+ if ((li = find_zone_info(system_location_table, timezone)) != NULL) { -+ tmp->location.comments = timelib_strdup(li->comment); -+ strncpy(tmp->location.country_code, li->code, 2); -+ tmp->location.longitude = li->longitude; -+ tmp->location.latitude = li->latitude; -+ tmp->bc = 1; -+ } -+ else { -+ set_default_location_and_comments(&tzf, tmp); -+ } -+ -+ /* Now done with the mmap segment - discard it. */ -+ munmap(memmap, maplen); -+ } else { -+#endif - if (type == TIMELIB_TZINFO_PHP) { - read_location(&tzf, tmp); - } else { - set_default_location_and_comments(&tzf, tmp); - } -+#ifdef HAVE_SYSTEM_TZDATA -+ } -+#endif - } else { - *error_code = TIMELIB_ERROR_NO_SUCH_TIMEZONE; - tmp = NULL; diff --git a/lang/php7/patches/0032-Use-system-timezone.patch b/lang/php7/patches/0032-Use-system-timezone.patch deleted file mode 100644 index 588690297d..0000000000 --- a/lang/php7/patches/0032-Use-system-timezone.patch +++ /dev/null @@ -1,41 +0,0 @@ -From: Debian PHP Maintainers -Date: Sat, 2 May 2015 10:26:56 +0200 -Subject: Use system timezone - -Upstream don't want this patch. See -http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=730771 for a summary. - -This delta is recovered from previous versions of the system timezone patch in -Debian, and appears to have inadvertently been dropped. Author unknown. - -To be used in tandem with use_embedded_timezonedb.patch and use_embedded_timezonedb_fixes.patch. ---- - ext/date/php_date.c | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - ---- a/ext/date/php_date.c -+++ b/ext/date/php_date.c -@@ -1039,6 +1039,23 @@ static char* guess_timezone(const timeli - DATEG(timezone_valid) = 1; - return DATEG(default_timezone); - } -+ /* Try to guess timezone from system information */ -+ { -+ struct tm *ta, tmbuf; -+ time_t the_time; -+ char *tzid = NULL; -+ -+ the_time = time(NULL); -+ ta = php_localtime_r(&the_time, &tmbuf); -+ if (ta) { -+ tzid = timelib_timezone_id_from_abbr(ta->tm_zone, ta->tm_gmtoff, ta->tm_isdst); -+ } -+ if (! tzid) { -+ tzid = "UTC"; -+ } -+ -+ return tzid; -+ } - /* Fallback to UTC */ - return "UTC"; - } diff --git a/lang/php7/patches/0041-Add-patch-to-remove-build-timestamps-from-generated-.patch b/lang/php7/patches/0041-Add-patch-to-remove-build-timestamps-from-generated-.patch deleted file mode 100644 index d39042a481..0000000000 --- a/lang/php7/patches/0041-Add-patch-to-remove-build-timestamps-from-generated-.patch +++ /dev/null @@ -1,102 +0,0 @@ -From: Thijs Kinkhorst -Date: Mon, 2 Dec 2019 22:18:43 +0100 -Subject: Add patch to remove build timestamps from generated binaries. - ---- - ext/standard/info.c | 1 - - sapi/apache2handler/config.m4 | 15 +++------------ - sapi/cgi/cgi_main.c | 4 ++-- - sapi/cli/php_cli.c | 4 ++-- - sapi/fpm/fpm/fpm_main.c | 4 ++-- - sapi/phpdbg/phpdbg.c | 4 +--- - 6 files changed, 10 insertions(+), 22 deletions(-) - ---- a/ext/standard/info.c -+++ b/ext/standard/info.c -@@ -803,7 +803,6 @@ PHPAPI ZEND_COLD void php_print_info(int - php_info_print_box_end(); - php_info_print_table_start(); - php_info_print_table_row(2, "System", ZSTR_VAL(php_uname)); -- php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__); - #ifdef COMPILER - php_info_print_table_row(2, "Compiler", COMPILER); - #endif ---- a/sapi/apache2handler/config.m4 -+++ b/sapi/apache2handler/config.m4 -@@ -64,18 +64,9 @@ if test "$PHP_APXS2" != "no"; then - fi - - APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR` -- if test -z `$APXS -q SYSCONFDIR`; then -- INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ -- $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ -- -i -n php7" -- else -- APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR` -- INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ -- \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \ -- $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ -- -S SYSCONFDIR='$APXS_SYSCONFDIR' \ -- -i -a -n php7" -- fi -+ INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ -+ $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ -+ -i -n php7" - - case $host_alias in - *aix*) ---- a/sapi/cgi/cgi_main.c -+++ b/sapi/cgi/cgi_main.c -@@ -2401,9 +2401,9 @@ parent_loop_end: - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - #if ZEND_DEBUG -- php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -+ php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version()); - #else -- php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -+ php_printf("PHP %s (%s)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version()); - #endif - php_request_shutdown((void *) 0); - fcgi_shutdown(); ---- a/sapi/cli/php_cli.c -+++ b/sapi/cli/php_cli.c -@@ -648,8 +648,8 @@ static int do_cli(int argc, char **argv) - goto out; - - case 'v': /* show php version & quit */ -- php_printf("PHP %s (%s) (built: %s %s) ( %s)\nCopyright (c) The PHP Group\n%s", -- PHP_VERSION, cli_sapi_module.name, __DATE__, __TIME__, -+ php_printf("PHP %s (%s) ( %s)\nCopyright (c) The PHP Group\n%s", -+ PHP_VERSION, cli_sapi_module.name, - #if ZTS - "ZTS " - #else ---- a/sapi/fpm/fpm/fpm_main.c -+++ b/sapi/fpm/fpm/fpm_main.c -@@ -1718,9 +1718,9 @@ int main(int argc, char *argv[]) - SG(request_info).no_headers = 1; - - #if ZEND_DEBUG -- php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -+ php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version()); - #else -- php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -+ php_printf("PHP %s (%s)\nCopyright (c) The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version()); - #endif - php_request_shutdown((void *) 0); - fcgi_shutdown(); ---- a/sapi/phpdbg/phpdbg.c -+++ b/sapi/phpdbg/phpdbg.c -@@ -1697,10 +1697,8 @@ phpdbg_main: - phpdbg_do_help_cmd(exec); - } else if (show_version) { - phpdbg_out( -- "phpdbg %s (built: %s %s)\nPHP %s, Copyright (c) The PHP Group\n%s", -+ "phpdbg %s\nPHP %s, Copyright (c) The PHP Group\n%s", - PHPDBG_VERSION, -- __DATE__, -- __TIME__, - PHP_VERSION, - get_zend_version() - ); diff --git a/lang/php7/patches/0042-Remove-W3C-validation-icon-to-not-expose-the-reader-.patch b/lang/php7/patches/0042-Remove-W3C-validation-icon-to-not-expose-the-reader-.patch deleted file mode 100644 index ed221695b2..0000000000 --- a/lang/php7/patches/0042-Remove-W3C-validation-icon-to-not-expose-the-reader-.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: =?utf-8?q?Ond=C5=99ej_Sur=C3=BD?= -Date: Wed, 29 Jul 2015 14:37:55 +0200 -Subject: Remove W3C validation icon to not expose the reader's IP address to - potential tracking. - ---- - sapi/fpm/status.html.in | 5 ----- - 1 file changed, 5 deletions(-) - ---- a/sapi/fpm/status.html.in -+++ b/sapi/fpm/status.html.in -@@ -70,11 +70,6 @@ - PID↓Start TimeStart SinceRequests ServedRequest DurationRequest methodRequest URIContent LengthUserScriptLast Request %CPULast Request Memory - - --

-- -- Valid XHTML 1.0 Transitional -- --

-