UI: warm daylight design system (Tailwind v4 @theme palette, gh-* component classes, watercolor grain, Zen Maru Gothic + Klee One fonts), animated SSR-safe GhibliBackground (drifting clouds, meadow hills, soot sprites), and a full reskin of navbar, connect button, dapp page, loan cards, settings modal, and readme. Fixes the bg-white-on-dark loan-card inconsistency. Web3/business logic untouched. Docs: converted docs/ into an Obsidian vault (frontmatter, [[wikilinks]], callouts, Home MOC, folders Architecture/Operations/Audits) and added a full-project audit note (Project Audit 2026-06). Redacted a real leaked Schedy key value from the security audit example (rotate it at Schedy). Also commits the previously-untracked server layer: app/api (cron + tasks routes) and lib (redis, ssrf-guard, task-store). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3.6 KiB
3.6 KiB
title, tags, type, status, updated
| title | tags | type | status | updated | |||
|---|---|---|---|---|---|---|---|
| Alert Changes |
|
operations | reference | 2026-06-14 |
Alert Changes
Alert branch: notification and scheduling changes
This branch introduces a single‑alert scheduling flow, clearer alert copy, and an ntfy email setup via Docker Compose env vars.
Changes
- Single scheduled alert per position
- Replaced multi-job scheduling with
scheduleNotification(row)that returns{ jobId, runAt }. - Toggle stores
{ enabled, jobId, scheduledAt }. - Auto-rescheduler keeps a single job in sync.
- Replaced multi-job scheduling with
- Message improvements
- Time window shows the configured lead offset (e.g.,
~10d) instead of remaining time at execution. - Payment guidance prioritizes Debt Remaining; fallbacks: 1.5× monthly, then current payment pending.
- Collateral at risk uses the same formatting as the UI:
fmt(row.coinSize, coinDecimals, 8)+ token symbol (e.g.,0.05651738 cbBTC).
- Time window shows the configured lead offset (e.g.,
- Test alert sends email
scheduleTestNotification()now includesX-Emailfrom settings to trigger ntfy email in addition to topic publish.
- ntfy SMTP via Docker Compose
- Configure Gmail/App Password or another SMTP via env vars in compose instead of a server.yml.
Files modified
mortgagefi-frontend/app/dapp/page.tsx- Toggle handler uses
scheduleNotification()and stores{ jobId, scheduledAt }. scheduleNotification()builds improved message and schedules one Schedy job.
- Toggle handler uses
mortgagefi-frontend/utils/scheduler.tsscheduleTestNotification()addsX-Emailheader.
docker-compose.yml(root)- ntfy service accepts SMTP settings via env vars (with defaults). You can also pass them via
env_file.
- ntfy service accepts SMTP settings via env vars (with defaults). You can also pass them via
Configure SMTP (ntfy)
Set these in .env or .env.local (compose resolves ${VAR} from .env or shell; using env_file, list bare keys in environment: to pass-through values):
NTFY_BASE_URL=https://web.example.com/ntfy # must match your public URL & subpath
NTFY_SMTP_SENDER_ADDR=smtp.gmail.com:587 # or smtp-relay / your SMTP
NTFY_SMTP_SENDER_USER=your.name@gmail.com # Gmail address or relay user
NTFY_SMTP_SENDER_PASS=app-password-xxxx # Gmail App Password
NTFY_SMTP_SENDER_FROM=your.name@gmail.com # From address
NTFY_LOG_LEVEL=info
Compose snippet (Option A: pass-through via env_file):
services:
ntfy:
image: binwiederhier/ntfy
command: ["serve"]
env_file: .env.local
environment:
- TZ=Europe/Zurich
- NTFY_BASE_URL
- NTFY_SMTP_SENDER_ADDR
- NTFY_SMTP_SENDER_USER
- NTFY_SMTP_SENDER_PASS
- NTFY_SMTP_SENDER_FROM
- NTFY_LOG_LEVEL
Bring up services
- Populate
.envor.env.localwith:
NEXT_PUBLIC_NTFY_URL=/ntfyNEXT_PUBLIC_SCHEDY_URL=/schedyNEXT_PUBLIC_SCHEDY_API_KEY=<schedy_api_key>- SMTP variables above.
- Start stack from repo root:
docker compose up -d
- Access:
- App:
http://localhost - ntfy (proxied):
http://localhost/ntfy - schedy (proxied):
http://localhost/schedy
Verify email path
- Settings → Provider: ntfy, set Server+Topic, Email, Scheduler: Schedy + API key.
- Click “Send test alert”. Expect both topic message and email.
- Manual test:
curl -X POST -H 'Content-Type: text/plain' -H 'X-Email: your.name@gmail.com' \
https://web.example.com/ntfy/yourtopic -d 'Email test via ntfy SMTP'
Notes
Note
- Ensure
NTFY_BASE_URLincludes/ntfyif you serve ntfy under a subpath.- For compose variable interpolation with
${VAR}, put values in.env(not.env.local) or export them in the shell. Usingenv_file, prefer pass-through keys as shown above.