Add ntfy authentication support (username/password and API key)

- Settings table gets ntfy_username, ntfy_password, ntfy_api_key columns
- Backend applies Basic or Bearer auth header when sending notifications
- Settings page UI lets you toggle between no auth, basic, or token auth
- Masked credential display on load to avoid exposing stored secrets
- README updated with auth modes documentation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 23:49:54 -07:00
parent 1ff44e4276
commit 1bed02ebb5
8 changed files with 109 additions and 16 deletions

View File

@@ -182,6 +182,37 @@
<input type="text" id="s-ntfy-topic" class="form-input" placeholder="my-garden-alerts" />
<span class="form-hint">Subscribe to this topic in the ntfy app</span>
</div>
<div class="form-group">
<label class="form-label">Authentication</label>
<div class="auth-toggle">
<label class="auth-toggle-option">
<input type="radio" name="ntfy-auth-type" value="none" checked onchange="App.toggleNtfyAuth(this.value)" /> None
</label>
<label class="auth-toggle-option">
<input type="radio" name="ntfy-auth-type" value="basic" onchange="App.toggleNtfyAuth(this.value)" /> Username &amp; Password
</label>
<label class="auth-toggle-option">
<input type="radio" name="ntfy-auth-type" value="token" onchange="App.toggleNtfyAuth(this.value)" /> API Key / Token
</label>
</div>
</div>
<div id="ntfy-basic-auth" class="hidden">
<div class="form-group">
<label class="form-label">Username</label>
<input type="text" id="s-ntfy-username" class="form-input" placeholder="ntfy username" autocomplete="off" />
</div>
<div class="form-group">
<label class="form-label">Password</label>
<input type="password" id="s-ntfy-password" class="form-input" placeholder="ntfy password" autocomplete="off" />
</div>
</div>
<div id="ntfy-token-auth" class="hidden">
<div class="form-group">
<label class="form-label">API Key / Access Token</label>
<input type="password" id="s-ntfy-api-key" class="form-input" placeholder="tk_..." autocomplete="off" />
<span class="form-hint">Generate in ntfy account settings</span>
</div>
</div>
<div class="form-group">
<label class="form-label">Daily Summary Time</label>
<input type="time" id="s-notif-time" class="form-input" />