Skip to content

Commit

Permalink
fix tls check
Browse files Browse the repository at this point in the history
  • Loading branch information
devinivy committed Feb 22, 2024
1 parent ebd9b98 commit fdb3f9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
7 changes: 5 additions & 2 deletions service/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand All @@ -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)
);
Expand All @@ -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({
Expand Down

0 comments on commit fdb3f9a

Please sign in to comment.