fix(cloudflare): fix delete_tunnel subdomain format and add startup config check
- Fix delete_tunnel calls to use correct subdomain format (instance-{id[:8]})
- Add Cloudflare configuration check at startup with clear warnings
- Help diagnose why tunnels aren't being created
This commit is contained in:
@@ -229,6 +229,18 @@ async def on_startup():
|
||||
|
||||
# Seed built-in data
|
||||
await seed_builtin_tool_types()
|
||||
|
||||
# Check Cloudflare configuration
|
||||
settings = Settings()
|
||||
if settings.cloudflare_api_token and settings.cloudflare_account_id and settings.cloudflare_zone_id and settings.cloudflare_base_domain:
|
||||
logger.info("Cloudflare tunnel configuration detected: base_domain=%s", settings.cloudflare_base_domain)
|
||||
else:
|
||||
logger.warning(
|
||||
"Cloudflare tunnel configuration incomplete. "
|
||||
"Tunnels will not be created. Set CLOUDFLARE_API_TOKEN, "
|
||||
"CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_ZONE_ID, and CLOUDFLARE_BASE_DOMAIN."
|
||||
)
|
||||
|
||||
logger.info("Startup complete.")
|
||||
|
||||
app.include_router(health_router)
|
||||
|
||||
Reference in New Issue
Block a user