|
51 | 51 | # The approval code proves that the person has read the report file. The page |
52 | 52 | # must never show it, or the code proves only that they opened the page. |
53 | 53 | _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 | + "<container></code>) and search for "approval code"" |
| 61 | +) |
54 | 62 |
|
55 | 63 | _HELP_LINKS = ( |
56 | 64 | ("Report a problem", "https://github.com/dannyvfilms/Floppy/issues"), |
@@ -375,7 +383,7 @@ def render_page( |
375 | 383 | body = ( |
376 | 384 | "<h1>Your data is safe. Nothing was deleted.</h1>" |
377 | 385 | "<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>" |
379 | 387 | + _help_card() |
380 | 388 | ) |
381 | 389 | return _document(body) |
@@ -446,9 +454,10 @@ def render_page( |
446 | 454 | parts.append( |
447 | 455 | "<div class='card'><h2>Repair the relationships, then start</h2>" |
448 | 456 | 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>" |
452 | 461 | "<form method='POST' action='/quarantine'>" |
453 | 462 | "<p><label for='recovery-token'>Approval code</label><br>" |
454 | 463 | "<input id='recovery-token' name='token' required autocomplete='off' " |
@@ -506,7 +515,7 @@ def _waiting_page() -> str: |
506 | 515 | "<p role='status'>Floppy is applying it, then starting. This can take " |
507 | 516 | "several minutes on a large database. You can leave this page open.</p>" |
508 | 517 | "<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>" |
510 | 519 | "<p><a class='button' href='/'>Open Floppy</a></p>" |
511 | 520 | "</div>" |
512 | 521 | ) |
@@ -744,8 +753,9 @@ def do_POST(self) -> None: |
744 | 753 | 403, |
745 | 754 | _document( |
746 | 755 | "<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>", |
749 | 759 | ), |
750 | 760 | "text/html; charset=utf-8", |
751 | 761 | ) |
|
0 commit comments