Skip to content

Commit

Permalink
cloudflared: Fix incorrect uci config syntax
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Ra2-IFV authored and 1715173329 committed Jun 24, 2024
1 parent 04b9e8a commit 2d711c8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion net/cloudflared/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)?
Expand Down
10 changes: 7 additions & 3 deletions net/cloudflared/files/cloudflared.config
Original file line number Diff line number Diff line change
Expand Up @@ -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'

8 changes: 6 additions & 2 deletions net/cloudflared/files/cloudflared.init
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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"

Expand Down

0 comments on commit 2d711c8

Please sign in to comment.