Skip to content

Tutorials

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

82 Topics 597 Posts
  • Suggested Topics towards the end

    10
    0 Votes
    10 Posts
    3k Views
    greenmoonG

    @baris thanks a mil for your prompt reply and suggestion. 🙂

  • how to insert landing page

    3
    0 Votes
    3 Posts
    739 Views
    D

    is there anny video turtorial for that?

  • 7 Votes
    24 Posts
    13k Views
    R

    @julian Resurrecting an old thread, it is still relevant though.

    Since upgrading NodeBB from v1.4.5 to v1.12.1 my Piwik analytics code no longer works. It looks like @hmj had this same problem when he upgraded to v.1.6.0.

    Does anyone have suggestions on what may have changed such that this doesn't seem to work any longer?

    $(window).on('action:ajaxify.contentLoaded', function(ev, data) { firePiwik(data); });

    Thank you.

  • 0 Votes
    2 Posts
    378 Views
    Q

    The short answer is no.

    Recently discussed here.

  • 0 Votes
    10 Posts
    2k Views
    Arief WijayaA

    @JaredBusch Thanks. Really appreciate it

  • This topic is deleted!

    2
    0 Votes
    2 Posts
    6 Views
  • How to the annoucements widget is done?

    12
    1 Votes
    12 Posts
    1k Views
    T

    @PitaJ said in How to the annoucements widget is done?:

    @The-Worms https://community.nodebb.org/post/64258

    yes it's for the tags ;),
    But doekia's request is this view for recent topics :

    g9Wsq5O.png

  • Database and web server in separate vps?

    3
    0 Votes
    3 Posts
    464 Views
    S

    @roy-miller said in Database and web server in separate vps?:

    How can I install nodebb webserver and database in separate vps for scaling? Please share tutorial?

    What do you need to know? It's as easy as installing the database on one VM and the app on another. When you put in the configuration information to the app in config.json it handles everything right there automatically, there is nothing "to know."

    Now be aware, unless you are scaling to an absurd degree, this will have a serious negative effect of slowing your site down by adding latency. And I know of no NodeBB site that needs it. What kind of traffic are you expecting? We'd estimate that you'd need over a billion hits a month to even need to talk about something like this, and even then, it would only be "on your radar" and not something that you need.

    I would step back and evaluate this carefully. Do you really feel that you are going to run the largest NodeBB installation of all time by orders of magnitude? And if so, maybe you want to bring in specialists who are very used to working with NodeBB and MongoDB and large scale scaling because you are going to need this to really, really work and not just be the first time you are experimenting with setting up something of this nature.

  • How to follow someone

    2
    0 Votes
    2 Posts
    459 Views
    PitaJP

    @mikejody this is actually a really bad discoverability bug. But, when you go to someone's profile page, you click on the little plus icon to the bottom right of their avatar.

  • Ability for users to make anonymous posts?

    7
    1 Votes
    7 Posts
    3k Views
    S

    Do we have any update regarding such a plugin? Giving the option of anonymity to registered users will definitely promote involvement in the case of some forums.

    I agree as well. More fun, more users.

  • Trim long titles js issue

    3
    0 Votes
    3 Posts
    518 Views
    C

    @baris Thank you. I'll try that and probably need to add a width in percent to the container. I'm using Material and doesn't have that.

  • How To: Let's Encrypt and NodeBB

    15
    7 Votes
    15 Posts
    8k Views
    yariplusY

    @01 What is the error you are receiving when you visit your site?

    If you can access your site, but it says the connection is insecure, then part of your certificate chain is missing or invalid.

  • NodeBB - Full Stack Setup

    13
    9 Votes
    13 Posts
    9k Views
    A

    @omega I actually meant "according to the docs".
    I am sorry for my crappy English as I am not a native speaker.

    @Shard ok.

  • NodeBB on Windows 10 / 2016

    7
    3 Votes
    7 Posts
    2k Views
    0xA4B160

    If anyone gets this error having the forum in a subfolder like blabla.com/forum:

    forumcategories Not Found

    Fix Here

  • 7 Votes
    12 Posts
    11k Views
    PitaJP

    @alphagao link me whatever guide you're using. If you don't know what to do, use this guide:

    https://docs.nodebb.org/installing/os/ubuntu/

  • This topic is deleted!

    1
    0 Votes
    1 Posts
    4 Views
  • 0 Votes
    1 Posts
    815 Views
    Cyb3rC

    I'll make this as simple as it can be, after importing your forum it might come a problem when you see some of your users avatars broken, here's a simple method to set a placeholder image for missing images.

    First you have to upload your default image anywhere on the public directory, I would suggest in public/uploads/default.png, the full path should be /path/to/nodebb/public/uploads/default.png.

    Now you have to get the default avatar directory for your imported forum, to get this path right click on the avatar of your broken user and click copy image location, paste it in a text file, in my case it was example.com/assets/uploads/xenforo/data/avatars/m/0/84.jpg so the path should be the folder containing all avatars /uploads/xenforo/data/avatars you have to lose the assets folder from the path.

    In your nginx conf add this block under the main block /:

    location /uploads/xenforo/data/avatars { try_files $uri /uploads/xenforo/data/avatars/default.png; }

    Full nginx conf should look something like this:

    upstream nodebb { ip_hash; server 127.0.0.1:4567; } server { server_name example.com www.example.com; root /path/to/nodebb/public; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http://nodebb; proxy_redirect off; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; location /uploads/xenforo/data/avatars { try_files $uri /uploads/xenforo/data/avatars/default.png; } } }

    Hope this helps someone. 🙂

  • 0 Votes
    6 Posts
    2k Views
    J

    Hi @pitaj good morning.
    Kindly follow the below:

    Disable access to all unregistered users. Add a global JS script with:

    $(window).on('action:ajaxify.end', function() {
    if (!app.user.uid ) && ajaxify.currentPage !== 'login') {
    ajaxify.go('login');
    }
    });
    $(document).ready(function(event, data) {
    if (!app.user.uid ) && ajaxify.currentPage !== 'login') {
    ajaxify.go('login');
    }
    });

    Log out of your account. In the login screen press "home" on the breadcrumb.

    Since the uuid is probably scoped, you are allowed to go into categories, and from there anywhere as long as the pages are cached.

    Sometimes, the categories are hidden and the page is blank, sometimes they are not.

    The expected behavior: unregistered user must stay in the login screen even if all other pages are scoped.

    Thank you very much for looking into this. Highly appreciated!
    JJ.

  • Systemctl Dynamic Path: AWS EC2 + AWS Linux2

    1
    0 Votes
    1 Posts
    669 Views
    J

    Hi All,

    The recommended setup for nvm/npm/nodejs is per user.

    Lets assume you created a user nodebb, installed nodejs under it, and revised .bashrc to set environment variables to point to the latest version (standard procedure):
    export NVM_DIR="$HOME/.nvm"
    [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
    [ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" #

    Systemctl expects full path to executable. Unfortunately, that path may change when nodejs gets updated.

    So how do we hack systemctl to use a dynamic path?

    Generate the env variables and dump them into a file Load the file into systemctl environment

    See config below:

    [Unit]
    Description=NodeBB Service
    After=system.slice multi-user.target mongod.service syslog.target

    [Service]
    Type=idle
    User=nodebb

    StandardOutput=syslog
    StandardError=syslog
    SyslogIdentifier=nodebb

    ExecStartPre=/bin/bash -c -l '/usr/bin/env > /tmp/tmp_env ; /bin/echo NODE_ENV=production >> /tmp/tmp_env'

    EnvironmentFile=/tmp/tmp_env
    WorkingDirectory=/path_to_nodebb

    ExecStart=/usr/bin/env node loader.js --no-silent --no-daemon
    Restart=always

    [Install]
    WantedBy=multi-user.target

    Pay attention: Type=idle replaces Type=simple.

    Good luck!
    JJ.

  • 1 Votes
    2 Posts
    2k Views
    J

    @kyletryon I was thinking of using AWS too, sounds like a very appealing idea. I ended up going with a company called "Digital Ocean" And just recently got it all working on their Droplet service. Look into them too.