Skip to content

cloudflared: support multiple upstream interfaces in init script#29117

Open
kouhei-ioroi wants to merge 1 commit intoopenwrt:masterfrom
kouhei-ioroi:feature_cloudflared_multiple_upstream_interface
Open

cloudflared: support multiple upstream interfaces in init script#29117
kouhei-ioroi wants to merge 1 commit intoopenwrt:masterfrom
kouhei-ioroi:feature_cloudflared_multiple_upstream_interface

Conversation

@kouhei-ioroi
Copy link
Copy Markdown

@kouhei-ioroi kouhei-ioroi commented Apr 11, 2026

📦 Package Details

Maintainer: @1715173329
(You can find this by checking the history of the package Makefile.)

Description:
This pull request implements the ability to restart cloudflared service in the event of an upstream interface other than the "wan" defined by default, as well as multiple upstream interfaces.

The changes include:

  1. In 'cloudflared.config', Removed the redundant space and added the interface option 'list interface' to detect the up event.
  2. In 'cloudflared.init', Added configuration readout to 'service_triggers()' and added a for loop to configure each target interface. If there is no "interface" list in the config, the same default value of "wan" will be used as before.

🧪 Run Testing Details

  • **OpenWrt Version: 25.12.2 r32802-f505120278
  • **OpenWrt Target/Subtarget: mediatek/filogic
  • **OpenWrt Device: Banana Pi BPI-R4 (2x SFP+)

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc., using
    make package/<your-package>/refresh V=s
  • It is structured in a way that it is potentially upstreamable
    (e.g., subject line, commit description, etc.)
    We must try to upstream patches to reduce maintenance burden.

Copilot AI review requested due to automatic review settings April 11, 2026 08:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for restarting cloudflared when one or more configured upstream network interfaces come up, instead of being hardcoded to wan.

Changes:

  • Load UCI config in service_triggers() and dynamically register interface-up triggers for configured interfaces
  • Add a default list interface 'wan' to the sample cloudflared.config

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
net/cloudflared/files/cloudflared.init Registers procd interface triggers based on configured interface list
net/cloudflared/files/cloudflared.config Adds default interface list entry (wan) for interface-up detection

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread net/cloudflared/files/cloudflared.init Outdated
Comment thread net/cloudflared/files/cloudflared.init Outdated
@kouhei-ioroi kouhei-ioroi force-pushed the feature_cloudflared_multiple_upstream_interface branch from 11b5601 to 1415edd Compare April 11, 2026 09:07
@@ -1,6 +1,6 @@

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please leave this blank line as-is and bump PKG_RELEASE in Makefile

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.


config cloudflared 'config'
option enabled '0'
list interface 'wan'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interfaces maybe

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@kouhei-ioroi kouhei-ioroi force-pushed the feature_cloudflared_multiple_upstream_interface branch 2 times, most recently from d384c0e to 13a6289 Compare April 13, 2026 03:57
Copy link
Copy Markdown
Member

@1715173329 1715173329 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@kouhei-ioroi kouhei-ioroi force-pushed the feature_cloudflared_multiple_upstream_interface branch from 52b0f98 to 65a7a66 Compare April 15, 2026 00:53
support multiple upstream interfaces in config.

Signed-off-by: kouhei-ioroi <kouhei@ioroi.group>
@kouhei-ioroi kouhei-ioroi force-pushed the feature_cloudflared_multiple_upstream_interface branch from 65a7a66 to c4d161e Compare April 15, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants