From 0a637d29d4505cc3469c2a4c853311907691b6bf Mon Sep 17 00:00:00 2001 From: chyoo Date: Wed, 8 Jul 2026 17:22:33 +0900 Subject: [PATCH] connect tailscale node status through platform gateway --- src/routes/admin.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/routes/admin.ts b/src/routes/admin.ts index aad2653..cfc1f8c 100644 --- a/src/routes/admin.ts +++ b/src/routes/admin.ts @@ -28,8 +28,17 @@ adminRoutes.get('/admin/tailscale/routes', async (c) => { }) adminRoutes.get('/admin/tailscale/acl', async (c) => { - return c.json({ - policy: await headscaleAdapter.getPolicyStatus(), - fetchedAt: new Date().toISOString(), - }) + const emptyPolicy = { groups: {}, tagOwners: {}, acls: [], raw: null } + try { + return c.json({ + policy: await headscaleAdapter.getPolicyStatus(), + fetchedAt: new Date().toISOString(), + }) + } catch (error) { + return c.json({ + policy: emptyPolicy, + error: error instanceof Error ? error.message : String(error), + fetchedAt: new Date().toISOString(), + }) + } })