Skip to content

NodeBB Development

Stay tuned here to hear more about new releases and features of NodeBB!

2.8k Topics 18.5k Posts

Subcategories


  • Posts from the NodeBB Development Blog
    96 Topics
    780 Posts
    kainosK
    Very good Vlad. I am Vladislav.
  • Found a bug? Why not make a bug report here?
    1k Topics
    7k Posts
    barisB
    Because you ran the forum without indexes you have documents that violate the index constraints. You will have to remove these documents for the create index command to work.
  • Focused discussion related to ActivityPub integration in NodeBB

    108 Topics
    2k Posts
    jupiter_rowland@hub.netzgemeinde.euJ
    @Ben Pate This looks like it’s pulled from Streams, yes? Which means it’s not related to the Forums and Threaded Discussions Working Group, is that right?Conversation Containers were originally built on and for (streams), yes. They were pretty much done some nine months ago.#FediMeta #FediverseMeta #CWFediMeta #CWFediverseMeta #Streams #(streams) #ConversationContainers
  • Help Translate NodeBB
  • Japanese Localization

    3
    0 Votes
    3 Posts
    1k Views
    snodejokeS
    Thanks Julian, you're a legend!
  • Embedded template buttons don't work

    8
    0 Votes
    8 Posts
    2k Views
    A
    Ok, so for example, if I wanted to get the js for the reply, favorite and upvote button functionatliy, where/how would I grab that script? I noticed the buttons all use the component system, so do I have to somehow include components.js in the new template? How would I go about doing that?
  • Oauth not using refresh token

    1
    0 Votes
    1 Posts
    764 Views
    ?
    Hi guys, I have been using this plugin (like everyone else) [https://github.com/julianlam/nodebb-plugin-sso-oauth] to make a SSO plugin for Nodebb. This particular variant will be for Magento 1 where they use OAuth 1.0. Generally speaking, the plugin works well with a few code tweaks. However, it always seems to request a new token rather then using the existing, or refreshing if needed. I can guarantee the issue is my code .. but I seem to be stuck on where to begin on figuring out what should be done here. I have looked around, and in the other SSO plugins that are around, but it seems like it automagically happens without much code done to make it so. Everything else works but that last little step.. [code] (function(module) { "use strict"; var User = module.parent.require('./user'), Groups = module.parent.require('./groups'), meta = module.parent.require('./meta'), db = module.parent.require('../src/database'), passport = module.parent.require('passport'), fs = module.parent.require('fs'), path = module.parent.require('path'), nconf = module.parent.require('nconf'), winston = module.parent.require('winston'), async = module.parent.require('async'); var authenticationController = module.parent.require('./controllers/authentication'); var constants = Object.freeze({ type: 'oauth', name: 'Magento', admin: { 'route': '/plugins/sso-magento', 'icon': 'fa-twitter-square' }, }); var Magento = {}, passportOAuth, opts; Magento.init = function(data, callback) { function render(req, res, next) { res.render('admin/plugins/sso-magento', {}); } data.router.get('/admin/plugins/sso-magento', data.middleware.admin.buildHeader, render); data.router.get('/api/admin/plugins/sso-magento', render); callback(); }; Magento.getStrategy = function(strategies, callback) { meta.settings.get('sso-magento', function(err, settings) { if (!err && settings['key'] && settings['secret'] && settings['requesttoken'] && settings['accesstoken'] && settings['userauthorize'] && settings['userroute']) { passportOAuth = require('passport-oauth')[constants.type === 'oauth' ? 'OAuthStrategy' : 'OAuth2Strategy']; var oauth = { requestTokenURL: settings['requesttoken'], accessTokenURL: settings['accesstoken'], userAuthorizationURL: settings['userauthorize'], consumerKey: settings['key'], consumerSecret: settings['secret'], callbackURL: settings['callback'] }; if (constants.type === 'oauth') { // OAuth options opts = oauth; passportOAuth.Strategy.prototype.userProfile = function(token, secret, params, done) { this._oauth.get(settings['userroute'], token, secret, function(err, body, res) { if (err) { return done(err); } try { var json = JSON.parse(body); Magento.parseUserReturn(json, function(err, profile) { if (err) return done(err); profile.provider = constants.name; done(null, profile); }); } catch(e) { done(e); } }); }; } passport.use(constants.name, new passportOAuth(opts, function(token, secret, profile, done) { Magento.login({ oAuthid: profile.id, handle: profile.displayName, email: profile.emails[0].value, isAdmin: profile.isAdmin }, function(err, user) { if (err) { return done(err); } done(null, user); }); })); strategies.push({ name: constants.name, url: '/auth/' + constants.name, callbackURL: '/auth/' + constants.name + '/callback', icon: 'fa-check-square', scope: (constants.scope || '').split(',') }); callback(null, strategies); } else { callback(new Error('Magento OAuth Configuration is invalid')); } }); } Magento.parseUserReturn = function(data, callback) { for (var key in data) break; var profile = {}; profile.id = key; profile.displayName = data[key].firstname + data[key].lastname; profile.emails = [{ value: data[key].email }]; callback(null, profile); } Magento.addMenuItem = function(custom_header, callback) { custom_header.authentication.push({ "route": constants.admin.route, "icon": constants.admin.icon, "name": constants.name }); callback(null, custom_header); }; Magento.login = function(payload, callback) { Magento.getUidByOAuthid(payload.oAuthid, function(err, uid) { if(err) { return callback(err); } if (uid !== null) { // Existing User callback(null, { uid: uid }); } else { // New User var success = function(uid) { // Save provider-specific information to the user User.setUserField(uid, constants.name + 'Id', payload.oAuthid); db.setObjectField(constants.name + 'Id:uid', payload.oAuthid, uid); if (payload.isAdmin) { Groups.join('administrators', uid, function(err) { callback(null, { uid: uid }); }); } else { callback(null, { uid: uid }); } }; User.getUidByEmail(payload.email, function(err, uid) { if(err) { return callback(err); } if (!uid) { User.create({ username: payload.handle, email: payload.email }, function(err, uid) { if(err) { return callback(err); } success(uid); }); } else { success(uid); // Existing account -- merge } }); } }); }; Magento.getUidByOAuthid = function(oAuthid, callback) { db.getObjectField(constants.name + 'Id:uid', oAuthid, function(err, uid) { if (err) { return callback(err); } callback(null, uid); }); }; Magento.deleteUserData = function(uid, callback) { async.waterfall([ async.apply(User.getUserField, uid, constants.name + 'Id'), function(oAuthIdToDelete, next) { db.deleteObjectField(constants.name + 'Id:uid', oAuthIdToDelete, next); } ], function(err) { if (err) { winston.error('[sso-oauth] Could not remove OAuthId data for uid ' + uid + '. Error: ' + err); return callback(err); } callback(null, uid); }); }; module.exports = Magento; }(module)); [/code]
  • Group Title Change

    1
    0 Votes
    1 Posts
    1k Views
    barisB
    On master the group title setting has moved from the settings page to the profile edit page. In the database the groupTitle property is in the user hash(user:1) now instead of the user settings hash(user:1:settings). Relevant commits https://github.com/NodeBB/NodeBB/commit/e564260650b5ed5191fde1c464fa87c68b3ce78f If you have a custom theme that has a custom edit/settings page you can apply this change https://github.com/NodeBB/nodebb-theme-vanilla/commit/68f6975c404af2b72a937c77659c7d2fec7e116b
  • How to implement features from nodebb into another site

    2
    0 Votes
    2 Posts
    990 Views
    yariplusY
    You can get most things through the API. Make a request to the page that has the info you want, adding 'api' to the url. Such as `/api/users' will return JSON with the recent members.
  • Integrate NodeBB into your own website

    4
    0 Votes
    4 Posts
    2k Views
    BriB
    You're welcome, hope that helps!
  • Read process.env.NODE_ENV in the footer

    3
    0 Votes
    3 Posts
    2k Views
    danielflippanceD
    Perfect, thank you!
  • styling components

    3
    0 Votes
    3 Posts
    1k Views
    E
    @pichalite said in styling components: @exodo yes you can [component="post/parent"] { padding: 0px; } Will try it Thanks for the response
  • what does this email error mean?

    3
    0 Votes
    3 Posts
    1k Views
    frissdiegurkeF
    NodeBB uses sendmail by default, so if you want to use this you have to install sendmail on your system (it's within ubuntu repositories AFAIK).
  • How to develop a plugin to mount router

    2
    0 Votes
    2 Posts
    1k Views
    H
    I have solved it. use "static:app.load" hook , and use the method's first arguments ,we can setting routes to do what we want to do
  • Can't figure out why ajaxify is not loading for profile link?

    2
    0 Votes
    2 Posts
    1k Views
    barisB
    Switch to persona and see if it's rendering, if it is working fine there you might have a syntax error in your template that is causing templates.js to lock up.
  • Nodebb Docker commands?

    4
    0 Votes
    4 Posts
    3k Views
    Michael Joseph AubryM
    @qgp9 said: vertheless, I don't discourage you to use docker!!, I encourage it I'm just giving a most important tip here. "Don't use docker for production before you know how to deal with a concept of a temporary container" but GOOD FOR TEST AND LEARN. Thanks for the positive answer, it was fun playing around with docker. I ended up realizing the most simple solution was just to share one redis db, duh right. It was good to play around with docker though I did learn a bit.
  • Image icon/thumbnail

    1
    0 Votes
    1 Posts
    1k Views
    D
    Hi! Yesterday i did a post regarding thumbnails for images (https://community.nodebb.org/topic/8385/auto-thumbnail-resize-images) I've been thinking Would it be possible to show a static icon for all images in posts and when the users click on the icon the uploaded image will load? We think uploaded images take to much space, and the nodebb-plugin-image-sizer is complicated for some users to use. Any help/feedback would be appreciated Thansk!
  • [nodebb-plugin-embed-video]

    4
    4 Votes
    4 Posts
    2k Views
    C
    @ogerly is there a setting to set default size for embeds?
  • Web Installer for NodeBB

    18
    5 Votes
    18 Posts
    10k Views
    meetdilipM
    I mean, I was discussing about web installer on a forum dedicated to admins. I would to share how it is done there.
  • Why I can not move categories' location?

    Solved
    3
    0 Votes
    3 Posts
    1k Views
    S
    @phit said: manage categories screen hover over the categ Gotya, Thank you!
  • RFC re: post composition UX on mobile

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    julianJ
    Went ahead and made the changes already
  • jQuery loading twice after adding script to theme

    1
    0 Votes
    1 Posts
    1k Views
    Amir RasyidA
    Greetings, I am trying to directly modify some files in the persona theme to include the slick carousel slider as a header. I've added it as an inline script in header.tpl and also changed my requirejs-config accordingly: require.config({ baseUrl: "{relative_path}/src/modules", waitSeconds: 3, urlArgs: "{config.cache-buster}", paths: { 'jquery': '../../vendor/jquery/js/jquery', 'forum': '../client', 'admin': '../admin', 'vendor': '../../vendor', 'mousetrap': '../../bower/mousetrap/mousetrap', 'slick': 'http://cdn.jsdelivr.net/jquery.slick/1.5.9/slick.min' }, shim: { 'slick' : ['jquery'] } }); I find that the slider and site is working fine only on a fresh page load/reload. On a click of any button to navigate, the slider breaks and i get these errors: Uncaught TypeError: $(...).timeago is not a function Uncaught TypeError: $(...).tooltip is not a function Uncaught TypeError: widgetAreas.find(...).timeago is not a function Probably suggesting that jQuery was loaded more than once. I'm inclined to think that this has got something to do with how I've changed the requirejs above. However leaving out the above change will lead to: Uncaught TypeError: Cannot read property 'fn' of undefined in slick.min.js Possibly suggesting the jQuery wasn't loaded? I've also looked and followed the tips here but nothing seems to work. I just feel that I'm really close to getting it done.
  • On the topic of automatic linking back to a post...

    14
    6 Votes
    14 Posts
    4k Views
    E
    @trevor said: Taking a closer look at the code, its hidden on mobile view using hidden-xs. btn btn-xs btn-default hidden-xs The reason why its hidden... no clue. Maybe to keep noise down the a minimum. Any how, its easy to add back just by removing the hidden-xs part. Yeah i know is easy to change it. i didnt have desktop to check it. Thanks for the info. It was visible on mobiles before
  • Pull down menu for categories

    Moved
    1
    1 Votes
    1 Posts
    1k Views
    Gaurav Grv RobinsonG
    I use the recent posts page as my home on my forum running nodebb. But I really like discourse's approach on showing categories - a pull down menu. [image: PGxC8MY.png] How can I implement such in a menu on the recent posts page in persona theme ?