Any volunteer to port this great module to Drupal 7? I would be happy to contribute testing and an updated README.txt file.

Comments

cestmoi’s picture

i hope to see D7 too.
thanks

mgifford’s picture

Definitely interested.

millerl’s picture

I'd love to see this for Drupal 7 as well, the CAPTCHA module isn't working as well as I'd hoped.

mainpc’s picture

Interested.

mgifford’s picture

Issue tags: +D7 porting

Anyone can download the repository http://drupal.org/node/18951/git-instructions

Run it through http://drupal.org/project/coder

and create a patch. No need to wait for the maintainer to get this moving.

basicmagic.net’s picture

subscribe

epoitras’s picture

I have started working on this today. Hopefully I won't run into too many problems.

epoitras’s picture

StatusFileSize
new34.37 KB

Here's what I was able to get so far (with the help of Coder). This is NOT a working version for Drupal 7. It still needs some work (mainly converting database queries from D6 to D7). Sadly Coder doesn't seem to be able to catch any of those. Help would be appreciated.

deekayen’s picture

Status: Active » Needs work

Maybe I'm missing something, but the patch isn't applying...

deekayen-macbook:troll davidnorman$ git checkout master
Already on 'master'
deekayen-macbook:troll davidnorman$ git apply ~/tmp/drupal7Attempt.patch.txt
/Users/davidnorman/tmp/drupal7Attempt.patch.txt:167: trailing whitespace.
  $result = $query->execute(); 
/Users/davidnorman/tmp/drupal7Attempt.patch.txt:234: trailing whitespace.
  //while ($user = $result->fetchAssoc()) { 
error: patch failed: troll.admin.inc:40
error: troll.admin.inc: patch does not apply
error: patch failed: troll.info:1
error: troll.info: patch does not apply
error: patch failed: troll.module:12
error: troll.module: patch does not apply
epoitras’s picture

StatusFileSize
new22.14 KB

Sorry about that, this one should work. Remember, it's not even close to ready.

mgifford’s picture

My site's getting pummelled at the moment by comment spam. Mollom isn't cutting it.

Is this module abandoned? Do we need to reach out to get another maintainer to step up & maintain a D6 & D7 version of the code?

How are we going to ensure that this is stainable and that the person maintaining this critical module is able to make it the priority that it needs to be?

deekayen’s picture

I can't take credit for having done the D6 upgrade, though I did do a bunch of followup to it.

The D7 work started a long time ago in 2009. Anyone care to examine to see what will be lost if I have to overwrite it with the patch against 6.x-1.x in #10?

SamRose’s picture

Does anyone know anything about http://drupal.org/project/spambot ? Maybe it's better to just merge Troll into spambot if they are interested? I realize Troll has more to it than just IP blocking. This is just brainstorming aloud. I was considering contributing an extension to Troll that would check against stopforumspam API for D7 troll until I found http://drupal.org/project/spambot

kihap’s picture

Any updates or progress on the port of Troll to D7? It's really needed. Thanks!

andypost’s picture

Core 8 now have a Ban module #1161486: Move IP blocking into its own module which could be extender with ip-address ranges - is there any takers?

federiko_’s picture

I tried some other modules but I didn't find something like Troll... It would be very nice to have a Drupal 7 version...

deekayen’s picture

Much to my surprise, nobody has claimed this module for their own yet, so I'll re-adopt it. To start, I just un-supported the 5 and 6 versions on purpose. Scream all you want or whatever, but the simple fact is that they're not supported by anyone, including me. See also https://deekayen.net/i-unmaintained-my-drupal-5-modules-purpose.

I'll give 7.x-1.x re-birth, but with a smaller set of features. I'm thinking as a start, for 7.x-1.x, just support dnsbl lists, in particular spamcop and spamhaus. By implementing a hook_menu_alter(), a feature which was not available in the original Drupal 5 design, I think we can get a version that can utilize the existing permission set for posting comments outright on a pass, posting with moderation on fail, or even doing moderation by default and dump failures to nowhere.

I really have no vision for what 7.x-2.x would have, nor do I have much motivation beyond my own selfish needs to block spam on https://normanlayout.info.

In the meantime, in a deliberate effort to not over-commit myself, I should finish up my fork of Commerce BitPay before doing Troll 7. I could possibly be persuaded to change my priorities with some "Troll funding" at https://www.gittip.com/deekayen/.

halftone’s picture

Just a suggestion: turn Troll into a minimal hard-blocking-before-bootstrap module.

I'm using it in D6 for pretty much that, using the Phpids module patch at https://drupal.org/node/1394122#comment-6395006. This writes a hard IP block into the Troll DB if Phpids score is above a set level. I use 3, and have never seen a false positive. Since I made the patch I have about 13,000 IP's banned this way and it is finally slowing Phpids attacks. They peaked at 30-50 day for over a year, now 5 max.

I am also using Spambot module with its API connection to www.stopcommentspam.com, and the Captcha module, and absolutely nothing gets through except 2-5 account creation requests each day that turn up in the approval queue. If the usernames and email addresses look characteristically spammy I do nothing, just leave them blocked.

I was plagued with code injection attempts, spammer signups and comment spam attempts before doing this, 100 or so an hour 24/7. I could not cope with the exploding logs and endless admin. Now I just glance at the day's watchdog log to make sure all is still OK.

At present various modules are implementing their own soft or hard banning by various routes. Yes, the banning module ought to be in core with an API, but meanwhile Troll works. I am unlikely to move to D7 for a while because of the radical changes in image handling which still seem to have no viable upgrade path.

What I want to do when I have the time, is to get Troll to sync its DB with my other sites, or beyond that, a wider community, so as soon as an IP is banned at one, it is pre-emptively banned at all. I haven't even looked into how this might be possible yet (RSS I guess) and I am a beginner at coding, but the answer to the botnet is the botnet, in my view.

I'd also like to patch Captcha to write Troll IP bans where repeated account creation attempts occur.

None of which helps much with getting Troll to D7, but maybe suggests a few ideas.

francewhoa’s picture

deekayen, that's good news for 7.x-1.x re-birth :) We will be happy to contribute testing and documentation.

ctmattice1’s picture

StatusFileSize
new24.49 KB

@deekayen: I downloaded the 7.x master and spent some time working on it by manually applying the patch in #10. I've gone through and got the menu and a few more functions working but there is still alot to go, I don't know how to make tests so someone else will have to do that. I am willing to work on this but did not use git to download troll so I've attached a zip file of the modified module instead for the time being.

edit: Crap, the zipfile has the old install file, the old install function is wrong.

/**
 * Implementation of hook_install().
 */
function troll_install() {
  drupal_install_schema('troll');

  // Whitelist 127.0.0.1.
  db_query("INSERT INTO {troll_whitelist} (net, bcast) VALUES (2130706433, 2130706433)");
}

It should be:

/**
 * Implementation of hook_install().
 */
function troll_install() {
  // Whitelist 127.0.0.1.
  db_query("INSERT INTO {troll_whitelist} (net, bcast) VALUES (2130706433, 2130706433)");
}

Sorry about that.

deekayen’s picture

Is attaching a zip file your way of asking for git access?

ctmattice1’s picture

No,

but I have interest in the module as I used it in 5.x and to some degree in 6.x, I have no problem pulling from git in the future and making patches if that is what you would prefer. My purpose for suppling a zip file was to give a partial working copy of troll for 7.x, it still has a long ways to go.

ctmattice1’s picture

Issue summary: View changes
StatusFileSize
new74.81 KB
mgifford’s picture

I applied against
git clone --branch 6.x-1.x http://git.drupal.org/project/troll.git

and it broke. Did you build the diff off the last release?

ctmattice1’s picture

Built it from HEAD

mgifford’s picture

Ok, that works then. Some whitespace errors and complaints about a new blank line at EOF, but it applies nicely.

I've got to fix my local version so don't have a convenient testing environment. Also not easy to test against http://simplytest.me/project/troll

But looks like we're closer!

mgifford’s picture

Status: Needs work » Needs review
StatusFileSize
new83.65 KB

I made some other tweaks after testing out the last patch. Just resolving errors that popped up.

mgifford’s picture

I've pushed that code to a D7 branch - https://drupal.org/node/18951/git-instructions/master

So it can be tested now here:
http://simplytest.me/project/troll

mgifford’s picture

Status: Needs review » Closed (fixed)
francewhoa’s picture

Thanks mgifford :)