Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/diagnose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ jobs:
date -u || true
sudo docker exec ib-gateway bash -lc 'date -u || true' || true
sudo docker exec ib-gateway bash -lc 'python3 - <<'"'"'PY'"'"'
import os
import time

print("container_epoch", int(time.time()))
if os.environ.get("TOTP_SECRET"):
print("totp_seconds_remaining", 30 - (int(time.time()) % 30))
else:
print("totp_secret_present", False)
PY' || true
import os
import time

print("container_epoch", int(time.time()))
if os.environ.get("TOTP_SECRET"):
print("totp_seconds_remaining", 30 - (int(time.time()) % 30))
else:
print("totp_secret_present", False)
PY' || true
Comment on lines +104 to +112

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Unindent Python heredoc payload passed to bash

Indenting the heredoc body/terminator inside bash -lc 'python3 - <<'PY' ... PY' causes the command to mis-parse at runtime: bash does not match an indented PY terminator, and the preserved leading spaces make top-level Python lines raise IndentationError. In this workflow step, that means the container_epoch / totp_seconds_remaining diagnostics are never produced (the failure is masked by || true).

Useful? React with 👍 / 👎.


section "docker compose ps"
sudo docker compose ps || true
Expand Down