config.json updated, `base_url` and `relative_path` no longer exist

NodeBB Development
  • Re: gh#1984

    The configuration file was recently updates to be simpler, among other changes, url is the main config value that points to your address. NodeBB will automatically figure out the port usage and relative path if provided.

    port is now optional. If it is not specified, it will be inferred from the url, if it is not specified in the url (e.g. you're using a reverse proxy) and you still want to listen to a non-4567 port, specify a port value, NodeBB will follow it. The PORT environment variable is unaffected.

    bcrypt_rounds and upload_path are defaulted to 12 and /public/uploads respectively. Leave them in config.json if you want them to be different.

    NodeBB's upgrade script will transparently handle this change, although if you have plugins relying on base_url, you'll need to update them to listen for url instead.

    Full details here: https://docs.nodebb.org/en/latest/configuring/config.html

  • To be clear, we can still access relative_path through nconf.get('relative_path') right? -- this just affects people that may be accessing this stuff before it's parsed into that.

  • @dwn Yes, sorry, I tried to make this change as backwards compatible as I could, so all existing values except for base_url are maintained.

    nconf.get('relative_path'); will function as it has before.

  • Hi,

    so if I do understand it right - NodeBB is now supporting subfolder installations? If yes, how do I configure NodeBB to do so? Cant figure it out from the docs...

  • @silasrech When you run ./nodebb setup it asks for the url of your forum. Just put in http://yourdomain.com/myforum

  • Okay, and how do I have to configure NGINX? Just:

       server {
            server_name domain.tld;
            location /forum/ {
            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://127.0.0.1:<port>/;
            proxy_redirect off;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            }
       }
    

    ?

  • @silasrech If you put location as /forum/, nginx will remove that portion of the URL when proxying, and NodeBB will actually see requests for /topic/ /category, etc, so if you wish, you can do that and change the url to be without the subfolder.

    OR

    Leave it as location /, and have the url property in the config have the subfolder.

  • Okay, thanks. Merry Christmas and Happy New Year by the way 😃

  • Finally upgraded to 0.6.1 from 0.5.7. First I added the port (in my case 8080) to the URL string as described in this thread. That screwed up SSO. Both google and facebook. After, I went back and manually added "port" setting into config.json, SSO seems functional. This appears to be a bug or a logical conflict. Basically SSO is not functional unless your URL string is exactly how you access nodeBB from the outside.

  • @Baerrus This is what it's supposed to be due to my understandings.

    The url attribute needs to be the URL how you access NodeBB from the outside.
    The port attribute defaults to 4567 (or to port specified within url if specified) and is the port NodeBB attaches to on localhost.

    Some examples:

    • {"url": "http://example.com:8080"}
      NodeBB binds to 8080 and expects no reverse-proxy thus from the outside you access it via http://example.com:8080
    • {"url": "http://example.com"}
      NodeBB binds to 4567 and expects outside-access to be via http://example.com
    • {"url": "http://example.com", "port": 8080}
      NodeBB binds to 8080 and expects outside-access to be via http://example.com
  • @frissdiegurke Knowing what I know now, @julian post can be construed to contain all the information :). I would word it differently though as SSO is probably veyr widely used. And if so, then calling port optional is...well, still technically correct.


Suggested Topics


  • 2 Votes
    3 Posts
    140 Views

    That is correct. A plugin should work with no breakages as long as they do not upgrade to the next major version level.

    NodeBB forum admins are still advised to use the recommended plugin version in the ACP, as there is no guarantee that plugins will follow semver.

  • 0 Votes
    10 Posts
    3k Views

    @julian said in Are the docker builds no longer maintained?:

    nothing that can beat the feeling of a fresh server install with only the software you need.

    However, you do have to consider the cost... in that you'll be spinning up multiple containers for multiple services (if you follow "best practice"), with all of the duplication of resources that entails.

    That's the thing though, the fresh server doesn't stay fresh forever because it's not immutable. And any OS will come with software you don't need. I'm just getting started with Docker, but I can see the appeal when trying to deploy quickly and consistently. I'm dreading moving servers because that means I have to re-install everything I need on a fresh server and reconfigure it. If I was using docker, it's pretty much just create a new VM -> install Docker (unless using an image that already has it) -> docker run myservice and done.

  • 0 Votes
    9 Posts
    3k Views
  • 0 Votes
    1 Posts
    2k Views

    If you have any plugins that use action:topic.save, action:topic.restore or action:topic.edit please read below on the changes coming in 0.6.0. If you have any questions about how to update to the new hooks please feel free to ask.

    The parameter passed to all three hooks has been changed from a topic id to a topicData object.

    plugins.fireHook('action:topic.save', topicData);
    plugins.fireHook('action:topic.restore', topicData);
    plugins.fireHook('action:topic.edit', topicData);

    topicData object contains at least the following data.

    { tid: 3, title: 'test topic', mainPid: 5 }
  • 1 Votes
    2 Posts
    2k Views

    I'm unsure if I'm seeing a regression or an undocumented? change here.

    I'm currently getting:

    TypeError: undefined is not a function
    at /mnt/Extra/home/dbolack/Projects/nodebb-plugin-rscloudfiles/index.js:203:4

    Which maps to:

    callback(null, { url: rsCloudFilesCDNSecure + '/' + image.name, name: image.name || '' });

    Which is equivalent to the current imgur plugins bit:

    callback(null, { url: data.link.replace('http:', 'https:'), name: image.name || '' });

    Any ideas?