From 235af90aed3c9052ae9e3ef0695ffa64626974df Mon Sep 17 00:00:00 2001 From: vl Date: Mon, 21 Sep 2026 23:14:51 +0200 Subject: [PATCH] chore: record how the panel reaches the server MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Neither the reverse proxy nor a production Next server logs requests, so "is the device on TLS?" was not answerable without a packet capture — and the capture then produced nothing, because tcpdump buffers its output and a handful of SYN lines never filled the buffer. One line per wake, naming the scheme and saying so plainly when the panel is being served in clear. At a two-hour refresh that is a dozen lines a day, and it turns a question that cost an evening into a grep. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_012cSY9pVhZmJUKNN7wf1Myd --- app/api/display/route.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/api/display/route.ts b/app/api/display/route.ts index ea3fe26..682e4ee 100644 --- a/app/api/display/route.ts +++ b/app/api/display/route.ts @@ -40,6 +40,16 @@ export async function GET(request: Request) { const now = new Date(); const baseUrl = publicBaseUrl(request); + + // How the panel actually reaches us is not otherwise observable: neither the + // reverse proxy nor a production Next server logs requests, which is what + // made a plain "is it on TLS?" question take a packet capture to answer. + // One line per wake, and at most a handful a day. + const scheme = baseUrl.startsWith('https://') ? 'https' : 'http'; + console.info( + `[device] ${device.friendlyId} via ${scheme} (${baseUrl})` + + (scheme === 'http' ? ' — en clair, voir DEVICE_ALLOW_HTTP' : ''), + ); const { payload, settings, status } = await buildCurrentScreen(now, baseUrl); const image = await renderAndStore(payload, settings.imageFormat);