Add automatic SSL certificate generation
All checks were successful
Build and Push / build-all (push) Successful in 8m13s

This commit is contained in:
doomtube 2026-01-06 15:22:41 -05:00
parent e13fffdaac
commit 42855330c0
11 changed files with 105 additions and 38 deletions

View file

@ -144,7 +144,7 @@
msg = msg.replace(/^#\s+:(\w+):$/gm, (match, stickerName) => {
const stickerKey = stickerName.toLowerCase();
if (stickersMap[stickerKey]) {
return `# <img src="${stickersMap[stickerKey]}" alt="${stickerName}" title="${stickerName}" data-sticker="${stickerName}" class="sticker-img" />`;
return `# <img src="${stickersMap[stickerKey]}" alt="${stickerName}" title="${stickerName}" data-sticker="${stickerName}" class="sticker-img" onerror="this.onerror=null;this.src='/dlive2.gif';" />`;
}
return match;
});
@ -153,7 +153,7 @@
msg = msg.replace(/^##\s+:(\w+):$/gm, (match, stickerName) => {
const stickerKey = stickerName.toLowerCase();
if (stickersMap[stickerKey]) {
return `## <img src="${stickersMap[stickerKey]}" alt="${stickerName}" title="${stickerName}" data-sticker="${stickerName}" class="sticker-img" />`;
return `## <img src="${stickersMap[stickerKey]}" alt="${stickerName}" title="${stickerName}" data-sticker="${stickerName}" class="sticker-img" onerror="this.onerror=null;this.src='/dlive2.gif';" />`;
}
return match;
});
@ -164,7 +164,7 @@
msg = msg.replace(/:(\w+):/g, (match, stickerName) => {
const stickerKey = stickerName.toLowerCase();
if (stickersMap[stickerKey]) {
return `<img src="${stickersMap[stickerKey]}" alt="${stickerName}" title="${stickerName}" data-sticker="${stickerName}" class="sticker-img" />`;
return `<img src="${stickersMap[stickerKey]}" alt="${stickerName}" title="${stickerName}" data-sticker="${stickerName}" class="sticker-img" onerror="this.onerror=null;this.src='/dlive2.gif';" />`;
}
return match;
});
@ -185,7 +185,7 @@
// Step 5: Sanitize with DOMPurify - allow img tags and safe CSS
html = DOMPurify.sanitize(html, {
ALLOWED_TAGS: ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'img', 'br', 'strong', 'em', 'code', 'pre', 'del', 'span'],
ALLOWED_ATTR: ['src', 'alt', 'title', 'class', 'style', 'data-sticker'],
ALLOWED_ATTR: ['src', 'alt', 'title', 'class', 'style', 'data-sticker', 'onerror'],
FORBID_TAGS: ['a', 'button', 'script'],
ALLOW_DATA_ATTR: false
});