From fdb3f9a9f760589b17eef64d5507c62e7f50c90f Mon Sep 17 00:00:00 2001 From: Devin Ivy Date: Wed, 21 Feb 2024 22:51:07 -0500 Subject: [PATCH] fix tls check --- installer.sh | 2 +- service/index.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/installer.sh b/installer.sh index 0386795..f3efa89 100644 --- a/installer.sh +++ b/installer.sh @@ -306,7 +306,7 @@ DOCKERD_CONFIG { email ${PDS_ADMIN_EMAIL} on_demand_tls { - ask http://localhost:3000/check-handle + ask http://localhost:3000/tls-check } } diff --git a/service/index.js b/service/index.js index 2b77323..4f83837 100644 --- a/service/index.js +++ b/service/index.js @@ -16,7 +16,7 @@ const main = async () => { const pds = await PDS.create(cfg, secrets); await pds.start(); httpLogger.info("pds has started"); - pds.app.get("/check-handle", (req, res) => { + pds.app.get("/tls-check", (req, res) => { checkHandleRoute(pds, req, res); }); // Graceful shutdown (see also https://aws.amazon.com/blogs/containers/graceful-shutdowns-with-ecs/) @@ -40,6 +40,9 @@ async function checkHandleRoute( message: "bad or missing domain query param", }); } + if (domain === pds.ctx.cfg.service.hostname) { + return res.json({ success: true }); + } const isHostedHandle = pds.ctx.cfg.identity.serviceHandleDomains.find( (avail) => domain.endsWith(avail) ); @@ -56,7 +59,7 @@ async function checkHandleRoute( message: "handle not found for this domain", }); } - return res.json({ did: account.did, handle: account.handle }); + return res.json({ success: true }); } catch (err) { httpLogger.error({ err }, "check handle failed"); return res.status(500).json({