[READ-ONLY] Mirror of https://github.com/FoxxMD/komodo-utilities. Small utilities to enhance Komodo
gotify komodo
0

Configure Feed

Select the types of activity you want to include in your feed.

feat(apprise): Add markdown ENV option

FoxxMD (Jan 13, 2025, 11:56 AM EST) 35c7d0c3 2eef9750

+6 -2
+6 -2
notifiers/apprise/program.ts
··· 5 5 import { nonEmptyStringOrDefault, normalizeWebAddress, parseArrayFromMaybeString, truncateStringToLength } from "../common/stringUtils.ts"; 6 6 import { isPortReachable, joinedUrl } from "../common/networkUtils.ts"; 7 7 import { titleAndSubtitle } from "../common/notifierBuilder.ts"; 8 + import { valToBoolean } from "../../common/utils.ts"; 8 9 9 10 interface AppriseOptions { 10 11 endpoint: URLData 11 12 urls: string[] 12 13 keys: string[] 13 14 tag?: string 15 + markdown?: boolean 14 16 } 15 17 16 18 const upstreamFailureHint = 'HINT: Status 424 means a dependency upstream of Apprise failed. This is usually a connection or authentication issue. Check Apprise logs to see more details.'; ··· 18 20 const shortKey = truncateStringToLength(10); 19 21 20 22 const parseAppriseOptions = async (): Promise<AppriseOptions> => { 23 + 24 + const markdown = valToBoolean(Deno.env.get("MARKDOWN")); 21 25 22 26 const host = nonEmptyStringOrDefault(Deno.env.get("APPRISE_HOST") as string); 23 27 ··· 64 68 } 65 69 } 66 70 67 - return {endpoint, urls, keys, tag}; 71 + return {endpoint, urls, keys, tag, markdown}; 68 72 } 69 73 70 74 const callApi = async (req: Request): Promise<Response> => { ··· 204 208 let data: CommonAlert; 205 209 206 210 try { 207 - data = parseAlert(alert, { ...commonOpts }); 211 + data = parseAlert(alert, { ...commonOpts, markdown: appriseOptions.markdown }); 208 212 } catch (e) { 209 213 console.debug("Komodo Alert Payload:", alert); 210 214 console.error(e);