mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-06-27 13:31:05 +02:00
Merge remote-tracking branch 'origin/main' into fred777-add_bot_globals
This commit is contained in:
@@ -132,6 +132,7 @@ HTTP webhook delivery. Config blob:
|
||||
Push notifications via Apprise library. Config blob:
|
||||
- `urls` — newline-separated Apprise notification service URLs
|
||||
- `preserve_identity` — suppress Discord webhook name/avatar override
|
||||
- `include_outgoing` — when true, RemoteTerm-originated manual and bot-sent messages are forwarded to Apprise; missing/false preserves the legacy incoming-only behavior
|
||||
- `include_path` — include routing path in notification body
|
||||
- Channel notifications normalize stored message text by stripping a leading `"{sender_name}: "` prefix when it matches the payload sender so alerts do not duplicate the name.
|
||||
|
||||
|
||||
@@ -188,14 +188,15 @@ def _send_sync(urls_raw: str, body: str, *, preserve_identity: bool, markdown: b
|
||||
|
||||
|
||||
class AppriseModule(FanoutModule):
|
||||
"""Sends push notifications via Apprise for incoming messages."""
|
||||
"""Sends push notifications via Apprise for matched messages."""
|
||||
|
||||
def __init__(self, config_id: str, config: dict, *, name: str = "") -> None:
|
||||
super().__init__(config_id, config, name=name)
|
||||
|
||||
async def on_message(self, data: dict) -> None:
|
||||
# Skip outgoing messages — only notify on incoming
|
||||
if data.get("outgoing"):
|
||||
# Skip outgoing messages by default. Operators can opt in when they
|
||||
# want RemoteTerm-originated manual/bot sends mirrored to Apprise.
|
||||
if data.get("outgoing") and not self.config.get("include_outgoing", False):
|
||||
return
|
||||
|
||||
urls = self.config.get("urls", "")
|
||||
|
||||
@@ -274,9 +274,8 @@ def _validate_apprise_config(config: dict) -> None:
|
||||
status_code=400, detail=f"Invalid format string in {field}"
|
||||
) from None
|
||||
|
||||
markdown_format = config.get("markdown_format")
|
||||
if markdown_format is not None:
|
||||
config["markdown_format"] = bool(markdown_format)
|
||||
config["markdown_format"] = bool(config.get("markdown_format", True))
|
||||
config["include_outgoing"] = bool(config.get("include_outgoing", False))
|
||||
|
||||
|
||||
def _validate_webhook_config(config: dict) -> None:
|
||||
|
||||
Reference in New Issue
Block a user