aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
Diffstat (limited to 'package')
-rw-r--r--package/network/services/unetd/Makefile22
-rw-r--r--package/network/services/unetd/files/unetd.init2
-rw-r--r--package/network/services/unetd/files/unetd.sh4
3 files changed, 23 insertions, 5 deletions
diff --git a/package/network/services/unetd/Makefile b/package/network/services/unetd/Makefile
index 5e115327d3..ff485576c0 100644
--- a/package/network/services/unetd/Makefile
+++ b/package/network/services/unetd/Makefile
@@ -10,9 +10,9 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=unetd
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/unetd.git
-PKG_SOURCE_DATE:=2022-09-01
-PKG_SOURCE_VERSION:=d7fb9e5b065bf9eecb5bcbcf741b5f89695c5dcc
-PKG_MIRROR_HASH:=a693c2b4b4bda5e1e44b493019e8e6e6d39c4048f417b581c801a9931e6b9b39
+PKG_SOURCE_DATE:=2022-09-16
+PKG_SOURCE_VERSION:=a089e8ae7504e55e05b1a88c3d8d1327460b8d4f
+PKG_MIRROR_HASH:=15ebeb7ccf4fae0ac46df638999d51a8150d3b0859232537b80e6dcb03ffb165
PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
@@ -44,6 +44,13 @@ define Package/unetd/config
endef
+define Package/unet-dht
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=unetd
+ TITLE:=unetd DHT discovery support
+endef
+
define Package/unet-cli
SECTION:=net
CATEGORY:=Network
@@ -88,10 +95,19 @@ define Package/unetd/install
$(INSTALL_BIN) ./files/unetd.sh $(1)/lib/netifd/proto
endef
+define Package/unet-dht/install
+ $(INSTALL_DIR) \
+ $(1)/etc/init.d \
+ $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/unet-dht $(1)/usr/sbin
+ $(INSTALL_BIN) ./files/unet-dht.init $(1)/etc/init.d/unet-dht
+endef
+
define Package/unet-cli/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/unet-cli $(1)/usr/sbin
endef
$(eval $(call BuildPackage,unetd))
+$(eval $(call BuildPackage,unet-dht))
$(eval $(call BuildPackage,unet-cli))
diff --git a/package/network/services/unetd/files/unetd.init b/package/network/services/unetd/files/unetd.init
index 0ec48b2b92..c1124821ee 100644
--- a/package/network/services/unetd/files/unetd.init
+++ b/package/network/services/unetd/files/unetd.init
@@ -10,7 +10,7 @@ start_service() {
mkdir -p /var/run/unetd /etc/unetd
procd_open_instance
- procd_set_param command "$PROG" -h /var/run/unetd/hosts
+ procd_set_param command "$PROG" -h /var/run/unetd/hosts -u /var/run/unetd/socket
procd_set_param respawn
procd_set_param limits core="unlimited"
procd_close_instance
diff --git a/package/network/services/unetd/files/unetd.sh b/package/network/services/unetd/files/unetd.sh
index 70a28f6482..2f0f0c478c 100644
--- a/package/network/services/unetd/files/unetd.sh
+++ b/package/network/services/unetd/files/unetd.sh
@@ -16,6 +16,7 @@ proto_unet_init_config() {
proto_config_add_string file
proto_config_add_int keepalive
proto_config_add_string domain
+ proto_config_add_boolean dht
proto_config_add_array "tunnels:list(string)"
proto_config_add_array "connect:list(string)"
proto_config_add_array "peer_data:list(string)"
@@ -28,7 +29,7 @@ proto_unet_setup() {
local config="$1"
local device type key file keepalive domain tunnels
- json_get_vars device type auth_key key file keepalive domain
+ json_get_vars device type auth_key key file keepalive domain dht
json_get_values tunnels tunnels
json_get_values connect connect
json_get_values peer_data peer_data
@@ -45,6 +46,7 @@ proto_unet_setup() {
json_add_string key "$key"
json_add_string file "$file"
[ -n "$keepalive" ] && json_add_int keepalive "$keepalive"
+ [ -n "$dht" ] && json_add_boolean dht "$dht"
json_add_string domain "$domain"
json_add_object tunnels