Skip to content

Commit d7a0c64

Browse files
committed
Clarify recovery-page approval code is in container logs, not app logs
- The approval code was already printed to container stdout on every blocked startup, but the page only said "the container log," which users conflated with Floppy's own LOG_DIR log files - Name the actual command (docker compose logs / docker logs) and explicitly disclaim it's not Floppy's app logs, across all 4 spots that referenced this Fixes #960
1 parent 8a3f007 commit d7a0c64

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

src/config/sqlite_recovery_server.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@
5151
# The approval code proves that the person has read the report file. The page
5252
# must never show it, or the code proves only that they opened the page.
5353
_SECRET_REPORT_KEYS = frozenset({"actions", "incident_token"})
54+
# "the container log" alone is ambiguous: Floppy also writes its own app log
55+
# files (LOG_DIR), and users have reported checking those instead (#960). Name
56+
# the actual command and disclaim the app logs explicitly wherever this comes up.
57+
_CONTAINER_LOG_HINT = (
58+
"the container's own log output, not Floppy's log files — run "
59+
"<code>docker compose logs floppy</code> (or <code>docker logs "
60+
"&lt;container&gt;</code>) and search for &quot;approval code&quot;"
61+
)
5462

5563
_HELP_LINKS = (
5664
("Report a problem", "https://github.com/dannyvfilms/Floppy/issues"),
@@ -375,7 +383,7 @@ def render_page(
375383
body = (
376384
"<h1>Your data is safe. Nothing was deleted.</h1>"
377385
"<p>Floppy paused before it started. It cannot read the report that "
378-
"explains why. Look at the container log for the reason.</p>"
386+
f"explains why. Look at {_CONTAINER_LOG_HINT}.</p>"
379387
+ _help_card()
380388
)
381389
return _document(body)
@@ -446,9 +454,10 @@ def render_page(
446454
parts.append(
447455
"<div class='card'><h2>Repair the relationships, then start</h2>"
448456
f"<p>{explanation}</p>"
449-
"<p class='note'>Enter the current approval code from the container "
450-
"log. The code is tied to this exact database state and changes if "
451-
"Floppy safely repairs part of the incident first.</p>"
457+
f"<p class='note'>Enter the current approval code, found in "
458+
f"{_CONTAINER_LOG_HINT}. The code is tied to this exact database "
459+
"state and changes if Floppy safely repairs part of the incident "
460+
"first.</p>"
452461
"<form method='POST' action='/quarantine'>"
453462
"<p><label for='recovery-token'>Approval code</label><br>"
454463
"<input id='recovery-token' name='token' required autocomplete='off' "
@@ -506,7 +515,7 @@ def _waiting_page() -> str:
506515
"<p role='status'>Floppy is applying it, then starting. This can take "
507516
"several minutes on a large database. You can leave this page open.</p>"
508517
"<p class='note'>This page opens Floppy when Floppy is ready. If it "
509-
"stays on this message, look at the container log.</p>"
518+
f"stays on this message, look at {_CONTAINER_LOG_HINT}.</p>"
510519
"<p><a class='button' href='/'>Open Floppy</a></p>"
511520
"</div>"
512521
)
@@ -744,8 +753,9 @@ def do_POST(self) -> None:
744753
403,
745754
_document(
746755
"<h1>That code is not correct.</h1><p>Use the current "
747-
"approval code from the container log. The code changes "
748-
"when the database state changes. No entry was changed.</p>",
756+
f"approval code, found in {_CONTAINER_LOG_HINT}. The code "
757+
"changes when the database state changes. No entry was "
758+
"changed.</p>",
749759
),
750760
"text/html; charset=utf-8",
751761
)

0 commit comments

Comments
 (0)