notify: honor fixed ntfy topic
This commit is contained in:
@@ -6,6 +6,7 @@ PROMPT_CATEGORY=general
|
|||||||
PROMPT_NAME=welcome
|
PROMPT_NAME=welcome
|
||||||
PROMPT_CONTEXT=Container test run
|
PROMPT_CONTEXT=Container test run
|
||||||
NTFY_BASE_URL=https://ntfy.example.com
|
NTFY_BASE_URL=https://ntfy.example.com
|
||||||
|
NTFY_TOPIC=
|
||||||
NTFY_TOPIC_TEMPLATE=adhdbot-{userId}
|
NTFY_TOPIC_TEMPLATE=adhdbot-{userId}
|
||||||
NTFY_AUTH_TOKEN=
|
NTFY_AUTH_TOKEN=
|
||||||
AGENTIC_CATEGORY=agentic
|
AGENTIC_CATEGORY=agentic
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ from Memory import MemoryManager
|
|||||||
|
|
||||||
|
|
||||||
ntfyBaseUrl = os.getenv("NTFY_BASE_URL")
|
ntfyBaseUrl = os.getenv("NTFY_BASE_URL")
|
||||||
|
ntfyFixedTopic = os.getenv("NTFY_TOPIC")
|
||||||
ntfyTopicTemplate = os.getenv("NTFY_TOPIC_TEMPLATE", "adhdbot-{userId}")
|
ntfyTopicTemplate = os.getenv("NTFY_TOPIC_TEMPLATE", "adhdbot-{userId}")
|
||||||
ntfyAuthToken = os.getenv("NTFY_AUTH_TOKEN")
|
ntfyAuthToken = os.getenv("NTFY_AUTH_TOKEN")
|
||||||
|
|
||||||
@@ -76,6 +77,9 @@ class NotificationDispatcher:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def buildTopic(actualUser: str) -> str:
|
def buildTopic(actualUser: str) -> str:
|
||||||
|
fixed = (ntfyFixedTopic or "").strip()
|
||||||
|
if fixed:
|
||||||
|
return fixed
|
||||||
template = ntfyTopicTemplate or ""
|
template = ntfyTopicTemplate or ""
|
||||||
if not template:
|
if not template:
|
||||||
return ""
|
return ""
|
||||||
|
|||||||
@@ -99,7 +99,8 @@ Environment variables of interest (see `.env.example`):
|
|||||||
- `PROMPT_CATEGORY`, `PROMPT_NAME`, `PROMPT_CONTEXT` – defaults for the `/run` endpoint.
|
- `PROMPT_CATEGORY`, `PROMPT_NAME`, `PROMPT_CONTEXT` – defaults for the `/run` endpoint.
|
||||||
- `LOG_PROMPTS` (default `1`) – when truthy, every outgoing prompt is logged to stdout so you can audit the final instructions sent to the LLM.
|
- `LOG_PROMPTS` (default `1`) – when truthy, every outgoing prompt is logged to stdout so you can audit the final instructions sent to the LLM.
|
||||||
- `NTFY_BASE_URL` – when set (e.g., `https://ntfy.scorpi.us`), reminder payloads with `action: schedule_reminder` will be POSTed to ntfy.
|
- `NTFY_BASE_URL` – when set (e.g., `https://ntfy.scorpi.us`), reminder payloads with `action: schedule_reminder` will be POSTed to ntfy.
|
||||||
- `NTFY_TOPIC_TEMPLATE` – format string for the ntfy topic slug (default `adhdbot-{userId}`); all reminders are forced through this template so every notification lands in the same subscribed channel.
|
- `NTFY_TOPIC` – optional fixed topic slug; when present every reminder is sent to exactly this channel (e.g., `adhdbot-chelsea`).
|
||||||
|
- `NTFY_TOPIC_TEMPLATE` – fallback format string for the topic when `NTFY_TOPIC` is unset (default `adhdbot-{userId}`).
|
||||||
- `NTFY_AUTH_TOKEN` – optional bearer token if your ntfy server requires auth.
|
- `NTFY_AUTH_TOKEN` – optional bearer token if your ntfy server requires auth.
|
||||||
- `AGENTIC_CATEGORY` / `AGENTIC_PROMPT_NAME` / `AGENTIC_MODE_HINT` – control which prompt handles the hourly agentic sweep (defaults: `agentic/hourly_review`, hint "Agentic review").
|
- `AGENTIC_CATEGORY` / `AGENTIC_PROMPT_NAME` / `AGENTIC_MODE_HINT` – control which prompt handles the hourly agentic sweep (defaults: `agentic/hourly_review`, hint "Agentic review").
|
||||||
- `AGENTIC_NOTES_LIMIT` – how many of the most recent notes to include in the sweep payload (default `5`).
|
- `AGENTIC_NOTES_LIMIT` – how many of the most recent notes to include in the sweep payload (default `5`).
|
||||||
@@ -128,7 +129,7 @@ When the assistant schedules a reminder it emits a single JSON block:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The backend automatically converts relative phrases ("in 10 minutes") into the ISO timestamp above and POSTs the message to the ntfy topic (default `https://ntfy.scorpi.us/adhdbot-<user>`), so subscribing to that topic on your phone is all you need for push notifications.
|
The backend automatically converts relative phrases ("in 10 minutes") into the ISO timestamp above and POSTs the message to the ntfy topic (either the fixed `NTFY_TOPIC` or the templated `https://ntfy.scorpi.us/adhdbot-<user>` fallback), so subscribing to that topic on your phone is all you need for push notifications.
|
||||||
|
|
||||||
### Daily / Periodic Action List + Hourly Agentic Sweep
|
### Daily / Periodic Action List + Hourly Agentic Sweep
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user