updated golive playbook based on newer version of claude

This commit is contained in:
derekc committed 2026-10-10 23:38:03 -07:00
1 parent a9ea139093
commit e3feec67aa
2 files changed
+164 -40

No files matched your search

+20 -7
View File
@@ -138,33 +138,46 @@ services:
## Ntfy Notifications
- All web apps must integrate Ntfy push notifications for admin-relevant events
- Use a self-hosted Ntfy instance; URL and topic stored in `.env` — never hardcoded
- Use a self-hosted Ntfy instance; URL, topic, and access token stored in `.env` — never hardcoded
- The topic must be access-protected on the Ntfy server so only the admin can subscribe; the app publishes with a token
- Send notifications via HTTP POST using `httpx` (async) — do not add a separate Ntfy library
```python
# app/utils/notify.py
import logging
import httpx
from app.config import settings
logger = logging.getLogger(__name__)
async def notify(title: str, message: str, priority: str = "default", tags: list[str] | None = None):
"""Send an admin notification. Never raises — a failed notification must not break the request."""
headers = {
"Title": title,
"Priority": priority,
"Authorization": f"Bearer {settings.ntfy_token}",
}
if tags:
headers["Tags"] = ",".join(tags)
async with httpx.AsyncClient() as client:
await client.post(
f"{settings.ntfy_url}/{settings.ntfy_topic}",
content=message,
headers=headers,
)
try:
# Short timeout so a slow/unreachable Ntfy server can't stall the app
async with httpx.AsyncClient(timeout=5.0) as client:
response = await client.post(
f"{settings.ntfy_url}/{settings.ntfy_topic}",
content=message,
headers=headers,
)
response.raise_for_status()
except Exception as exc:
logger.error("Ntfy notification failed: %s", exc)
```
**Required `.env` variables:**
```
NTFY_URL=https://ntfy.example.com
NTFY_TOPIC=your-topic
NTFY_TOKEN=tk_your-access-token
```
**Standard events to notify on** (adapt to what the app actually does):