Skip to content

Tutorials

NodeBB guides, how-to's and general tips and tricks

82 Topics 597 Posts
  • Multiple nodebb sites on the same server

    14
    1 Votes
    14 Posts
    1k Views
    dunlixD

    Yeah @kurulumu-Net you can change port in config.json in one of the NodeBBs and change to the same port in the proxy-pass part of the corresponding nginx config.

    Default port is 4567, one will need to be changed.

  • 2 Votes
    3 Posts
    730 Views
    dogsD

    @gotwf I'm not sure it's been weeks ago I wrote this. 😄

    Maybe I did not find this or something didn't work for me. I can't tell you...

    Greets

  • Asking for a newbie tutorial

    3
    2 Votes
    3 Posts
    1k Views
    zandertrekZ

    It doesn't seem like there is a lot of momentum for a Newbie Tutorial. Perhaps there could be a "User Guide" with the essentials for setting up and managing a NodeBB forum? A lot of the admin interface is self-explanatory, which I appreciate. Some of it is not self-explanatory. Perhaps a User Guide would focus on that stuff. Regardless, NodeBB customer support is very helpful and responsive via email.

  • 0 Votes
    2 Posts
    512 Views
    volanarV

    For an automatic transition from www to no www, this code works well

    if ( $host ~ ^www.(?<domain>.+) ) {
    rewrite ^/(.*)$ $scheme://$domain/$1;

    Express.js does not support http/2. Or am I wrong? Does it make sense to include http/2 support in nginx?

  • 4 Votes
    9 Posts
    3k Views
    Per0xP

    @ᴅᴀʀᴛʜ-ᴠᴀᴅᴇʀ It probably crashes because of the plugins you installed and nodebb can't find them (nodebb-theme-oxide in particular)

    I suggest you backup the redis database by copying the /data folder somewhere, then delete the contents of the original folder and also remove the config.json volume.

    Erase and restart redis and nodebb container (It should be like a fresh install) then installs the plugins and themes listed in the log file (nodebb-plugin-teamspeak-verify, nodebb-widget-search-bar, nodebb-theme-oxide, etc)

    When all plugins are installed and enabled, stop the nodebb container and restore the /data redis database with your backup, and remap config.json volume and I think it should be up.

    Next time you want to upgrade, disable all plugins before restarting the container with the new image.

  • How to write hooks

    3
    6 Votes
    3 Posts
    907 Views
    barisB

    The hooks module has the same functionality as $(window).on() but it also allows having async filter hooks client side which was not possible with $(window).trigger/on

  • 2 Votes
    3 Posts
    756 Views
    dogsD

    @aleksei I read your topic: https://community.nodebb.org/topic/15252/execute-custom-js-on-infinite-scroll and saw you're dealing with C4D-Files. 😄

  • 2 Votes
    4 Posts
    660 Views
    dogsD

    @dunlix yeah you should! 😂

    what does discord have to do with it? I tried using that link with different values and URL of course on my site, still didn't work. I'm sure it works for you, what am I missing?

    To be honest: Nothing.

    I am building a plugin for Discord integration..So the variable names are just placeholders if you want so.

    The important part is at the end of my main post.

    I hope that you find a slick way to use it for your community maybe. 🙂 👍

  • Log rotation for custom/devel log

    4
    0 Votes
    4 Posts
    454 Views
    barisB

    Ah that functionality is handled in https://github.com/NodeBB/NodeBB/blob/master/src/logger.js

  • How to profile NodeBB

    2
    2 Votes
    2 Posts
    489 Views
    gotwfG

    @baris Good stuff! 👍

    Flame graphs - not just for Solaris anymore. Hip, hip, hooray for portable software engineering. 🤸

    Those interested in a bit deeper dive may want to check out Brendan Gregg's blog.

  • NodeBB Email - Postfix Null Client

    1
    0 Votes
    1 Posts
    881 Views
    gotwfG
    Who Is This Document For?

    Well... like most things.... it depends....

    If one or more of following shoes fits: Just want to get NodeBB up and running with minimum of hassle please I refer you to the tl;dr commentary from my NodeBB Email Options article. Intermediate to advanced Linux user. You can likely get this on your own. May be of some value to those unfamiliar with network and server side aspects of SMTP? Seasoned email administrator? Right. Please do not be too harsh as I'm endeavoring to bridge a gap here... SME commentary welcome. 😉 If, on the other hand: You're attracted to the "Ops" side of DevOps. Like to know how things work. Medium/advanced "beginner" to the Unix/Linux command line and eager to learn. Have the time to invest in that learning (i.e. big boss man or some other urgency not twisting your arm to get this done yesterday) and not afraid to RTFM.

    Then.......

    For Those About to Rock...

    I confess to deploying a Null Client set up for my forums. I thought I'd expand upon this a bit for interested parties not already possessing subject matter expertise but comfortable with the command line and willing to roll up their sleeves. Follows is meant to be a thumbnail sketch to get the DIY inclined pointed in the proper directions rather than exhaustive step by step copy pasta.

    Firstly, let's take a look at some reasons why/when this use case may be a fit:

    Isolation and separation of duties. Some favor an all on one approach. I favor dedicated vm's for dedicated tasks. I'd rather not have my app servers initiating connections with the Big Bad Internet. Incoming http(s), smtp, etc. requests from non local VM's is proxied. Access to prexisting email infrastructure. Security and stability concerns. All software has bugs. Postfix has weathered extensive scrutiny and audit. As such, I expect it is less vulnerable to things like malformed responses. Flexibility moving forward. For e.g. you want a daemon to manage NodeBB's outgoing mail queue - and perhaps that daemon also comes in handy for other duties like emailing various reports or alerts to administrators.

    Presumptions:

    You have a Postfix Null Client configured as outlined in the Postfix Standard Configuration Readme. You have NodeBB configured to utilize such as depicted in my screenshot in my prior article linked above.

    I've mentioned this can get complex in a hurry. Let's see if we give it a little K.I.S.S.

    Incoming!! 💣 📬

    Let's get our biggest hurdle out of the way.

    Null clients do not receive incoming mail. Setting up SMTP relays, IMAP server, virus/malware scanner, etc. ups the ante considerably. We've already got enough on our plates, at least for now, embarking upon this Null Client journey so lets save ourselves some grief and off load those duties to a reputable third party service such as Proton Mail.

    Outgoing

    As always, there's more than one way to do it:

    Null client delivers email directly to one of the servers listed in recipient domains MX records.

    Null client forwards email to a dedicated SMTP relay host, e.g. the folks handling your incoming mail (you may need to coordinate with them to configure some knobs, e.g. which hosts they will relay email from). Advantages to using a relay host include: 1) Undeliverable mail does not get stuck on your NodeBB server, and 2) Our null client is now initiating outgong SMTP connections with only the relayhost(s) rather than the big bad Internet at large.

    Postfix needs to know about your relay host to get this working. Add the following line to your null client's main.cf

    relayhost = your-relay-host.domain.tld

    You may also choose to specify relayhost via alternate parameters, such as IP address. I recommend sticking with hostnames as IP addresses may change from time to time.

    DNS Record Cogs & Widgets ⚙

    DNS presents yet another challenge and can have a high price for mistakes. So you're best off offloading this to a third party. Good news is your email provider likely bundles this with their service. Your domain registrar surely does. Consider leveraging that. Submit a request to have forward and SPF records added for your NodeBB instance's hostname.

    Note: I've used traditional Bind zone file syntax in the examples below. Using this syntax in help desk requests helps avoid confusion. Your provider may well offer a web based UI.

    You want records that look similar to the following (mind the trailing periods on fully qualified host names):

    Forward Record

    null-host-name.your-domain.tld. IN A XXX.YYY.WWW.ZZZ

    SPF Record

    The purpose of an SPF record is to provide a list of servers authorized to send email from your domain and must therefore necessarily include your third party provder's servers as well as your null client(s).

    your-domain.tld. IN TXT "v=spf1 ip4:primary-ip, ip4:secondary-ip, ip4:null-host-ip -all"

    MX Records

    Your mailbox provider likely handles configuration of MX records seamlessly but for the sake of completeness....

    RFC's dictate primary and secondary mail exchangers. Get these from your mailbox host.

    @ IN MX 50 primary-mx.domain.tld. @ IN MX 80 secondary-mx.domain.tld.

    Reverse Record

    Your cloud provider is authoritative for reverse records for IP space assigned to them. Set up a PTR record for your NodeBB host using your providers management ui or submit a request ticket for them to create such for you.

    XXX.YYY.WWW.ZZZ.in-addr.arpa. IN PTR null-host-name.your-domain.tld.

    I manage my own DNS servers. DKIM is a royal pita for even seasoned adminstrators and imho an accident waiting to happen. Hence, unless you have a passion for learning about this stuff, I recommend letting your email/IMAP provider handle DNS for you, as it is lots easier to have them add an A or CNAME record as necessary for web servers and such than for you to configure and maintain DKIM. Else avoid DKIM entirely.

    Postmaster

    Other systems expect the existence of a valid postmaster address for communication of issues such as bounced mail, etc. Create "[email protected]", either as a dedicated mailbox or a forward to an existing mailbox, e.g. [email protected] if you prefer not having to check multiple mailboxes. Test this. Don't sweep postmaster mail under the rug lest it come back to haunt you at the most inopportune of times.

    Blacklists

    We need to ensure our newly minted Null Client is not blacklisted. MX Toolbox offers a meta blacklist check. Barracuda Networks will most likely do so before you've sent even a single email and requires jumping thru their hoops to become delisted. And jump ye' shall because their stuff is in wide spread use, particularly corporate side. It behooves you to check these blacklists from time to time, particularly with a newly minted server.

    Bippity Boppity Boo! 🎉

    Put it together and what have we got?

    Robust SMTP daemon relaying outgoing NodeBB email. Robust and reasonably secure IMAP mailboxes sans administration headaches. No worries about third party email plugin breakage between version upgrades.

    While this method adds complexity it's not too difficult to get set up once you understand some underlying concepts, moving pieces involved and what you're targeting. It also serves as a stepping stone to building out your own email infrastructure should you decide this stuff is all just too much fun.

    Enjoy! o/

  • NodeBB Email - Options

    3
    2 Votes
    3 Posts
    2k Views
    gotwfG

    @julian You're welcome and thank you for the kind words.

  • Installing nobeBB on Dreamhost?

    2
    0 Votes
    2 Posts
    777 Views
    R

    Hey,

    I was having the same problem than you. Turns out, you have to run a special command after you installed node if you installed it on a shared server:

    setfattr -n user.pax.flags -v "mr" $(find $NVM_DIR -type f -iname "node" -o -iname "npm" -o -iname "npx")

    You can read more about this on Dreamhost's support site:

    https://help.dreamhost.com/hc/en-us/articles/360029083351-Installing-a-custom-version-of-NVM-and-Node-js

  • 8 Votes
    8 Posts
    7k Views
    אשרא

    thnk you

  • 2 Votes
    1 Posts
    915 Views
    mooredsM

    Hiya,

    I wrote a tutorial about setting up single sign-on for NodeBB.

    Full disclosure, I wrote it using my employers OAuth server (FusionAuth) as the user identity provider.

    But the plugin and steps should work with any OAuth server. The plugin is here: https://github.com/FusionAuth/nodebb-plugin-fusionauth-oidc

  • Setting up NodeBB on cloud 9

    15
    10 Votes
    15 Posts
    13k Views
    olivedevO

    It would be great if you can also provide a tutorial on setting up Nodebb on Heroku.

  • Docker & Docker-compose

    7
    6 Votes
    7 Posts
    2k Views
    P

    @Austin-Benesh
    Would be great to have compose und files / images!
    Is it configurable by container environment or (external / mapped) files are needed?

  • How to print correctly some posts? A topic?

    8
    0 Votes
    8 Posts
    657 Views
    A

    @PitaJ The issue is opened here :
    https://github.com/NodeBB/nodebb-theme-persona/issues/493

  • 0 Votes
    3 Posts
    359 Views
    S

    @psizzles said in Looking to create a simple voting application with a live audience:

    Hi All,

    I am looking to create a voting app. for a live demo. The audience will have three choices to pick from a bit.ly url from their phone.
    Only I will be able to see the overall results submitted. Would it be possible to get the ip addresses of the people who have voted? Is there a sample app. I can reuse?

    Thanks!

    Inside of the forum?

  • 5 Votes
    4 Posts
    4k Views
    Sun KimS

    Could I do all these steps using the free plan, or is there a pay plan that will work?

    da65f4ab-5cd0-4351-b18a-8040eac5d4e7-image.png

    I also noticed there are also heroku "deploy scripts" that auto install it for you?
    Is there anything like this for nodeBB?

    5e80b502-4d2b-4f74-af88-0ed87b71a690-image.png