diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d8c7c0f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# Force Unix line endings for shell scripts so Docker builds +# work regardless of the user's core.autocrlf setting. +*.sh text eol=lf +docker-entrypoint.sh text eol=lf +Dockerfile text eol=lf diff --git a/CHANGELOG.md b/CHANGELOG.md index 65550f3..af36d58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,24 @@ Format follows [Keep a Changelog](https://keepachangelog.com/). Haven uses [Sema --- +## [1.9.1] — 2026-02-18 + +### Added +- **Custom server emojis** — admins can upload PNG/GIF/WebP images as custom emojis (`:emoji_name:` syntax). Works in messages, reactions, and the emoji picker. +- **Emoji quickbar customization** — click the ⚙️ gear icon on the reaction picker to swap any of the 8 quick-react slots with any emoji (including custom ones). Saved per-user in localStorage. +- **DM deletion** — right-click (or click "...") on any DM conversation to delete it. Removes from your sidebar only. +- **Reply banner click-to-scroll** — clicking the reply preview above a message now smooth-scrolls to the original message and highlights it briefly. +- **Settings navigation sidebar** — the settings modal now has a left-side index with clickable categories (Layout, Sounds, Push, Password, and all admin subsections). Hidden on mobile. +- **Popout modals for sounds & emojis** — Custom Sounds and Custom Emojis management moved out of the inline settings panel into their own dedicated modals (like Bots/Roles). Keeps the settings menu lean. +- **JWT identity cross-check** — tokens are now validated against the actual database user, preventing token reuse across accounts (security hardening). + +### Fixed +- **Docker entrypoint CRLF crash** — added `.gitattributes` to force LF line endings on shell scripts, plus a `sed` fallback in the Dockerfile. +- **Quick emoji editor immediately closing** — click events inside the editor propagated to the document-level close handler. Added `stopPropagation()` to all interactive elements. +- **Gear icon placement** — moved the ⚙️ customization button to the right of the "⋯" more-emojis button so frequent "..." clicks aren't blocked. + +--- + ## [1.9.0] — 2026-02-17 ### Added diff --git a/Dockerfile b/Dockerfile index 64149ad..252bf8d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,53 +1,53 @@ -# ── Haven Dockerfile ───────────────────────────────────── -# Lightweight Node.js image with SSL cert auto-generation. -# Data (database, .env, certs, uploads) is stored in /data -# so it survives container rebuilds. -# -# Build: docker build -t haven . -# Run: docker compose up -d -# ───────────────────────────────────────────────────────── - -FROM node:20-alpine - -# OpenSSL → auto-generate self-signed HTTPS certs -# tini → proper PID 1 signal handling (clean shutdown) -# su-exec → drop root to 'node' user after entrypoint setup -# build-base, python3 → compile native modules (better-sqlite3) -RUN apk update && apk add --no-cache \ - openssl tini su-exec \ - build-base python3 - -WORKDIR /app - -# Install dependencies first (layer caching — only re-runs when package.json changes) -COPY package*.json ./ -RUN npm ci --omit=dev && \ - # Remove build tools after native modules are compiled (saves ~150 MB) - apk del build-base python3 && \ - rm -rf /root/.cache /tmp/* - -# Copy entrypoint (auto-generates SSL certs, fixes volume permissions) -COPY docker-entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -# Copy application source -COPY . . - -# ── Environment defaults (override via docker-compose.yml or .env) ── -ENV PORT=3000 \ - HOST=0.0.0.0 \ - HAVEN_DATA_DIR=/data \ - NODE_ENV=production - -# Create data directory; give ownership to non-root 'node' user -RUN mkdir -p /data/certs /data/uploads && chown -R node:node /app /data - -USER root -EXPOSE 3000 3001 -VOLUME ["/data"] - -HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ - CMD wget -qO- --no-check-certificate https://127.0.0.1:${PORT:-3000}/api/health || exit 1 - -ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"] +# ── Haven Dockerfile ───────────────────────────────────── +# Lightweight Node.js image with SSL cert auto-generation. +# Data (database, .env, certs, uploads) is stored in /data +# so it survives container rebuilds. +# +# Build: docker build -t haven . +# Run: docker compose up -d +# ───────────────────────────────────────────────────────── + +FROM node:20-alpine + +# OpenSSL → auto-generate self-signed HTTPS certs +# tini → proper PID 1 signal handling (clean shutdown) +# su-exec → drop root to 'node' user after entrypoint setup +# build-base, python3 → compile native modules (better-sqlite3) +RUN apk update && apk add --no-cache \ + openssl tini su-exec \ + build-base python3 + +WORKDIR /app + +# Install dependencies first (layer caching — only re-runs when package.json changes) +COPY package*.json ./ +RUN npm ci --omit=dev && \ + # Remove build tools after native modules are compiled (saves ~150 MB) + apk del build-base python3 && \ + rm -rf /root/.cache /tmp/* + +# Copy entrypoint (auto-generates SSL certs, fixes volume permissions) +COPY docker-entrypoint.sh /entrypoint.sh +RUN sed -i 's/\r$//' /entrypoint.sh && chmod +x /entrypoint.sh + +# Copy application source +COPY . . + +# ── Environment defaults (override via docker-compose.yml or .env) ── +ENV PORT=3000 \ + HOST=0.0.0.0 \ + HAVEN_DATA_DIR=/data \ + NODE_ENV=production + +# Create data directory; give ownership to non-root 'node' user +RUN mkdir -p /data/certs /data/uploads && chown -R node:node /app /data + +USER root +EXPOSE 3000 3001 +VOLUME ["/data"] + +HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ + CMD wget -qO- --no-check-certificate https://127.0.0.1:${PORT:-3000}/api/health || exit 1 + +ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"] CMD ["node", "server.js"] \ No newline at end of file diff --git a/package.json b/package.json index bb56057..26dd1f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "haven", - "version": "1.9.0", + "version": "1.9.1", "description": "Self-hosted private chat — your server, your rules", "license": "MIT-NC", "main": "server.js", diff --git a/public/app.html b/public/app.html index 84b0923..4d99102 100644 --- a/public/app.html +++ b/public/app.html @@ -29,6 +29,9 @@ + @@ -711,8 +714,31 @@ +
+ +
+ -
+
📐 Layout Density
-
+
🔔 Sounds
-
+
📲 Push Notifications
-
+
🔒 Password
@@ -834,7 +860,7 @@
🛡️ Admin
-
+
🏠 Server Branding
-
+
-
+
🌐 Server Invite Code
A single code that adds people to every channel & sub-channel on the server
@@ -897,7 +923,7 @@
-
+
🗑️ Auto-Cleanup
-
-
� File Uploads
+
+
📁 File Uploads
Maximum file size users can upload (1–2048 MB / 2 GB, default 25)
-
-
�🔊 Custom Sounds
- Upload audio files for custom notification sounds (max 1 MB each) +
+
🔊 Custom Sounds
+ Upload audio files for custom notification sounds
-
- - - -
-
-

No custom sounds uploaded

-
+ +
+
+
+
😎 Custom Emojis
+ Upload images for custom server emojis +
+
-
+
👑 Role Management
Create and manage roles. Assign roles to users from the user list context menu.
@@ -949,7 +975,7 @@
-
+
🧭 Tunnel
-
+
🤖 Webhooks / Bots
Create and manage webhook bots that can post messages to channels.
@@ -976,7 +1002,7 @@
-
+
🔧 Mod Mode
Rearrange sidebar sections and snap server/sidebar/status panels @@ -988,6 +1014,8 @@ Changes only apply when you click Save. Close (✕) to cancel.
+
+
@@ -1052,6 +1080,44 @@
+ + + + + + + + + + + +