cloudflared-mirror/cmd/cloudflared/tunnel
Aleksei Sviridkin 793912756b
feat(tunnel): add configuration hot reload support
Add hot reload capability for locally-managed tunnels. When a config file
is specified (without --token), cloudflared now watches for changes and
automatically reloads the configuration.

Features:
- File watching via fsnotify with 500ms debounce
- Fallback polling every 30s for symlink rotation (Kubernetes ConfigMaps)
- Manual reload via SIGHUP signal
- Graceful handling of invalid configs (keeps current config)
- Thread-safe with TryLock to skip concurrent reloads

New files:
- orchestration/local_config.go: Config file reading and validation
- orchestration/local_watcher.go: File watcher with reload logic

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-01-14 20:54:59 +03:00
..
cmd.go feat(tunnel): add configuration hot reload support 2026-01-14 20:54:59 +03:00
cmd_test.go TUN-1669: Update license message in help text. Also fix test 2019-04-18 10:42:48 -05:00
configuration.go TUN-9820: Add support for FedRAMP in originRequest Access config 2025-09-15 11:11:23 +00:00
configuration_test.go TUN-7584: Bump go 1.20.6 2023-07-26 13:52:40 -07:00
credential_finder.go TUN-8914: Create a flags module to group all cloudflared cli flags 2025-02-06 03:30:27 -08:00
filesystem.go TUN-7590: Remove usages of ioutil 2023-07-17 19:08:38 +00:00
info.go TUN-5482: Refactor tunnelstore client related packages for more coherent package 2021-12-28 17:17:49 +00:00
ingress_subcommands.go CUSTESC-33731: Make rule match test report rule in 0-index base 2023-10-03 12:18:49 +01:00
login.go AUTH-7480 update fed callback url for login helper 2025-08-19 18:54:31 +00:00
quick_tunnel.go TUN-8914: Create a flags module to group all cloudflared cli flags 2025-02-06 03:30:27 -08:00
server.go Add max upstream connections dns-proxy option (#290) 2021-02-12 21:32:29 +04:00
signal.go feat(tunnel): add configuration hot reload support 2026-01-14 20:54:59 +03:00
signal_test.go feat(tunnel): add configuration hot reload support 2026-01-14 20:54:59 +03:00
subcommand_context.go TUN-9755: Set endpoint in tunnel credentials when generating locally managed tunnel with a Fed token 2025-08-27 15:57:58 +00:00
subcommand_context_teamnet.go TUN-7787: Refactor cloudflared to use new route endpoints based on route IDs 2023-09-19 09:56:02 +00:00
subcommand_context_test.go TUN-7813: Improve tunnel delete command to use cascade delete 2023-09-20 12:35:43 +01:00
subcommand_context_vnets.go ZTC-446: Allow to force delete a vnet 2023-01-20 11:52:56 +00:00
subcommands.go TUN-9473: Add --dns-resolver-addrs flag 2025-06-30 15:20:32 -07:00
subcommands_test.go TUN-5679: Add support for service install using Tunnel Token 2022-03-03 18:59:03 +00:00
tag.go TUN-8423: Deprecate older legacy tunnel capnp interfaces 2024-05-23 11:17:49 -07:00
tag_test.go TUN-8423: Deprecate older legacy tunnel capnp interfaces 2024-05-23 11:17:49 -07:00
teamnet_subcommands.go chore: fix linter rules 2025-04-01 18:57:55 +01:00
vnets_subcommands.go ZTC-446: Allow to force delete a vnet 2023-01-20 11:52:56 +00:00