Questions about moving an existing forum to Discourse


(Peter) #1

Hi Everyone :slight_smile:

I apologise in advance for this long post but perhaps someone familiar with Discourse will know the answers straight off.

I co-run a special-interest forum, which is moderated. There are two of us and the other chap wrote the software (also in Ruby). The existing forum is fully custom software, notable for its simplicity compared to e.g. PHP-BB and Vbulletin (and those keep getting hacked). The database is about 40GB and it has 200k posts. For various reasons we are looking at moving the database to another platform and Discourse looks like it would work.

Preliminary testing suggests that it is pretty good in the overall functionality e.g. support for image and movie embedding. Even multiple image uploads from an android phone work correctly!

However we would need some customisations; mostly user interface simplifications. Examples, not in any particular order of importance, are:

  1. Not show someone’s total post count - this is to prevent new members being intimidated

  2. Block user editing of his post after a time (currently we set this at 2hrs) - this is to prevent a type of trolling which is not uncommon in this sphere

  3. Classified advert section, with a means of paying for the advert (Paypal), would be nice… I realise this is nontrivial because of the pricing structure config, payment link, etc.

  4. Displaying the year in the post date prominently

  5. Admin ability to go to a user and see who else is active under the same browser installation (basically just cookies). I see Discourse already has this but based on the IP, which these days is not effective (many people are on mobile data, especially those who want to run multiple identities). I did read this thread
    Handling trolls with multiple accounts over VPNs
    and others, so clearly many others have been up this road, and there are no solutions for somebody who is clever with VPNs etc; they tend to eventually reveal themselves via a posting style, or by posting something really nasty which then gets them banned. I would also suggest that detecting the same pwd hash would be an asset because many people use the same pwd for all their characters :wink:

  6. For admins, a simple linear post listing, permitting a very quick review of last x posts on a phone. I imagine this could be done with a bit of code going straight to the database, on a subdomain. Within this listing, having a DELETE and BAN buttons, so someone who posts something nasty (unfortunately not unknown on forums) can be quickly removed.

  7. This may already be in place, from what I can see: admin merging of selected (or all) posts from one thread into another thread, and ending up with the posts in the destination thread being in the correct chronological order. I realise this can break links to posts, unless the link is site-unique (e.g. is the post # in the database, rather than the post # in the thread).

  8. Admin generation of a CSV email list of everyone who has logged in within past 12 or 24 months. We found that mailing older (more stale) people greatly increases the chances of being blacklisted (RBL etc), despite the mailing (mostly about meetups, a few times a year) being done slowly, 1 email per minute only, to minimise the risk (we also blacklist in the mailing all known throwaway addresses e.g. sharklasers.com)

  9. A user setting in a user’s profile to select whether to receive these emails, for GDPR compliance

I have just read the thread here about GDPR. AIUI in the UK a poster has no right to demand deletion of his posts. He can have his login details removed. I wonder if Discourse is in some way additionally vulnerable in this area. On our forum, just about everybody uses a nickname anyway.

  1. Admin ability to read PMs. This is essential because many spammers join up and just PM, not post. We would not find out unless somebody complains, but a lot of new joinups are suspicious (but not clearly so) so we watch them for a bit… For example we have a Country setting in the user profile which has to be specified during the signup, and somebody who sets Germany there but is on a Thai IP is likely dodgy, but it could be a German in Thailand!

  2. A Country setting for the user’s location, enforced in the signup (I realise they can put what they like there)

I realise that if one does mods to the code, applying updates might be difficult or impossible…

Dodgy signups are a real problem. I reckon, currently, 10-20% of signups are dodgy, so if nothing is done, you will get a lot of problems down the road. The usual behaviour is to sign up and wait a week, then hit the forum with spam.

Unfortunately I know nothing about Ruby. I did a tiny bit of PHP. My IT expertise is more general: pop and smtp servers, VMs, VPNs, FTP, SPF, DKIM, router configs. Simple HTML but no CSS… My old IT expertise is embedded systems hardware and software (assembler and C). The guy who wrote the original software offers to help with moving the database over. I have some contacts who can do other bits but no direct Ruby expertise currently… I have a few sites running on a Linode server which has worked very reliably so that would be the #1 choice for hosting.

Thank you in advance for reading this far and for maybe throwing in a few pointers as to how much of this is already there and how much work it would be to do the rest, or something similar :slight_smile:


(Daniel Hollas) #2

Hi Peter!

there are people much more knowledgable than me, but I can try to answer at least some of them. :slight_smile:

  1. This seems like a trivial CSS fix, I am sure someone will help you here.
  2. I believe there is a site setting for this so it should be trivial.
  3. I guess you’ll need a separate post for this with more specific info and examples. You can try to search for plugins here, there are some that might do the job. but hard to say for sure.

Ad 6. Generally, Discourse relies on users flagging nasty post to help with moderation. You can set it up in a way that only one flag from a trusted user will hide the post. For your specific ask you might need a plugin.

Ad 7. This is not possible at this point I believe. Search around on meta, there are discussions about this.
Ad 8. Yep, you can easily export user data and then filter out based on “last seen” column

Ad. 10: Yep, out of the box. Admins can access everything.
Ad. 11: Yep, doable in site customization, the keyword is custom user fields, and you can enforce them at sign up.


(Joshua Rosenfeld) #3

Hey Peter :smiley:.

Already some good answers from Daniel, let me see if I can assist with the rest and/or provide more details.

  1. Definitely trival CSS. Just need to know where you are seeing this number (it may appear in more than one location) and we can help you hide it.
  2. Yep, this is a site setting. post edit time limit. Default is 60 days, 2 hours seems really short - I’d expect it to lead to lots of “oh by the way” or “edit” replies to one’s own post.
  3. Definitely need more details, but this sounds like plugin territory.
  4. You can customize the post timestamp to display year (instead of relative time since post), could also likely add the year separately via a theme-component or plugin.
  5. Check out GitHub - discourse/discourse-fingerprint: A plugin that computes user fingerprints to help administrators combat internet trolls. - not sure the status of the plugin though, @udan11 can likely share more.
  6. You can see all posts sorted by recency via RSS, but there is obviously no delete or suspend buttons there. We’ve found that context is key, and showing posts outside their topic can lead to mistakes. A seemingly innocuous post by itself may in fact be quite bad in context. A seemingly trolling post by itself may be a nice friendly joke in context.
    That said, you can build this via the API if you need to.
  7. You can merge posts from one topic to another, but it does not support reordering the topic - all merged posts are added to the end of the topic. Merging won’t completely break links - they won’t point directly to the post’s new location, but there’s a “x posts moved to …” post added to the topic where the posts were moved from, which can be clicked to jump to the new topic.
  8. Check out Data Explorer Plugin as well.
  9. Users have full control over emails they receive. By default (assuming no modified site settings), they’re emailed when mentioned, PM’d, directly replied to, or quoted. They’re also emailed when someone replies to a topic they started, and one email every 7 days when they haven’t logged into the site, up to a maximum of 52 “weekly digest” emails. Users can modify these preferences at any time, and all emails have an unsubscribe link. If you’re planning to email users from an external tool (say mailgun), you can add a custom user field (checkbox type) which users can use to indicate if they wish to receive emails.
  10. Yep.
  11. Yep.

Talking about dodgy signups - we don’t see too many dodgy signups as being a JavaScript application prevents most old-fashioned scrapers from being able to see the signup fields, let alone verify email.


(Peter) #4

Thank you Daniel.

I have been doing some testing with a sample site (running on a laptop :slight_smile: )

Regarding point 7) I see that post moving is supported but I see the original link does break. So the “share” link is not a unique link to the post. It just takes you into where the post was in the thread before the move.

We had this issue on the existing forum too (where I do a lot of thread merging, to keep the site informative). It was initially addressed by entirely removing the link to the post after the move… This proved to be a hassle in the long run; the only way you could get a link to such a post was by doing a search for some fairly unique string within it and then you could extract a link to it from the search results. Eventually it was solved using the cunning method of using the database post ID (a large number on a forum with 200k posts) as the link, and that works great while looking slightly odd. However if a forum used the database ID # from the start, it would work great.

Many thanks too Joshua. A real pity about the merging issue; that is a big thing on the original site.

Re point 6) I currently see the Section / Thread Name / post text, so the whole context is there. I know what you mean; you can’t tell what the post is a reply to because that post could be 50 posts down. But usually an offensive post is obviously offensive in a standalone manner. Especially if you see the poster’s name… I find that within the past 30 days about 200 people have posted and the rude ones run around the 2% mark. It is a bizzare observation that you could discharge the mod job by marking the other 98% invisible and just getting an RSS feed with the 2% :slight_smile: :slight_smile:

BTW I find that all the dodgy signups are clearly humans. They even fill in their profile intelligently in some cases, then come back a week later and drop the spam in :slight_smile: There is an army of them in India, Africa and similar places and they know how to do it. The majority are selling fake passports but we had one recently who was much more clever. He took a post from earlier in the thread and pasted it in (so producing a sensible looking post, which was actually a question). He then changed the question mark into a live link, which most people would not spot. But Chrome will prefetch all the links on a page… a nice attack vector! At that point we changed it so every signup is manually approved. Not a major workload on a forum of this size.


(Joshua Rosenfeld) #5

Discourse post links use the following form by default:

{scheme}://{hostname}/t/{topic-slug}/{topic-id}/{post-number-within-topic}

The topic-id is the most important, using an invalid topic-slug, or even skipping it will still work.

For example, for your post above, any of these would work:

https://meta.discourse.org/t/questions-about-moving-an-existing-forum-to-discourse/104948/4
https://meta.discourse.org/t/fake-slug-here/104948/4
https://meta.discourse.org/t/104948/4

You can link directly to a post, by using the following format (you will need to manually create such links, or use a plugin to help create them for you in the Share UI):

{scheme}://{hostname}/p/{post-id}

Again, for your post above:

https://meta.discourse.org/p/514248

You can obtain the post-id by looking at the json data for a given post: https://meta.discourse.org/t/questions-about-moving-an-existing-forum-to-discourse/104948/4.json


I disagree with you that the category, topic title, and post text are enough context in all cases. Some examples:

  • Topic started talking about “Favorite Pizza toppings”. Over time, the discussion has shifted to favorite restaurants somehow. If solely considering category, title, and post, a reply about a hamburger joint would seem spammy, or at least off topic. But by reviewing a few preceding replies you can see that the topic has simply digressed, not a specific user.
  • Topic started talking about “how to fix a flat tire”. Two users are going back and forth discussing how to do so. User B replies with the solution. User A realized he missed something obvious, and makes a self-deprecating remark. Without seeing the preceding replies, one may be quick to delete the post as inappropriate, even when it would be fine (and possibly even humorous if done nicely) within the topic.

Interesting to hear about the human spammers. Good news in the specific example you shared about profiles: we compile a list of all user who sign up, modify their profile, and don’t post. You can view the list of “suspect users” from your admin dashboard - and quickly delete them, optionally blocking the email and IP from further sign ups if you want.

Saw your edit: manual approval of new accounts is a simple setting change.


(Peter) #6

Joshua - indeed, I have been testing the post links. Only the x/y number is required. It is the same on ours. The issue is that moving the post to a different thread breaks that link.

The drawback with blocking people who create a profile but never post is that lots of genuine people do that (on our forum at least) because having a login gives you various privileges e.g. seeing new posts. I am aware one can achieve that with just cookies but I am told that presenting user-specific context without a login is regarded as bad practice these days (well, Amazon does it, to a certain level, so it must be good). We have ~3.5k signed up of which 1.5k have posted.

That fingerprint feature would be hugely controversial if it was discovered, which it will be very quickly if implemented with client-side keystroke timing i.e. javascript. And if you do the timing server-side (I apologise for lack of clarity / wrong terminology) then you break various browser features like spell checking, because each keystroke goes straight to the server separately.


(Daniel Hollas) #7

Regarding the spam, you might find some interesting ideas in a relatively recent discussion here:


(Peter) #8

Yes; that tactic works because most forums don’t check posts except when originally posted. Edits are not checked :slight_smile:

Another tactic is to put something in your profile or your avatar. Those don’t get checked either, but they get picked up by google.

It’s all about getting SEO.


(Jay Pfaffman) #9

Lots of answers to your questions here. I think that the human spam is also mitigated by Akismet.

I have written several custom importers. You can see my notes about them here. It’s how I make my living, so it is largely about paying me to do the job, but also gives you some idea of what the issues are should you write the importer yourself.


(Peter) #10

We have decided to leave the migration for the time being. The requirement for post moving is quite important.

If this feature is sorted out one day, we would be happy to re-visit the project.

So I thank you all for your answers :slight_smile:


(Jeff Atwood) #11

You definitely want to run the Akismet plugin, however, as there are a large number of 100% human spammers running around out there today. Big increase in human spam numbers over the last 10 years.


#12

Slightly off topic; should Discourse admins have access to member PMs (P emphasized for obvious reasons)?


(Mittineague) #13

The answer to whether or not Admins should have access to Personal Messages was answered in the OP (# 10) - spammers


(Peter) #14

Admins on every forum need full access, for many reasons. Legal (e.g. member harassment by another member), spam management (e.g. many spammers join up and just send out lots of PMs without ever posting), subversion (disgruntled posters sometimes embark on a background mailing campaign to trash the site, spread allegations about the admins, etc), covert advertising (a real person joins up and sends out loads of PMs to promote his forum related business)… Any forum gets some mixture of this stuff… unfortunately, in addition to spammers, there are several % of people who cause trouble. In reality I am sure most forum admins never look at this stuff routinely (I certainly don’t) because they have better things to do, but you want there to be triggers e.g. more than 10 PMs sent within a day, within an hour, whatever.

Ultimately absolutely everything you do on some website is visible to whoever has admin access to the server.

The only Q is what access moderators have, and on most small sites they are the same person(s). This then leads to the topic of renegade mods (of which I have seen many examples, having been on forums since the internet got going, Compu$erve onwards :slight_smile: ) and this is a real problem. If you have a large site and have to appoint a load of mods, this policy needs to be done carefully because a renegade mod can do tremendous damage.

I have another Q on Discourse: is there a feature or a plug-in which can implement a question/answer session at signup time? For example if running a space flight related forum, you may want to put in some multiple choice question about the order of the planets’ distances from the sun, to keep the less intelligent spammers from signing up.


(Dan Ungureanu) #15

This plugin is ready for production and it did in fact run on a well-known Discourse for some time, but it was not a “toxic” community that would return lots of results. From what I can remember, there was a problem with Apple devices, as there is not much diversity when it comes to those and Safari does not leak very much info either. So, please take the results with a grain of salt.

If you decide to use it, please let me know. I would be very interested in seeing how it works in a real-world situation.

That is something I definitely do not recommend. It would decrease the overall security strength of the authentication system.


(Peter) #16

Presumably because you would need to have an indexed database of the hashes, which is yet another thing that can be hacked?

How come Safari doesn’t leak enough info? I know nothing about this topic but AIUI the only way to do keyboard fingerprinting is to time the keystrokes somehow, with millisecond resolution. But didn’t browsers do something very recently on the timing front, to block the Kaiser / Meltdown exploit which of necessity relies on accurate timing?

As regards other means of user fingerprinting, there is a ton of methods. There was one website (which now escapes me) which you went to and it produced a breakdown of all it can see about you, e.g. browser type, screen pixel size, java version, about 20 other things. It then calculated how unique the ID is (based on e.g. how many Chrome v41.5.6 users were running a specifies combination of plugins etc etc). And it very quickly got to c. 99.99%. So even if someone clears their cookies on every visit, they are still about 99.99% identifiable… well for a while until their browser gets an update etc. But the server then has to keep all that stuff in the logfiles and index it all up; I am sure most forums don’t bother.

And all someone needs to do to defeat all that is to use a different client device on a mobile IP. I have just had someone create their 4th character this way (he didn’t last long because he started posting his usual trolls). Or if they want to do it all from their home PC, they just need to run a throwaway browser instance in a VM and going out via a VPN terminating in the Peoples’ Republic of Cameroon (yes this is a real example too :slight_smile: ). I’ve seen one chap (who created about 10 identities) use the TOR browser, but his alter egos were a dead giveaway because who would be browsing a special interest (technology related) using such a heavy duty method intended for illegal activities, and whose IP really does map to various African countries?

We had one guy who ran two characters, one polite and one who posted rude stuff, including one post which IMHO would have resulted in a police visit (to us), but in hindsight he would have been detectable simply on cookies. I think cookies are a powerful enough method, and throw in the IP for good measure.

Regarding the user’s post count, it was something I recall seeing when testing the sample installation. If it is not shown, I apologise!

Would a CSS change really suppress it? I ask that because I recall one forum I used to visit years ago (another technology one) which had a “print thread” feature (actually printing threads is where most forums, along with most other websites, fail miserably, but I suppose not many people print nowadays… although one may want to print to a PDF) and when you used that feature, every user’s email address would appear for about 100ms :slight_smile: Someone malicious could have written a spider which grabbed the stuff, for whatever dodgy purpose.

Had Discourse had proper functionality for moving posts from one thread to another, with links to posts retained (which AFAICS requires the link to be the unique post ID # from the database, or some long hash of something) we would have probably bitten the bullet and gone ahead with the move.


(Michael Howell) #17

There are only about ten kinds of iPhone, and they are all identical. Thus, no useful device fingerprinting.

As for timing, the browsers clamp you to about 2ms. That’s still plenty of accuracy for user behavior fingerprinting; you need microsecond-accurate timing to do Spectre.

Let’s not be fallacious here. There are two types of sockpuppets you know about; the ones that do the tech solid, but flub the character, and the ones who do the character solid, but flub the tech. You don’t know about the ones that do both correctly. They’re not “trolls”, per se, since the whole point of trolling is to post flame bait, so you will eventually identify the tree by its fruit. But astroturfing, things like fake product reviews and subtler SEO spam, those are the worse part.

No, obviously CSS won’t prevent the post count from showing up in the API and the DOM. But there’s really no point in trying to hide the post count; unlike the email address, which you actually might have a prayer of keeping secret, the post count can by definition be mined by Mallory just scraping your entire forum and counting the posts herself.


(Jeff Atwood) #18

Reminder that this is not possible on Discourse, as new users cannot PM until they have reached trust level 1.

We have global rate limits on topic creation and PMs, there is also a limit on how long PMs can get. But you are right, there should be good visibility into anomalous PM patterns by TL1 users.


(Peter) #19

You don’t know about the ones that do both correctly.

That’s true, but do you care? Anyone who can pull off both is quite clever and by definition making a good contribution to the forum :slight_smile:

Most forums would be happy to have Vlad the Impaler posting, provided he was polite and on-topic, etc :slight_smile:


(Sam Saffron) #20

Side note, highlight text, click quote.