cloudflared: Fix incorrect uci config syntax
authorRyan Keane <the.ra2.ifv@gmail.com>
Thu, 20 Jun 2024 21:16:27 +0000 (17:16 -0400)
committerTianling Shen <cnsztl@gmail.com>
Mon, 24 Jun 2024 07:35:56 +0000 (15:35 +0800)
Fix incorrect uci config syntax, caused by a careless newbie contributer.
Modify function append_param_arg() in init script, to support hyphenated
arguments.
Add more command parameters as uci options, no value is set to keep it default.

Signed-off-by: Ryan Keane <the.ra2.ifv@gmail.com>
net/cloudflared/Makefile
net/cloudflared/files/cloudflared.config
net/cloudflared/files/cloudflared.init

index 3eb55ae89a5bfd4d587c8f67e68216de5c397dc0..c58d99f9fa9603a2bed810123ed2085da6a59c1a 100644 (file)
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cloudflared
 PKG_VERSION:=2024.6.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/cloudflare/cloudflared/tar.gz/$(PKG_VERSION)?
index 324d3ecf325967b886ad3c1d0fb91a534c2660a3..e522cd5be5704030d60d2afa5ec042cd419cbd32 100644 (file)
@@ -4,10 +4,14 @@ config cloudflared 'config'
        option token ''
        option config '/etc/cloudflared/config.yml'
        option origincert '/etc/cloudflared/cert.pem'
-       option edge-bind-address 'auto'
-       option protocol 'auto'
+       option edge_bind_address ''
+       option edge_ip_version ''
+       option grace_period ''
+       option protocol 'http2'
        option region ''
-       option retries '5'
+       option retries ''
+       option tag ''
+       option metrics ''
        option loglevel 'info'
        option logfile '/var/log/cloudflared.log'
 
index 2e511d8f56bdec4e34e0cb9eae1887f9ddb632a6..ffef8d0931c3de6a917b755f79e9ccd620e61a63 100755 (executable)
@@ -10,7 +10,7 @@ PROG="/usr/bin/cloudflared"
 append_param_arg() {
        local value
        config_get value "config" "$1" $2
-       [ -n "$value" ] && procd_append_param command "--$1" "$value"
+       [ -n "$value" ] && procd_append_param command "--${1//_/-}" "$value"
 }
 
 start_service() {
@@ -26,10 +26,14 @@ start_service() {
 
        append_param_arg "config" "/etc/cloudflared/config.yml"
        append_param_arg "origincert" "/etc/cloudflared/cert.pem"
-       append_param_arg "edge-bind-address"
+       append_param_arg "edge_bind_address"
+       append_param_arg "edge_ip_version"
+       append_param_arg "grace_period"
        append_param_arg "protocol"
        append_param_arg "region"
        append_param_arg "retries"
+       append_param_arg "tag"
+       append_param_arg "metrics"
        append_param_arg "loglevel"
        append_param_arg "logfile"