cloudflared: fix argument order for tunnel command

Move all global options (--protocol, --loglevel, --logfile, --config,
--origincert, etc.) before the 'run' subcommand, and keep --token
after it to match the correct cloudflared CLI syntax.

Signed-off-by: Akihiro Nagai <bashing.tremors_0f@icloud.com>
This commit is contained in:
Akihiro Nagai
2025-11-07 23:41:06 +09:00
committed by Tianling Shen
parent 4fb8ba34b1
commit 38da2ccc4d
2 changed files with 15 additions and 11 deletions

View File

@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=cloudflared
PKG_VERSION:=2025.10.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)?

View File

@@ -28,16 +28,6 @@ start_service() {
procd_append_param command "--no-autoupdate"
procd_append_param command "run"
config_get token "config" "token"
if [ -n "$token" ]; then
# Remotely-managed tunnel (recommended by Cloudflare)
procd_append_param command "--token" "$token"
else
# Locally-managed tunnels
append_param_arg "config" "/etc/cloudflared/config.yml"
append_param_arg "origincert" "/etc/cloudflared/cert.pem"
fi
append_param_arg "edge_bind_address"
append_param_arg "edge_ip_version"
append_param_arg "grace_period"
@@ -49,6 +39,20 @@ start_service() {
append_param_arg "loglevel"
append_param_arg "logfile"
config_get token "config" "token"
if [ -z "$token" ]; then
# Locally-managed tunnels
append_param_arg "config" "/etc/cloudflared/config.yml"
append_param_arg "origincert" "/etc/cloudflared/cert.pem"
fi
procd_append_param command "run"
if [ -n "$token" ]; then
# Remotely-managed tunnel (recommended by Cloudflare)
procd_append_param command "--token" "$token"
fi
procd_set_param respawn
procd_set_param stderr 1