Skip to content
  • Pushing forums in the AI SEO domination era

    General Discussion
    4
    4 Votes
    4 Posts
    948 Views
    julianJ
    Hah, already possible to lock your forum down using privileges, and let paying members in
  • Improving docker support

    General Discussion
    7
    5 Votes
    7 Posts
    608 Views
    julianJ
    @ANONYMOUSKOREAN the Dockerfile is maintained by the community, since we don't use it at NodeBB ourselves. That said, it would be very appreciated if you were to help keep the file updated
  • 10 Votes
    38 Posts
    4k Views
    S
    @oplik0 Some update: I run it for more than a year. It runs pretty well. From my side, no issues. Amazing. version: nodebb 3.7.4.
  • Optimizing Benchpress

    NodeBB Blog
    8
    6 Votes
    8 Posts
    2k Views
    volanarV
    @julian said in Optimizing Benchpress: Are you saying we should build RustBB? Looks like lemmy developers are trying to do it based on their platform https://github.com/Nutomic/lemmyBB
  • 4 Votes
    2 Posts
    778 Views
    julianJ
    Awesome work! Always nice to see new widgets be created
  • 1 Votes
    1 Posts
    335 Views
    oplik0O
    I'll soon be creating a custom theme and some plugins for a forum that is already in use and I'm thinking about running second instance on beta.forum.url with the new theme and plugins enabled when it's close to being ready (but in need of testing), that I'd like to work with the same database as the main forum - so that users can just use beta if they want to preview new features while still using the same forum as others. Now, I know that the list of themes/plugins enabled is stored in database, so I'd probably need to do something about that, but is there anything else that would stop me from running two instances with a bit different configs off one database? Some sync issue with posts/topics or something like that? EDIT: actually, since I might as well help others, would it be a good idea to add an option to add some instance identifier to db plugin entries to core? Perhaps in config.json? So that if it's set NodeBB would look for plugins:<instance>:active for example.
  • 1 Votes
    2 Posts
    720 Views
    D
    I'd love to use this plug-in, but when I installed it with Lavender theme, it created issues with categories (invalid category IDs, unable to create new categories, unable to post in existing categories). Once I uninstalled this plug-in, all was fine. Is there perhaps a newer version that works with Lavender?
  • 5 Votes
    16 Posts
    3k Views
    volanarV
    @crazycells said in nodebb-plugin-customize: Customize NodeBB Translations and Templates: @pitaj said in nodebb-plugin-customize: Customize NodeBB Translations and Templates: @crazycells the plugin only knows about keys that are already in the NodeBB system. You could try coopting an unused key from something else. If I understood correctly from what you wrote on the Github issue below, you are planning to add a new property to this plugin... creating a new "translation token" Am I right? The issue with multilingual content has been resolved. This works by default
  • [FAQ] Websockets not working due to misconfigured origins

    Pinned Tutorials
    1
    8 Votes
    1 Posts
    9k Views
    PitaJP
    This FAQ is applicable for the following situations: You're receiving the following error in the Javascript console: WebSocket connection to 'wss://<site>/socket.io/?EIO=3&transport=websocket' failed: Error during WebSocket handshake: Unexpected response code: 400 The "Looks like your connection to NodeBB was lost, please wait while we try to reconnect." alert box and the spinner in the navbar consistently appear You want your users to be able to access NodeBB from multiple subdomains on your site Background By default, NodeBB only allows websocket connections from the "url" value in config.json. This is because of what is called Cross-Site Websocket Hijacking. By restricting the origin at which sockets can connect, we prevent this attack from taking place. Diagnosis To make sure that your issue is in fact caused by an origin mismatch, try this: Stop the NodeBB server: ./nodebb stop Start NodeBB in dev mode: ./nodebb dev Visit your site, and see if the issue is resolved. Ctrl+C to exit dev mode If the issue disappeared when visiting your site running in dev mode, then your problem is in fact an origin mismatch. If not, it is likely something else, so look around or ask a question here on the forum. Solutions The easiest solution is to set the "url" value in config.json to exactly the URL at which you access your NodeBB forum. For instance, the configuration for this site is { "url": "https://community.nodebb.org", ... } If you want your forum to work from multiple origins (like www.yoursite.com and yoursite.com) the preferred option is to just redirect one to the other. For instance, redirect www.yoursite.com to yoursite.com within your reverse proxy. If you absolutely must have full access from multiple origins, you can configure the accepted origins directly. As documented here, you can add a socket.io:origins property to config.json. For example, to allow accessing the forum sockets from the main NodeBB site, nodebb.org, the following would be added to our config: { ... "socket.io": { "origins": "https://community.nodebb.org:* https://nodebb.org:*" } } Make sure your original site is included in the new origins property, and that you add :*, otherwise it's invalid. Still having issues? It's likely a reverse proxy configuration issue. Take a look at the proxy documentation for examples. If you still have issues, ask a question here on the forum.
  • [nodebb-widget-game-server-query]

    NodeBB Plugins
    3
    5 Votes
    3 Posts
    2k Views
    yariplusY
    Updated to 1.1.0 Fixes a crash with newer node versions. Added the query protocol to the game dropdown.
  • New Mobile Menus (again) and New Emoji Plugin

    Moved NodeBB Development
    8
    3 Votes
    8 Posts
    6k Views
    PitaJP
    @phit that error should be fixed now. Try it out.
  • Introducing Our New Templating Engine

    Moved NodeBB Development
    17
    10 Votes
    17 Posts
    10k Views
    attisA
    There's one more breaking change that I did not find documented anywhere. For our theme we had to change: var templates = require('templates.js'); templates.registerHelper('generateCategoryBorder', helpers.generateCategoryBorder); to var Benchpress = require('benchpressjs'); Benchpress.registerHelper('generateCategoryBorder', helpers.generateCategoryBorder); Not a big deal but some folks might struggle to see why their template helpers don't work on server side.
  • New Persona Mobile Menus

    Moved NodeBB Development
    15
    7 Votes
    15 Posts
    7k Views
    E
    good job, seems to work very nice only problem with chats one is it appears the date of each chat and then dissapears
  • 2 Votes
    22 Posts
    7k Views
    yariplusY
    Version 1.6.0 !! Now works with 1.13.x! Re-wrote code to use new hooks and promises. Compatibility changed to >=1.10.0
  • 5 Votes
    68 Posts
    30k Views
    yariplusY
    I published v1.11.0 for v3. Still has a lot of work to do. Styles aren't quite right. Widgets don't work at all. Using a custom template doesn't work. Pagination is weird. Adding, deleting, and editing lists works. The default news and blog pages work. Shouldn't crash too often. I'll be keeping an eye on this page.
  • Thought about using a stricter style guide?

    NodeBB Development
    2
    0 Votes
    2 Posts
    1k Views
    yariplusY
    Hmm, idk, some parts of the code could use better adherence to a style for consistency, and it may encourage new contributors. I feel like styles are largely based on opinion though. And in situations where a style does help, such as avoiding confusing/ambiguous expressions, NodeBB rarely suffers from these problems. I am against tabs though. I hate them. Used to love them, but after using spaces, i can never go back. (I really really hate semicolons too.)
  • 0 Votes
    1 Posts
    1k Views
    PitaJP
    I propose to either add a new ability for the const keyword or use the reserved word final to make non-writable object and class members. Note: The TypeErrors are thrown following the behavior of Object.freeze or a { configurable: false, writable: false } property descriptor. They will be thrown in a "use strict"; environment, but usually not otherwise. Constant Class or Object members / properties / fields / methods Use final, since it is an unused reserved word, or possibly const to define constant Class or Object members: class X { // const / final now makes static class properties // non-writable, and non-configurable static const abc = 123; static final abc = 123; // also works to make constant private properties const #def = 456; final #def = 456; // as well as constant normal class fields, if you're into that const ghi = 789; final ghi = 789; // and constant private / static / normal methods static const doSomething() { } static final doSomething() { } const #somethingPrivate() { } final #somethingPrivate() { } const cantChangeMe() { } final cantChangeMe() { } constructor(a = 3) { const somethingPrivate = this.#somethingPrivate; // throws new TypeError('Assignment to constant property.') this.#somethingPrivate = function () { return a; } this.#somethingPrivate === somethingPrivate // true const def = this.#def; // throws new TypeError('Assignment to constant property.') this.#def = 1000; this.#def === def // true } } const x = new X(); const ghi = x.ghi; // throws new TypeError('Assignment to constant property.') x.ghi = 2000; x.ghi === ghi // true const doSomething = X.doSomething; // throws new TypeError('Assignment to constant property.') X.doSomething = function doSomethingElse() { }; X.doSomething === doSomething // true const cantChangeMe = X.prototype.cantChangeMe; // throws new TypeError('Assignment to constant property.') X.prototype.cantChangeMe = function yesICan() { }; X.prototype.cantChangeMe === cantChangeMe // true const o = { // const / final can be used in normal object literals, too const things() { }, final things() { }, const prop: 5, final prop: 5, }; const things = o.things; // throws new TypeError('Assignment to constant property.') o.things = function stuff() { }; o.things === things // true const prop = o.prop; // throws new TypeError('Assignment to constant property.') o.prop = 11; o.prop === prop // true This could be transpiled by simply using Object.defineProperty like so, at least on public members: class X { static abc = 123; static doSomething() { } cantChangeMe() { } constructor() { } } ['abc', 'doSomething', 'cantChangeMe'].forEach(key => Object.defineProperty(X, key, { configurable: false, writable: false }) ); const o = { things() { }, prop: 5, }; ['things', 'prop'].forEach(key => Object.defineProperty(o, key, { configurable: false, writable: false }) ); Shorthand for Immutable Classes and Objects Defining everything as final or const in a Class or Object doesn't quiet do the job. What if we want true immutability? I've also looked into some kind of special syntax for creating immutable objects and making classes return immutable objects. Maybe we could use final for that, as well? // The static members and prototype of this class are shallow immutable. // Any object it returns is also shallow immutable, // similar to `return Object.freeze(this)` as the last line in the constructor, // though since it uses a keyword, it could throw an error on an attempt to override final class ConstantObject { static abc = 123; static doSomething() { } cantChangeMe() { } constructor() { this.d = 8; } } const constantObject = new ConstantObject(); const c = constantObject.c; // throws new TypeError('Assignment to constant property.') constantObject.c = 321; constantObject.c = c // true const doSomething = ConstantObject.doSomething; // throws new TypeError('Assignment to constant property.') ConstantObject.doSomething = function doSomethingElse() { }; ConstantObject.doSomething === doSomething // true const cantChangeMe = ConstantObject.prototype.cantChangeMe; // throws new TypeError('Assignment to constant property.') ConstantObject.prototype.cantChangeMe = function yesICan() { }; ConstantObject.prototype.cantChangeMe === cantChangeMe // true // No members can be added / modified / deleted from this shallow immutable object. const finalObject = final { prop: 5, things() { }, }; const things = finalObject.things; // throws new TypeError('Assignment to constant property.') finalObject.things = function stuff() { }; finalObject.things === things // true const prop = finalObject.prop; // throws new TypeError('Assignment to constant property.') finalObject.prop = 11; finalObject.prop === prop // true This could be transpiled essentially by just using Object.freeze and Object.defineProperty: const ConstantObject = (() => { class ConstantObject { static abc = 123; static doSomething() { } cantChangeMe() { } constructor() { this.d = 8; return Object.freeze(this); } } Object.defineProperty(ConstantObject, 'prototype', { value: Object.freeze(ConstantObject.prototype), }); return Object.freeze(ConstantObject); })(); const finalObject = Object.freeze({ prop: 5, things() { }, }); What do you think? I'm currently leaning towards using the final keyword for everything. Both sides have pros and cons. const final Pros • Meaningful word • Unused • Fits existing syntax; AKA const x = 5 -> const x: 5 • Meaning could be closer if devs want to initialize after definition • Familiar to Java devs Cons • Could be overloaded in usage • Less meaningful to C / JS devs, could be confusing
  • NodeBB Plugin best practices

    Plugin Development
    1
    1 Votes
    1 Posts
    1k Views
    PitaJP
    I'm thinking it would be good if we establish some best practices for NodeBB plugin development. Feel free to contribute by replying and I'll add it to the list. Database keys should start with plugin:[your-plugin-name]: ex: if the plugin is nodebb-plugin-mentions then the database keys would start with plugin:mentions: Use sockets instead of ajax Use CSS transitions instead of jQuery animations, trigger them by toggling classes on the elements Use Bootstrap elements as much as possible or not at all your suggestion here
  • Adding rewards breaks with rewards-essentials.

    Technical Support
    3
    3 Votes
    3 Posts
    2k Views
    julianJ
    Glad to see others making rewards plugins Hopefully you and @psychobunny can debug this issue...
  • [nodebb-plugin-camo] Make embedded images look secure!

    NodeBB Plugins
    40
    10 Votes
    40 Posts
    49k Views
    yariplusY
    New Release 1.5.1 Back from the dead with a bunch of bug fixes, code rewrite to current node and NodeBB, and new pictures for the guide topic! Fixed crash if camo was not installed locally. Fixed crash if an incorrect url was specified. Fixed crash if installed on windows. Fixed settings not changeable after original setup. Removed old or useless hooks. Removed babel. Corrected dead links and emails. Changed compatibility to >= NodeBB 1.0.0 New docs!