chore: record how the panel reaches the server

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012cSY9pVhZmJUKNN7wf1Myd
This commit is contained in:
2026-09-21 23:14:51 +02:00
co-authored by Claude Opus 5
parent ec826b378f
commit 235af90aed
+10
View File
@@ -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);