Skip to content
  • 0 Votes
    6 Posts
    4k Views
    frissdiegurkeF

    Problem of Emoji.
    http://i.gyazo.com/18e592942f2c80d64c38ab888f14ac46.png

    Please check the url attribute within your config.json (within NodeBB root).

    See https://community.nodebb.org/topic/3392/config-json-updated-base_url-and-relative_path-no-longer-exist/10 for more details on this.

  • 0 Votes
    5 Posts
    3k Views
    N

    My case is to provide text-area for the user in ACP, so user for example can "change template" of rendering list item.

    For example one possible solution:

    Store template markup in settings, and ask user to reload NodeBB. In static:load use file system instruments to rewrite template.

    But I'm not happy with such solution 😉

  • 0 Votes
    6 Posts
    3k Views
    P

    Hmm. That might make sense, maybe on plugin activate it appends to end and on deactivate it removes it

  • 0 Votes
    2 Posts
    2k Views
    N

    Good news, that we don't need to add filter, there is filter for user profile: filter:user.account
    But what is about static template?

  • 2 Votes
    7 Posts
    6k Views
    Chad Aga AbingunaC

    @Hägar said in Emailer via local SMTP and SSL/TLS:

    nodebb-plugin-emailer-ssl-smtp

    Internal Error. Oops! Looks like something went wrong! /admin/emailers/smtpssl Failed to lookup view "admin/emailers/smtpssl" in views directory "/home/nodebb/nodebb/build/public/templates"

    😞

  • 0 Votes
    3 Posts
    2k Views
    barisB

    Those errors usually mean websockets are not proxied correctly, make sure your nginx setup is correct. If you are using cloudflare you need to disable acceleration. They don't support websockets on smaller plans.

  • 0 Votes
    3 Posts
    2k Views
    barisB

    That error is caused by the following bit of code in src/plugins.js

    paths = paths.map(function(pluginLib) { var parent = path.dirname(pluginLib); return cached.filter(function(libPath) { return libPath.indexOf(parent) !== -1; }); }).reduce(function(prev, cur) { return prev.concat(cur); });

    If paths is an empty array calling reduce will throw that error. We should add better checks to detect that.

  • 0 Votes
    12 Posts
    5k Views
    nhl.plN

    You can open a new issue for discussion and feedback.

  • 2 Votes
    13 Posts
    5k Views
    crazycellsC

    Hi @julian , while restarting the forum (1.19.1) , I get this "warning" for canned-responses plugin... Is this a problem or normal?

     started 2022-02-03T04:28:25.721Z [4567/3637012] - info: [build] Building in series mode 2022-02-03T04:28:25.724Z [4567/3637012] - info: [build] plugin static dirs build started 2022-02-03T04:28:25.756Z [4567/3637012] - info: [build] plugin static dirs build completed in 0.032sec 2022-02-03T04:28:25.756Z [4567/3637012] - info: [build] requirejs modules build started 2022-02-03T04:28:35.741Z [4567/3637012] - info: [build] requirejs modules build completed in 9.984sec 2022-02-03T04:28:35.743Z [4567/3637012] - info: [build] client js bundle build started 2022-02-03T04:28:39.189Z [4567/3637012] - info: [build] client js bundle build completed in 3.446sec 2022-02-03T04:28:39.189Z [4567/3637012] - info: [build] admin js bundle build started 2022-02-03T04:28:43.542Z [4567/3637012] - info: [build] admin js bundle build completed in 4.353sec 2022-02-03T04:28:43.543Z [4567/3637012] - info: [build] client side styles build started 2022-02-03T04:28:51.795Z [4567/3637012] - info: [build] client side styles build completed in 8.252sec 2022-02-03T04:28:51.796Z [4567/3637012] - info: [build] admin control panel styles build started 2022-02-03T04:28:58.818Z [4567/3637012] - info: [build] admin control panel styles build completed in 7.022sec 2022-02-03T04:28:58.820Z [4567/3637012] - info: [build] templates build started [benchpress] warning: output bloat due to ambiguous inner BEGIN --> admin/plugins/canned-responses.tpl:44:17 | 44 | <!-- BEGIN responses --> | ^^^^^^^^^ `responses` could refer to the top-level value `responses` or the `.responses` property of the current element, so compiler must emit code for both cases | note: Migrate to modern syntax to avoid the ambiguity. This will become an error in the future. 2022-02-03T04:29:00.904Z [4567/3637012] - info: [build] templates build completed in 2.084sec 2022-02-03T04:29:00.905Z [4567/3637012] - info: [build] languages build started 2022-02-03T04:29:07.261Z [4567/3637012] - info: [build] languages build completed in 6.356sec 2022-02-03T04:29:07.264Z [4567/3637012] - info: [build] Asset compilation successful. Completed in 41.54sec. [cluster] Restarting... 2022-02-03T04:29:07.321Z [4567/3637012] - info: [app] Shutdown (SIGTERM/SIGINT) Initialised. 2022-02-03T04:29:07.332Z [4567/3637012] - info: [app] Web server closed to connections. 2022-02-03T04:29:07.338Z [4567/3637012] - info: [app] Live analytics saved. Clustering enabled: Spinning up 1 process(es). 2022-02-03T04:29:07.393Z [4567/3637012] - info: [app] Database connection closed. 2022-02-03T04:29:07.394Z [4567/3637012] - info: [app] Shutdown complete. [cluster] Child Process (3637012) has exited (code: 0, signal: null) 2022-02-03T04:29:08.058Z [4567/3646564] - info: Initializing NodeBB v1.19.1
  • 1 Votes
    9 Posts
    4k Views
    jareyJ

    @Schamper oh I understand. Well i suppose I will dive a lot into the code and learning a lot about the system in the process. I'm sure a will post a lot of questions in the forum, at least i'll try to implement it succesfully.
    Thanks a lot for your suggestions. 🙂

  • Routing

    NodeBB Plugins
    8
    0 Votes
    8 Posts
    5k Views
    S

    I commented string //categoryRoutes(router, middleware, controllers); in src/routes/index.js file and add all of this file in index.js my plugin:

    (function(Preparsed) { 'use strict'; var nconf = module.parent.require('nconf'), path = module.parent.require('path'), winston = module.parent.require('winston'), controllers = require.main.require('./src/controllers'), meta = require.main.require('./src/meta'), plugins = require.main.require('./src/plugins'), express = module.parent.require('express'), metaRoutes = require.main.require('./src/routes/meta'), apiRoutes = require.main.require('./src/routes/api'), adminRoutes = require.main.require('./src/routes/admin'), feedRoutes = require.main.require('./src/routes/feeds'), pluginRoutes = require.main.require('./src/routes/plugins'), authRoutes = require.main.require('./src/routes/authentication'), helpers = require.main.require('./src/routes/helpers'); var setupPageRoute = helpers.setupPageRoute; function mainRoutes(app, middleware, controllers) { setupPageRoute(app, '/', middleware, [], controllers.home); var loginRegisterMiddleware = [middleware.redirectToAccountIfLoggedIn]; setupPageRoute(app, '/login', middleware, loginRegisterMiddleware, controllers.login); setupPageRoute(app, '/register', middleware, loginRegisterMiddleware, controllers.register); setupPageRoute(app, '/confirm/:code', middleware, [], controllers.confirmEmail); setupPageRoute(app, '/outgoing', middleware, [], controllers.outgoing); setupPageRoute(app, '/search/:term?', middleware, [middleware.guestSearchingAllowed], controllers.search.search); setupPageRoute(app, '/reset/:code?', middleware, [], controllers.reset); setupPageRoute(app, '/tos', middleware, [], controllers.termsOfUse); } function staticRoutes(app, middleware, controllers) { setupPageRoute(app, '/404', middleware, [], controllers.static['404']); setupPageRoute(app, '/403', middleware, [], controllers.static['403']); setupPageRoute(app, '/500', middleware, [], controllers.static['500']); } function topicRoutes(app, middleware, controllers) { app.get('/api/topic/teaser/:topic_id', controllers.topics.teaser); setupPageRoute(app, '/topic/:topic_id/:slug/:post_index?', middleware, [], controllers.topics.get); setupPageRoute(app, '/topic/:topic_id/:slug?', middleware, [middleware.addSlug], controllers.topics.get); } function tagRoutes(app, middleware, controllers) { setupPageRoute(app, '/tags/:tag', middleware, [middleware.publicTagListing], controllers.tags.getTag); setupPageRoute(app, '/tags', middleware, [middleware.publicTagListing], controllers.tags.getTags); } function categoryRoutes(app, middleware, controllers) { setupPageRoute(app, '/categories', middleware, [], controllers.categories.list); setupPageRoute(app, '/popular/:term?', middleware, [], controllers.categories.popular); setupPageRoute(app, '/recent', middleware, [], controllers.categories.recent); setupPageRoute(app, '/unread', middleware, [middleware.authenticate], controllers.categories.unread); app.get('/api/unread/total', middleware.authenticate, controllers.categories.unreadTotal); setupPageRoute(app, '/category/:category_id/:slug/:topic_index', middleware, [], controllers.categories.get); setupPageRoute(app, '/category/:category_id/:slug?', middleware, [middleware.addSlug], controllers.categories.get); } function accountRoutes(app, middleware, controllers) { var middlewares = [middleware.checkGlobalPrivacySettings]; var accountMiddlewares = [middleware.checkGlobalPrivacySettings, middleware.checkAccountPermissions]; setupPageRoute(app, '/user/:userslug', middleware, middlewares, controllers.accounts.getAccount); setupPageRoute(app, '/user/:userslug/following', middleware, middlewares, controllers.accounts.getFollowing); setupPageRoute(app, '/user/:userslug/followers', middleware, middlewares, controllers.accounts.getFollowers); setupPageRoute(app, '/user/:userslug/posts', middleware, middlewares, controllers.accounts.getPosts); setupPageRoute(app, '/user/:userslug/topics', middleware, middlewares, controllers.accounts.getTopics); setupPageRoute(app, '/user/:userslug/groups', middleware, middlewares, controllers.accounts.getGroups); setupPageRoute(app, '/user/:userslug/favourites', middleware, accountMiddlewares, controllers.accounts.getFavourites); setupPageRoute(app, '/user/:userslug/watched', middleware, accountMiddlewares, controllers.accounts.getWatchedTopics); setupPageRoute(app, '/user/:userslug/edit', middleware, accountMiddlewares, controllers.accounts.accountEdit); setupPageRoute(app, '/user/:userslug/settings', middleware, accountMiddlewares, controllers.accounts.accountSettings); setupPageRoute(app, '/notifications', middleware, [middleware.authenticate], controllers.accounts.getNotifications); setupPageRoute(app, '/chats/:userslug?', middleware, [middleware.redirectToLoginIfGuest], controllers.accounts.getChats); } function userRoutes(app, middleware, controllers) { var middlewares = [middleware.checkGlobalPrivacySettings]; setupPageRoute(app, '/users', middleware, middlewares, controllers.users.getOnlineUsers); setupPageRoute(app, '/users/online', middleware, middlewares, controllers.users.getOnlineUsers); setupPageRoute(app, '/users/sort-posts', middleware, middlewares, controllers.users.getUsersSortedByPosts); setupPageRoute(app, '/users/sort-reputation', middleware, middlewares, controllers.users.getUsersSortedByReputation); setupPageRoute(app, '/users/latest', middleware, middlewares, controllers.users.getUsersSortedByJoinDate); setupPageRoute(app, '/users/search', middleware, middlewares, controllers.users.getUsersForSearch); } function groupRoutes(app, middleware, controllers) { var middlewares = [middleware.checkGlobalPrivacySettings, middleware.exposeGroupName]; setupPageRoute(app, '/groups', middleware, middlewares, controllers.groups.list); setupPageRoute(app, '/groups/:slug', middleware, middlewares, controllers.groups.details); setupPageRoute(app, '/groups/:slug/members', middleware, middlewares, controllers.groups.members); } Preparsed.init = function(params, callback){ var app = params.router, middleware = params.middleware, controllers = params.controllers; var router = express.Router(), pluginRouter = express.Router(), authRouter = express.Router(), relativePath = nconf.get('relative_path'); pluginRouter.render = function() { app.render.apply(app, arguments); }; // Set-up for hotswapping (when NodeBB reloads) pluginRouter.hotswapId = 'plugins'; authRouter.hotswapId = 'auth'; app.use(middleware.maintenanceMode); app.all(relativePath + '/api/?*', middleware.prepareAPI); app.all(relativePath + '/api/admin/?*', middleware.isAdmin); app.all(relativePath + '/admin/?*', middleware.ensureLoggedIn, middleware.applyCSRF, middleware.isAdmin); adminRoutes(router, middleware, controllers); metaRoutes(router, middleware, controllers); apiRoutes(router, middleware, controllers); feedRoutes(router, middleware, controllers); pluginRoutes(router, middleware, controllers); /** * Every view has an associated API route. * */ mainRoutes(router, middleware, controllers); staticRoutes(router, middleware, controllers); topicRoutes(router, middleware, controllers); tagRoutes(router, middleware, controllers); categoryRoutes(router, middleware, controllers); accountRoutes(router, middleware, controllers); userRoutes(router, middleware, controllers); groupRoutes(router, middleware, controllers); app.use(relativePath, pluginRouter); app.use(relativePath, router); app.use(relativePath, authRouter); if (process.env.NODE_ENV === 'development') { require('./debug')(app, middleware, controllers); } app.use(function(req, res, next) { if (req.user || parseInt(meta.config.privateUploads, 10) !== 1) { return next(); } if (req.path.indexOf('/uploads/files') === 0) { return res.status(403).json('not-allowed'); } next(); }); app.use(relativePath, express.static(path.join(__dirname, '../../', 'public'), { maxAge: app.enabled('cache') ? 5184000000 : 0 })); handle404(app, middleware); handleErrors(app, middleware); // Add plugin routes plugins.init(app, middleware); authRoutes.reloadRoutes(); callback(); }; function handle404(app, middleware) { app.use(function(req, res, next) { if (plugins.hasListeners('action:meta.override404')) { return plugins.fireHook('action:meta.override404', { req: req, res: res, error: {} }); } var relativePath = nconf.get('relative_path'); var isLanguage = new RegExp('^' + relativePath + '/language/[\\w]{2,}/.*.json'), isClientScript = new RegExp('^' + relativePath + '\\/src\\/.+\\.js'); if (isClientScript.test(req.url)) { res.type('text/javascript').status(200).send(''); } else if (isLanguage.test(req.url)) { res.status(200).json({}); } else if (req.accepts('html')) { if (process.env.NODE_ENV === 'development') { winston.warn('Route requested but not found: ' + req.url); } res.status(404); if (res.locals.isAPI) { return res.json({path: req.path, error: 'not-found'}); } middleware.buildHeader(req, res, function() { res.render('404', {path: req.path}); }); } else { res.status(404).type('txt').send('Not found'); } }); } function handleErrors(app, middleware) { app.use(function(err, req, res, next) { if (err.code === 'EBADCSRFTOKEN') { winston.error(req.path + '\n', err.message) return res.sendStatus(403); } winston.error(req.path + '\n', err.stack); if (parseInt(err.status, 10) === 302 && err.path) { return res.locals.isAPI ? res.status(302).json(err.path) : res.redirect(err.path); } res.status(err.status || 500); if (res.locals.isAPI) { return res.json({path: req.path, error: err.message}); } else { middleware.buildHeader(req, res, function() { res.render('500', {path: req.path, error: err.message}); }); } }); } }(module.exports));

    Changing accordingly all paths and replaced var app, middleware and controllers. But not work:
    Снимок экрана от 2015-03-17 00:30:46.png
    Tried on action:app.load and action:init.

  • 0 Votes
    7 Posts
    4k Views
    julianJ

    Yes, as @Schamper recommends, do not use relative paths to break out of the plugin's root directory, just use module.parent.require to require from the context of plugins.js, or require.main.require to require from the context of app.js

    To answer OP, I use npm link to link my folders together. I have one big messy NodeBB install ( 😉 ) and next to it is a plugins/ folder where all the plugins live.

    @psychobunny integrated grunt into NodeBB, so I just use grunt --verbose to develop now, instead of ./nodebb dev 😄

  • 0 Votes
    4 Posts
    3k Views
    A

    I am writing like plug-in, which provides an like functionality for anonymous as well as registered user.
    1. Anonymous User should be able to like on any comment/reply and I have to restrict anonymous user via IP address.
    Yet, I can store IP values to redis database, I need to find out, The given IP value is present in "like:pid" hash set.
    I need to write query structure which finds out the given anonymous users IP address is not present in database for that particular post.

    Thanks!!

  • 0 Votes
    6 Posts
    3k Views
    julianJ

    @akumbhare It will be available in v0.7.0.

  • 0 Votes
    14 Posts
    10k Views
    JonDoe12J

    I was just going to let you take most of the credit. It's still your plugin, and you helped me make the modifications. I'm working on a new modification now, though. I'm trying to get the presentations to embed into an area of the user's profile.

    Right now, I'm testing it with the Fullname field on the profile, by entering the URL of the presentations (instead of a human name) and seeing if it parses into an embedded slide show.

    Would this be easy to accomplish? If not, are there any hints you could give me @a_5mith ?

    So far, I've edited the library.js file and replaced data.post and data.post.conent with data.fullname and data.fullname.content. I've also tried changing the hook in plugin.js from:

    { "hook": "filter:parse.post", "method": "parse", "callbacked": true } ]

    to

    { "hook": "action:user.set", "method": "parse", "callbacked": true } ]

    I feel like I'm missing something, though. If you're up to it, I'd like to collaborate with you further.

  • 1 Votes
    3 Posts
    3k Views
    OrotonO

    Is it even possible to integrate a plug in that posts to a 'group'

    I'm sure FB only allows posting to fan pages and walls.

    That being said, I know you can do 'Canvas' app for NodeBB on FB, but this only integrates with FB notifiactions
    On the Browser, where as you'll find most of the time they check FB via mobile. And FB mobile is not compatible with
    Canvas or any external FB notifications.

    So you are probably going to be disappointed with it's results.

    Also, on that note. I've found it susccefull for mobile users, using a push notification app. That notifies users on events.
    And when they are notified, it refers them back to your forum. via a webui Browser in the app.
    This works great with a Responsive design or a dedicated mobile browser.

  • 0 Votes
    11 Posts
    6k Views
    orweinbergerO

    Hey @Ted any updates on this maybe? Thanks for working on this!

  • 1 Votes
    1 Posts
    2k Views
    A

    Hi,

    We want to migrate wordpress posts as well as comments and replies associated to that post into nodeBB under General Discussion category.
    Please note our wordpress site is multi-site network.
    We have search for the implemented plug-in but we have not found any plug-in.
    So if you know any kind of a plug-in supported for latest version 0.6.0 which fulfil our requirement, please let us know.

    If there is no such kind of a plugin is available we are planning to implement wordpress plugin which migrate posts as well as comments and replies associated to that post.

    To implement wordpress plugin we need REST/MOBILE API. So by using that REST/MOBILE API, We can create topics/comments/reply from outside the nodeBB environment. So please let us know if nodeBB supports such kind of REST/MOBILE API.

    So any help would be greatly appreciated.
    Thanks!!!

  • Thread Prefix Plugin

    NodeBB Plugins
    7
    0 Votes
    7 Posts
    4k Views
    J

    @a_5mith Thats what I was thinking. Thanks! I might get something together for it.