JJSagan
Posts
-
nodebb-plugin-composer-quill: WYSIWYG alternative to redactor -
NodeBB v1.12.2 released!Great job!
-
What's New in v1.9.0I would like to extend my appreciation for the amazing work you guys are doing. The endless hours that you are spending working on NodeBB, and the professionalism that you have shown continues to impress me, and I believe many many others, immensely. Thank you once again for all your effort!
-
Postgresql IntegrationDear NodeBB Team,
May I humbly request to have Postgresql supported?
I understand that I am asking a lot, I mean, when you commit a feature, you have to support it going forward, so this may become a liability and a big headache, especially given the number of forums you must have on your back.
The upside is that Postgresql integration will allow simple and cost effective setup/hosting (for example in Amazon/Heroku, where Postgresql is provided as a service with automated backups/restore).
I believe (my humble personal opinion), that with Postgresql support, NodeBB will become more popular, especially with the teams that have less IT experience (yes, I admit I am one of them ).
It seems that @Ben-Lubar completed the Postgresql driver and has a pending pull request: https://github.com/NodeBB/NodeBB/pull/5861. It looks like the relevant DB tests passed and the driver is ready for action. Furthermore, from what I read the driver has similar performance to Mongo/Redis. I would love to see it committed to master so I could give it a test run.
Lastly, I realize that you must be extremely busy, so I totally understand if Postgresql is put on the back burner. I have yet to see a similar team that is so helpful. Thus so far you immensely helped my efforts and I am most appreciative.
Thanks again for your kind consideration,
JJ. -
Securing NodeBB with A+ SSL (AWS Linux2 + LetsEncrypt + Nginx + Exploits)Hello Everyone,
I am new to NodeBB so kindly hold on with the tomatoes.
First, I must say that I found NodeBB only few days ago and been playing with it ever since.
I absolutely love it. You guys have made excellent work!!!Kindly allow me to make a small contribution.
I was looking for ways to set up NodeBB with SSL, and I wanted to make sure the site is secured, and I must say that getting there gave me more gray hair than my calculus professor, lol Let me cut some corners for ya-all:
Target platform: EC2 @ Amazon
OS: Amazon Linux2Installation Steps:
- Note that in AWS Linux, you can't immediately install LetsEncrypt (Certbot) and Nodejs. For that follow:
1a. Aws Linux 2 is similar to Centos7, the best way to install is to follow: https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html
1b. LetsEncrypt (with manual hack): https://community.letsencrypt.org/t/help-with-certbot-on-the-new-amazon-linux-2/49399/7 - Follow: https://hostpresto.com/community/tutorials/how-to-install-nodebb-forum-on-centos-7/
- Configure NodeBB with DB (I used AWS Redis - rants below)
- Install nginx: In AWS linux: $amazon-linux-extras install nginx1.12
- Note, I did not need to change SELinux on my setup.
Addressing SSL security:
- Find out the latest setup recommendations for security for your nginx version: https://mozilla.github.io/server-side-tls/ssl-config-generator/
- Remove exploits: Add into the nginx config file:
https://www.howtoforge.com/nginx-how-to-block-exploits-sql-injections-file-injections-spam-user-agents-etc - I was having real hard time with HSTS header - it looks as though someone else (nodebb?) is inserting this header, so don't include that header in nginx.
- Check your site: go to: https://www.ssllabs.com/ssltest/ with the above you should get A+
Database Rants:
- Redis (AWS Free Tier) does not support backup, and its mighty expensive otherwise.
- MongDB is not available in AWS Free Tier.
- AWS Postgres is awesome and available for AWS Free Tier, making NodeBB + Postgres is the ultimate solution for AWS. I saw that mighty @Ben-Lubar got that figured out, however, his pull request is collecting dust as of Jan-13 (https://github.com/NodeBB/NodeBB/pull/5861). @barisusakli, your help pushing the code to master will be highly appreciated, thank you!!!
Security issues:
I wanted no guests, so following https://community.nodebb.org/topic/2371/faq-how-to-make-your-forum-private I added a small JS that checks if the UUID==0 and kicks the user to the login page.- Clicking breadcrumb in the login page allows the guest user to go back to the forum main page (in my case, categories). I disabled categories to guests, so that page is now blank.
- The said JS code does not run for guests users, so if the guest used breadcrumb to redirect to the main page, I would have expected redirection to login.
How to repeat? Simply log out of your account. To resolve, may I suggest to:
- Remove breadcrumbs from the login page
- Allow the js code added in the admin page, to run for guests as well.
Additional issues:
- I installed the onesignal plugin, and I can confirm it does not work. Note, I pulled the latest code from github: https://github.com/CCob/nodebb-plugin-onesignal . Furthermore, the plugin description is a bit difficult - where should I change the "redirect_uri"? OneSignal gui does not allow you to add /onesignal/auth. Redirect entire site in nginx? but that would affect all users. @CCob your help will be highly appreciated.
- I can confirm the text in the chat window (when not in full screen) is reversed from the getgo, that is with no special css. @mohammadhassan is correct (see: https://github.com/NodeBB/NodeBB/issues/6192 ). The issue exists in the master branch. @julianlam, your help will be highly appreciated. May I suggest to remove the text, and use an icon similar to the one used in the full-page chat? When will the new chat GUI become available in master btw?
- Clicking the image of the user in the chat window (full screen), opens the user profile, but below the chat window. I believe it should be opened above the chat window - but this is no biggie.
Again, awesome forum!!! I love it. Amazing work guys. Chapeau!
All the best,
JJ.[Now you can go ahead with the tomatoes]
- Note that in AWS Linux, you can't immediately install LetsEncrypt (Certbot) and Nodejs. For that follow:
-
NodeBB 1.11.0: traffic filtering, navigation improvements and moreAmazing work, as always!
-
Happy new yearDear Devs,
Thank you very much for your continued support and for the ever evolving NodeBB forum.
Warmest thoughts and best wishes for a wonderful holiday and a very happy new year. Wishing you the gifts of the season — Peace, Hope and Happiness.
JJ. -
nodebb-plugin-composer-quill: WYSIWYG alternative to redactorNo problemo @Kosiak , do check back on this plugin after October.
If you are looking for WYSIWYG then I believe this could be the solution for you, since Redactor unfortunately may be on its way out.
Take care and good luck with your forum!
btw: i started few months ago as none-coder like you (and yeah I still suck...), so be careful you might get addicted and convert -
Mongodb or PostgreSQL? Ah, that is the question...Not much to learn from my experience, since my #users/day is pathetic.
As for tdwtf, I personally don't believe it would have been faster with Mongo, but I could be wrong. I looked but unfortunately I could not find the exact benchmark chart I was referring to earlier. Nevertheless, see here: https://what.thedailywtf.com/topic/25362/so-about-that-postgresql-thing/8?lang=en-US&page=1Finally, you should consider visiting tdwtf often, the posts there are among the funniest I have ever encountered
-
NodeBB v1.12.0 is released!Thank you for this awesome release. NodeBB is getting stronger and stronger
Can't wait for the next release that may finally include Quill. Have a great weekend guys, and thanks again for your hard work!
JJ. -
Postgresql IntegrationHi All,
I decided to look at the recent commits, and..., well, could not believe my eyes, PostgreSQL just got integrated!
PostgreSQL opens the door for (novice) admins to create forums based on NodeBB, on cloud platforms that don't support MongoDB or Redis, or where such support is too expensive.
With PostgreSQL support, the admin does not need to create and maintain a database on an instance - instead for a similar cost he may opt for PostgreSQL as service. In Amazon AWS for example, the service comes with automated backup and restore. The integration is quite speedy with low to moderate effort (basically reading few AWS documents and following examples).
Besides that, PostgreSQL offers additional features over key-value database, so future releases may benefit as well.
This amazing achievement was made possible by @Ben-Lubar, with help from @julian and the rest of the NodeBB team.
Congratulations on this fine release.
I am grateful for your work and dedication!
JJ. -
NodeBB 1.8.0: chat updates, improved moderation controls and moreWhat can I say, amazing work, done by an amazing team! Thank you!
-
Potential Issue with GPRD - only admin is allowed to DL dataIssue was fixed by @barisusakli see: https://github.com/NodeBB/NodeBB/issues/6524
Thank you so much!
-
NPM Audit vulnerabilitiesHi Developers,
Just noticed few vulnerabilities flagged by npm audit.
It may make sense to update less, debug (socket.io-adapter-mongo), and string.
Not sure however if updating these libraries break other code.
Thanks!
JJ. -
nodebb-plugin-global-chatHi Devs,
Had some time to play around with nodebb-plugin-global-chat, great plugin!
Allow me to recommend two minor changes, as follows:
- In the client script, the reference to elem should be:
var elem = $(e.target).parent();
- Displaying all users on the chat header takes a lot of space. How about displaying just the group name? See below css only change:
$('head').append( '<style type="text/css">' + '[data-roomid="' + roomId + '"] [component="chat/header"] span.members' + '{ visibility: hidden;' + ' font-size: 0;' + '}' + '[data-roomid="' + roomId + '"] [component="chat/header"] span.members:after ' + '{ content: "Global Chat"; ' + ' font-size: 14px;' + ' visibility: visible;' + ' display: block;' + ' position: absolute;' + ' margin-top: -20px;' + '}</style>');
Two questions if I may:
- Is there an api to change the group chat slug? for example post a picture?
- After uninstall, the global-chat group was not deleted. This was previously discussed here: https://github.com/NodeBB/nodebb-plugin-global-chat/issues/1. Per said thread on mongo one may do the following:
db.getCollection('objects').remove({_key: /chat:room:387:mids$/}) db.getCollection('objects').remove({_key: /chat:rooms:unread$/, value: "387"}); db.getCollection('objects').remove({_key: "chat:room:387:uids"}); db.getCollection('objects').remove({_key: /chat:rooms$/, value: "387"});
Can you please point me in the right direction on how to write a similar code for the global-chat plugin?
Thank you!
JJ. -
Hook for group.join and group.leaveThank you @baris !
For anyone else looking for the same, action:group.join and action:group.leave provide a single uid, and one or more group names (as array).
Have fun developing -
Changes to nodebb-plugin-rss in light of YQL shutdownHi Devs,
YQL service is down for good. See notice here: https://developer.yahoo.com/yql/
Let's make nodebb-plugin-rss work again!
Please consider the following changes to the plugin:
- In package.json add:
"rss-parser": "^3.6.2"
- In index.js: Add on the top:
var Parser = require('rss-parser');
- In index.js function pullFeeds: comment out var entry= and change as follows:
async.eachSeries(entries, function(entryObj, next) { //var entry = entryObj.entry; var entry = {title: entryObj.title, content: {content: entryObj.content}, published: entryObj.pubDate, link: {href: entryObj.link}, id: entryObj.guid, category: entryObj.categories} ;
- In index.js function getFeedByYahoo, comment out the entire request section, and replace with:
let parser = new Parser(); parser.parseURL(feedUrl, function(err, feed) { if(err) callback(err); callback(null, feed.items); });
Note, I did not take care of entriesToPull, however its trivial to truncate the feed array (I know, I am a bad boy and I should be spanked).
- In index.js function checkFeed, comment out var entryData =, and change as follows:
entries = entries.map(function (entry) { //var entryData = entry.entry || {}; var entryData = {title: entry.title, content: {content: entry.content}, published: entry.pubDate, link: {href: entry.link}, id: entry.guid, category: entry.categories} ;
That's it.
Note I had to disable "convert to markdown" so the images would display properly.Let me know should you have any questions,
JJ. -
nodebb-plugin-composer-quill: WYSIWYG alternative to redactorHi Devs,
Given the licensing issues with Redactor, I started transitioning to quill, using @julian 's latest nodebb-plugin-composer-quill.
Overall the plugin is in good shape, and quill is just great and stable tool.
If any of you wish to make a switch, it might be helpful to note the following:
-
The plugin uses a simple JSON format, instead of the good old string format we were used to. That means special care must be taken both at the server and at client. Be careful! if you have JS that are used on both the client and server, make sure to return string in each function - use JSON.stringify() where needed.
-
You may access quill from your plugin - the quill plugin saves a ptr as follows:
targetEl.data('quill', quill);
so in your plugin you may:
var quill = $('[data-uuid="' + composer.active + '"] .ql-container.ql-snow').data("quill"); -
I have not added tooltips, but I understand it should be done as follows:
$(targetEl.find('[data-toggle="tooltip"]')).tooltip(); -
chat: I like having icons for image upload and video links. To enable that change the line to:
$(window).on('action:chat.loaded', function (e, containerEl) {
// Create div element for composer
//var targetEl = $('<div></div>').insertBefore(components.get('chat/input'));
var html =
'<div></div>' +
'<div class="btn-toolbar formatting-bar">' +
'<form id="fileForm" method="post" enctype="multipart/form-data">' +
'<input type="file" id="files" name="files[]" multiple="" class="gte-ie9 hide">' +
'</form>' +
'</div>';
var targetEl = $(html).insertBefore(components.get('chat/input'));Also change the theme to snow. You also need to change the .less a bit to position the icons above the textbox.
*** Note, with the above targetEl changes, I am getting the file upload dialog box, but after selecting a file I am not getting the upload event - still working on this one... @julian if you have some time please help.
-
on chat send, rework the code to return the writing direction to defaults :
$(window).on('action:chat.sent', function (e, data) {
...// add at the end:
var textDirection = $('html').attr('data-dir');
quill.format('direction', textDirection);
quill.format('align', textDirection === 'rtl' ? 'right' : 'left');
}); -
See $(window).on('action:composer.uploadUpdate', function (e, data) and change the path in:
if (data.text.startsWith('/'))
to where your upload files are located. -
In the same function there's some code that adds random string to the filename to avoid collision. If you are already handling this, make sure to remove it.
-
in composer.tpl, it may make sense to move the tags line below the topic - currently its in the bottom.
-
Haven't looked at sanitizing quill at the server, but found a lead here: https://github.com/quilljs/quill/issues/510
-
The chat teaser (when you load the chat menu) displays the JSON quill format, that is, the data needs to be filtered to extract the text. That requires changes on the nodebb core files, and I can't make these...
That's where I am at. I'll update as I make more progress.
Overall quill is really good editor, it may be worth while for you to dive in.
Happy hunting,
JJ. -
-
Redis or MongoDB?Anyway, my point was that PostgreSQL is stable and working.
Take care!