Fix: Use NTFY_URL env var instead of NTFY_TOPIC

This commit is contained in:
2025-12-16 05:29:29 -08:00
parent 230e9e2b8b
commit d4426deb85

View File

@@ -92,7 +92,7 @@ export class MyDurableObject {
} }
notify(msg, pri = 3, tags = []) { notify(msg, pri = 3, tags = []) {
if (!this.env.NTFY_TOPIC) return; if (!this.env.NTFY_URL) return;
const attachment = this.getConversationText(); const attachment = this.getConversationText();
const headers = { Title: 'Sune ORP', Priority: `${pri}`, Tags: tags.join(',') }; const headers = { Title: 'Sune ORP', Priority: `${pri}`, Tags: tags.join(',') };
let body = msg; let body = msg;
@@ -102,7 +102,7 @@ export class MyDurableObject {
headers['Content-Type'] = 'text/markdown'; headers['Content-Type'] = 'text/markdown';
body = attachment; body = attachment;
} }
this.state.waitUntil(fetch(`https://ntfy.sh/${this.env.NTFY_TOPIC}`, { this.state.waitUntil(fetch(this.env.NTFY_URL, {
method: 'POST', method: 'POST',
body, body,
headers, headers,
@@ -442,4 +442,3 @@ export class MyDurableObject {
return contents; return contents;
} }
} }