Skip to content

Configure

262 Topics 4.6k Posts

Having issues with configuration ?

Subcategories


  • Looking to revamp your site layout?

    131 2k
    131 Topics
    2k Posts
    Hey everyone, I’m not sure where to post this, I’ll let @phenomlab edit it if necessary. Already posted here : https://community.nodebb.org/topic/19318/focus-mode-simply-immersive-reading-for-nodebb I’ve been working on a small client-side script that adds an simply immersive reading mode to NodeBB. No plugin required, just a few lines of custom JS and CSS dropped into the ACP. I’m just sharing this here for fun : https://github.com/DroidBV8/nodebb-focus-mode [image: input.gif] What it does Pressing F (or clicking the icon in the right sidebar) hides everything that isn’t the content you’re trying to read: Both sidebars Header / brand bar Footer Topic thumbnails and sidebar tools (reply, follow, timeline) The content area reflows to a centered 860px column, font size bumps up slightly, and a reading progress bar appears at the top of the page. To exit: press F again, Escape, or click the floating button that appears in the bottom-right corner. Details Activation effect : a subtle CRT glitch effect plays on toggle. Three CSS variables let you dial the intensity up or down without touching the keyframes: --fm-glitch-opacity: 1; /* 0.5 = subtle | 2 = heavy */ --fm-glitch-skew: 1deg; --fm-glitch-shift: 4px; Keyboard : F to toggle. Ctrl+F, Cmd+F and Alt+F are ignored so you don’t accidentally trigger it when searching the page. Scroll preservation : when toggling, the layout shifts because sidebars appear/disappear. The script measures the position of the nearest visible post before and after the layout change, then compensates with scrollBy so you stay exactly where you were. Topic-only : the button is greyed out on non-topic pages with a tooltip explaining why. Pressing F outside a topic shows a small toast instead of doing nothing silently. Mobile: disabled entirely under 768px. No button injected, no state restored. Theming : all colors reference Bootstrap CSS variables (--bs-body-bg, --bs-border-color, --bs-primary, etc.) so it adapts automatically to any NodeBB theme, light or dark. State : saved in localStorage, restored on next visit. Uses try/catch so it degrades gracefully in private browsing. Implementation notes The script is a self-contained IIFE, hooking into the standard NodeBB client-side events: $(window).on('action:ajaxify.end', function () { focusMode(); }); $(window).on('action:topic.loaded', function () { focusMode(); }); // etc. The glitch effect is pure CSS @keyframes , the JS only adds/removes classes. Layout compensation is synchronous (getBoundingClientRect → scrollBy) with no setTimeout on the scroll itself, which avoids triggering NodeBB’s scroll-based URL updater in a loop. Compatibility Tested on NodeBB 3.x with Bootstrap 5 themes. Should work on any setup using the standard sidebar components (nav.sidebar-left, nav.sidebar-right).
  • Problems with performance ?

    21 308
    21 Topics
    308 Posts
    @cagatay The most reliable way to upgrade Node.js on Ubuntu depends on how you originally installed it. Method 1: Using NVM (Recommended) If you already use Node Version Manager (NVM), upgrading is simple. NVM allows you to keep both versions and switch between them if needed. Install Node 22: nvm install 22 Switch to Node 22: nvm use 22 Set it as your default: nvm alias default 22 Verify the change: node -v Method 2: Using NodeSource (PPA) If you installed Node.js via apt using the NodeSource repository, you need to update the repository script to point to the new version. Remove the old NodeSource list (optional but cleaner): sudo rm /etc/apt/sources.list.d/nodesource.list Download and run the NodeSource setup script for Node 22: curl -fsSL [https://deb.nodesource.com/setup_22.x](https://deb.nodesource.com/setup_22.x) | sudo -E bash - Install/Upgrade Node.js: sudo apt-get install -y nodejs Verify the installation: node -v Method 3: Using the ‘n’ Package If you have npm installed, you can use the n interactive manager. Clear the npm cache: sudo npm cache clean -f Install the ‘n’ helper: sudo npm install -g n Install Node 22: sudo n 22 Update your shell: hash -r Troubleshooting Permission Denied: If you see permission errors using Method 2 or 3, ensure you are using sudo. Path Issues: If node -v still shows version 20 after upgrading via NVM, restart your terminal or run source ~/.bashrc. Conflicts: Avoid mixing these methods. If you switch from apt to nvm, it is best to sudo apt remove nodejs first to avoid path conflicts.
  • Get help with network issues

    6 306
    6 Topics
    306 Posts
    @phenomlab Yes, I updated it right away after I created the password when first setting it up. Then I made my configurations.
  • Upgrade Problem from 2.8.9 to 2.8.10

    Moved Solved upgrade nodebb
    15
    1
    1 Votes
    15 Posts
    2k Views
    @cagatay Were any errors displayed during the upgrade process?
  • NodeBB: Favicon upload issue

    Solved nodebb favicon
    12
    1
    3 Votes
    12 Posts
    2k Views
    @phenomlab I am on a Mac, so I used the “Option + Command + I”, and then performed the steps. It loaded my favicon! I checked on Firefox which I haven’t used before, and it showed my favicon also! That’s fantastic and thank you for the help!
  • NodeBB: Creating pages

    Solved nodebb create page
    9
    0 Votes
    9 Posts
    2k Views
    OK, I think I have figured out how to place a link in the footer which will click to a new page.
  • NodeBB: The global Search option

    Solved search nodebb
    5
    0 Votes
    5 Posts
    949 Views
    @mventures Yes, exactly. The other icon will restart NodeBB whilst the first icon I referenced will rebuild (recompile) it. The huge strength of NodeBB over Flarum (for example) is that the code is precompiled, and called once at boot. PHP’s code has to repeatedly reload code from source making it much slower.
  • NodeBB: Privileges for the Announcement channel

    Solved nodebb
    6
    1
    1 Votes
    6 Posts
    1k Views
    Up to you really
  • NodeBB: Upgrading to NodeBB v3.x

    Solved nodebb v3.x
    6
    0 Votes
    6 Posts
    1k Views
    @mventures You’d need to connect to the server and execute it directly - not on your local terminal. Review the guide below, which will show you how to gain access via SSH to your server https://docs.ovh.com/gb/en/dedicated/ssh-introduction/ Once you have access, you’ll need to navigate to the actual folder where NodeBB is installed You’ll then need to change to the directory as shown below /home/unbuntu/nodebb [image: 1680448167972-fdffe673-bf63-4b6d-a728-5506fddc1aff-image.png] In most cases, initial access takes you to the root of the file system. You can always issue pwd in a Linux terminal which will show you the Present Working Directory. From there, you can issue the command cd /home/ubuntu/nodebb Once in the NodeBB directory, you’d use the below commands ./nodebb stop git fetch && git checkout develop && git reset --hard origin/develop ./nodebb upgrade ./nodebb start Line 1 stops the NodeBB instance Line 2 gets the latest files from GIT (repository) and then checks out the development branch. It then resets the version you are using to the development branch ready for v3 Line 3 Runs the upgrade once the new branch is set, and code pulled Line 4 Restarts the NodeBB instance after the upgrade has completed Note that when you restart NodeBB and log back in, things will look very different to what you had in v2.
  • NodeBB: Creating the Swatch modes

    Solved swatch
    2
    0 Votes
    2 Posts
    679 Views
    @mventures the swatch feature you refer to isn’t a NodeBB plugin, but a utility that I wrote that handles this. It is available for v2 (as you can see here) but I’ve stopped developing and releasing the code because it has been entirely rewritten to work for v3. If you’d like the code, this is possible, but you’ll need to upgrade to v3 first.
  • Upgrade Problem from 2.8.3 to 2.8.4

    Solved nodebb
    35
    1
    8 Votes
    35 Posts
    7k Views
    @cagatay No, you can ignore that.
  • nodebb loading emojis

    Solved nodebb emojis
    16
    1
    1 Votes
    16 Posts
    3k Views
    @DownPW sure. Let me have a look at this in more detail. I know nginx plus has extensive support for this, but it’s not impossible to get somewhere near acceptable with the standard version. You might be better off handling this at the Cloudflare level given that it sits in between the requesting client and your server.
  • DNS to Point Domain Name to

    Solved dns entries
    13
    3 Votes
    13 Posts
    2k Views
    @Madchatthew good luck
  • Chevron up before & after

    Solved nodebb
    11
    1
    4 Votes
    11 Posts
    2k Views
    @crazycells you are right thank you.
  • Issues with v3 alpha and Harmony

    Moved Solved
    18
    4 Votes
    18 Posts
    2k Views
    @cagatay Should be all sorted now Don’t forget to put your language back to Turkish.
  • Issues getting Flarum to work on new host

    Solved virtualmin
    65
    14 Votes
    65 Posts
    17k Views
    @crazycells huh. Thanks. Will need to check that as well.
  • 3 Votes
    2 Posts
    681 Views
    @DownPW This isn’t something I have readily available, and because I’m not entirely familiar with the database structure of NodeBB, it’s something that would require research and development in terms of script. I think it’d be quicker to ask this in the NodeBB forums.
  • 5 Votes
    13 Posts
    2k Views
    'use strict'; const winston = require('winston'); const user = require('../user'); const notifications = require('../notifications'); const sockets = require('../socket.io'); const plugins = require('../plugins'); const meta = require('../meta'); module.exports = function (Messaging) { Messaging.notifyQueue = {}; // Only used to notify a user of a new chat message, see Messaging.notifyUser Messaging.notifyUsersInRoom = async (fromUid, roomId, messageObj) => { let uids = await Messaging.getUidsInRoom(roomId, 0, -1); uids = await user.blocks.filterUids(fromUid, uids); let data = { roomId: roomId, fromUid: fromUid, message: messageObj, uids: uids, }; data = await plugins.hooks.fire('filter:messaging.notify', data); if (!data || !data.uids || !data.uids.length) { return; } uids = data.uids; uids.forEach((uid) => { data.self = parseInt(uid, 10) === parseInt(fromUid, 10) ? 1 : 0; Messaging.pushUnreadCount(uid); sockets.in(`uid_${uid}`).emit('event:chats.receive', data); }); if (messageObj.system) { return; } // Delayed notifications let queueObj = Messaging.notifyQueue[`${fromUid}:${roomId}`]; if (queueObj) { queueObj.message.content += `\n${messageObj.content}`; clearTimeout(queueObj.timeout); } else { queueObj = { message: messageObj, }; Messaging.notifyQueue[`${fromUid}:${roomId}`] = queueObj; } queueObj.timeout = setTimeout(async () => { try { await sendNotifications(fromUid, uids, roomId, queueObj.message); } catch (err) { winston.error(`[messaging/notifications] Unabled to send notification\n${err.stack}`); } }, meta.config.notificationSendDelay * 1000); }; async function sendNotifications(fromuid, uids, roomId, messageObj) { const isOnline = await user.isOnline(uids); uids = uids.filter((uid, index) => !isOnline[index] && parseInt(fromuid, 10) !== parseInt(uid, 10)); if (!uids.length) { return; } if (roomId != 11) { // 5 Is the ID of the ID of the global chat room. Messaging.getUidsInRoom(roomId, 0, -1); // Proceed as normal. } else { user.getUidsFromSet('users:online', 0, -1); // Only notify online users. } const { displayname } = messageObj.fromUser; const isGroupChat = await Messaging.isGroupChat(roomId); const notification = await notifications.create({ type: isGroupChat ? 'new-group-chat' : 'new-chat', subject: `email:notif.chat.subject, ${displayname}`, bodyShort: `notifications:new_message_from, ${displayname}`, bodyLong: messageObj.content, nid: `chat_${fromuid}_${roomId}`, from: fromuid, path: `/chats/${messageObj.roomId}`, }); delete Messaging.notifyQueue[`${fromuid}:${roomId}`]; notifications.push(notification, uids); } };
  • Nodebb: failed to restore a mongo dump

    Solved mongodb
    2
    1 Votes
    2 Posts
    763 Views
    @phenomlab In fact I specified the sub rep and not the rep DON’T DO THIS: nodebb@nodebbpwclonedb:~/nodebb$ sudo mongorestore --username admin --password XXXXXXXXXXXXXX --nsInclude nodebb.objects --drop /home/nodebb/nodebb_DB_20230107/nodebb/ BUT THIS : nodebb@nodebbpwclonedb:~/nodebb$ sudo mongorestore --username admin --password XXXXXXXXXXXXXX --nsInclude nodebb.objects --drop /home/nodebb/nodebb_DB_20230107/
  • NodeBB 3.0 alpha1 : Error on install

    Solved nodebb version 3 install error
    19
    2 Votes
    19 Posts
    4k Views
    @phenomlab Work now
  • restarting nodebb on boot

    Unsolved nodebb
    3
    1 Votes
    3 Posts
    1k Views
    @eeeee said in restarting nodebb on boot: can I just run nodebb under nodemon for auto restarts? It’s a better method. Nodemon just looks for file system changes and would effectively die if the server was rebooted meaning you’d have to start it again anyway. Systemd is the defacto standard which is how the operating system interacts in terms of services, scheduled tasks etc.
  • Recent Cards Plugin

    Solved customisation
    5
    1
    4 Votes
    5 Posts
    1k Views
    @crazycells that’s a good point. Thanks
  • 24 Votes
    29 Posts
    10k Views
    @DownPW it is the second post of this thread.