cloudflared: Fix incorrect uci config syntax
authorRyan Keane <[email protected]>
Thu, 20 Jun 2024 21:16:27 +0000 (17:16 -0400)
committerTianling Shen <[email protected]>
Sat, 29 Jun 2024 09:23:32 +0000 (17:23 +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 <[email protected]>
(cherry picked from commit 2d711c8fbda489ab5f89b162c040b6502986e970)
[rebased upon 23.05 branch]
Signed-off-by: Tianling Shen <[email protected]>
net/cloudflared/Makefile
net/cloudflared/files/cloudflared.config
net/cloudflared/files/cloudflared.init

index 10d66a2cca5f79754ac2fd09fc0ff4b807782f10..1b7f20d4f84acda992875f7c47e38acd91e845cc 100644 (file)
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cloudflared
 PKG_VERSION:=2024.4.0
-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"