Add automatic SSL certificate generation
All checks were successful
Build and Push / build-all (push) Successful in 8m13s
All checks were successful
Build and Push / build-all (push) Successful in 8m13s
This commit is contained in:
parent
e13fffdaac
commit
42855330c0
11 changed files with 105 additions and 38 deletions
|
|
@ -152,6 +152,8 @@ class ChatWebSocket {
|
|||
...info,
|
||||
username: data.newName
|
||||
}));
|
||||
// Persist to localStorage for reconnection
|
||||
localStorage.setItem('guestName', data.newName);
|
||||
console.log('Rename successful:', data.newName);
|
||||
break;
|
||||
|
||||
|
|
@ -173,7 +175,10 @@ class ChatWebSocket {
|
|||
|
||||
case 'error':
|
||||
console.error('Chat error:', data.error);
|
||||
// Optionally show error to user
|
||||
// Show error to user
|
||||
if (data.error && typeof window !== 'undefined') {
|
||||
alert(data.error);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'mod_action_success':
|
||||
|
|
|
|||
|
|
@ -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
|
||||
});
|
||||
|
|
|
|||
|
|
@ -271,16 +271,9 @@
|
|||
}
|
||||
|
||||
// Send rename message to server
|
||||
// Note: State updates (localStorage + store) happen in rename_success handler
|
||||
// to avoid updating UI before server confirms the rename
|
||||
if (chatWebSocket.sendRename(newGuestName.trim())) {
|
||||
// Store in localStorage for persistence
|
||||
localStorage.setItem('guestName', newGuestName.trim());
|
||||
|
||||
// Update local store
|
||||
chatUserInfo.update(info => ({
|
||||
...info,
|
||||
username: newGuestName.trim()
|
||||
}));
|
||||
|
||||
showRenameModal = false;
|
||||
newGuestName = '';
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue