relay: address the account by phone number and pass the message via -m

signal-cli 0.14.7 parses an all-digit -a value as a phone number (the
numeric account name never resolves), and the message is a -m option,
not a positional (a positional is parsed as a second recipient).
Verified live: corrected invocation returns type SUCCESS.
This commit is contained in:
Frank
2026-09-17 18:28:20 -07:00
parent f73a7e80a1
commit 698759c61e
3 changed files with 12 additions and 5 deletions
+8 -3
View File
@@ -33,8 +33,12 @@ from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
# podman bridge subnet (10.89.0.0/16) only, keeping the unauthenticated
# endpoint off the rest of the LAN.
LISTEN_ADDR = ("192.168.0.143", 18093)
SIGNAL_CLI = "/usr/local/bin/signal-cli"
SIGNAL_ACCOUNT = "318311"
# The account is addressed by phone number: signal-cli 0.14.7's -a flag
# parses an all-digit value as a phone number and never falls back to the
# accounts.json name (the numeric name 318311 dies with "Invalid account
# (phone number)"). The number is a number, not a credential — the
# credential is the account state under ~/.local/share/signal-cli.
SIGNAL_ACCOUNT = "+12062476336"
SIGNAL_TO = "+12062476336"
# The relay is a safety net, not the rate limiter: Alertmanager already
@@ -86,7 +90,8 @@ def send_signal(text):
return False
try:
proc = subprocess.run(
[SIGNAL_CLI, "-a", SIGNAL_ACCOUNT, "-o", "json", "send", SIGNAL_TO, text],
[SIGNAL_CLI, "-a", SIGNAL_ACCOUNT, "-o", "json", "send", SIGNAL_TO,
"-m", text],
capture_output=True, text=True, timeout=30,
)
except subprocess.TimeoutExpired: