eigenmagic / fediblockhole

A tool for automatically syncing Mastodon admin domain blocks.
GNU Affero General Public License v3.0
67 stars 7 forks source link

Bug? #25

Closed oculos closed 1 year ago

oculos commented 1 year ago

Hi,

After I migrated a list of domains to be blocked from mastodon.social, I got this error when using tootctl domains crawl:

bin/tootctl domains crawl
/home/mastodon/live/lib/mastodon/domains_cli.rb:147:in `ensure in crawl': undefined method `finish' for nil:NilClass (NoMethodError)
    from /home/mastodon/live/lib/mastodon/domains_cli.rb:156:in `crawl'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:116:in `invoke'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor.rb:243:in `block in subcommand'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
    from bin/tootctl:8:in `<main>'
/home/mastodon/live/lib/mastodon/domains_cli.rb:100:in `initialize': target of repeat operator is not specified: /\\.?beefyboys.win|chudbuds.lol|xn--xn6r8h-xg0c.tk|girlcock.club|lets.saynoto.lgbt|pedo.school|misskey-forkbomb.cf|repl.co|*activitypub-troll.cf|activitypub-proxy.cf|10minutepleroma.com|a.sc|beta.birdsite.live|beta.mstdn.cf|birb.elfenban.de|birdbots.leptonics.com|birdbridge.autonomy.earth|bird.evilcyberhacker.net|bird.froth.zone|bird.istheguy.com|bird.makeup|bird.r669.live|birdsite.b93.dece.space|birdsite.cloutier.co|birdsite.darkesttimeline.social|birdsite.frog.fashion|birdsite.gabeappleton.me|birdsite.gred.al|birdsite.james.moody.name|birdsite.jemverse.xyz|birdsite.link|birdsitelive.bubbletea.dev|birdsitelive.loca.lt|birdsitelive.moistgarbage.info|birdsitelive.treffler.cloud|birdsite.mastodon.me.uk|birdsite.monster|birdsite.nytpu.com|birdsite.oliviaappleton.com|birdsite.skye.cx|birdsite.slashdev.space|birdsite.spectreos.de|birdsite.tcjc.uk|birdsite.thorlaksson.com|birdsite.toot.si|birdsite.vrparty.social|birdsite.wilde.cloud|brands.town|bridge.birb.space|catgirl.life|cawfee.club|cnet.site|coom.club|cum.desupost.soy|cum.salon|cyberstorm.one|daffodil-11.org|detroitriotcity.com|dlf.social|eientei.org|eveningzoo.club|fedi.app|feminism.lgbt|firebird.mullet.social|freecumextremist.com|freespeechextremist.com|frennet.xyz|gab.ai|gab.com|gameliberty.club|genderheretics.xyz|getgle.org|gitmo.life|gleasonator.com|glindr.org|honkwerx.tech|kiwifarms.net|kurosawa.moe|mastinator.com|mastodonhub.com|ns.auction|paypig.org|pisskey.io|glowers.club|iddqd.social|intkos.link|jaeger.website|kiwifarms.cc|kiwifarms.is|mugicha.club|rakket.app|raplst.town|hunk.city|leafposter.club|monstergirl.space|mouse.services|nicecrew.digital|outpoa.st|pieville.net|pleroma.fun|pleroma.kitsunemimi.club|poa.st|pooper.social|rdrama.cc|refusal.biz|ryona.agency|schwartzwelt.xyz|seal.cafe|shitpisscum.mooo.com|shitposting.army|shortstackran.ch|sleepy.cafe|sneed.social|social.projectsegfau.lt|solagg.com|spinster.xyz|switter.at|tastingtraffic.net|twitiverse.com|twitter.1d4.us|twitter.activitypub.actor|twitter.grants.cafe|twtr.carnivore.social|twtr.vrij.social|twtr.wappie.land|urchan.org|wagesofsinisdeath.com|waifuappreciation.club|waifu.social|weedis.life|workers.dev|yggdrasil.social|zztails.gay$/ (RegexpError)
    from /home/mastodon/live/lib/mastodon/domains_cli.rb:100:in `new'
    from /home/mastodon/live/lib/mastodon/domains_cli.rb:100:in `crawl'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:116:in `invoke'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor.rb:243:in `block in subcommand'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
    from /home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
    from bin/tootctl:8:in `<main>'

Could it be related? I see that it fails displaying all the banned domains.

Best, Francis

jpwarren commented 1 year ago

Partway through the regexp string I see misskey-forkbomb.cf|repl.co|*activitypub-troll.cf|activitypub-proxy.cf

It looks like you've added a block in your instance for a wildcard: *activitypub-troll.cf and that's breaking the regex because * in regex means zero-or-more of the character that came before it. But there isn't anything before it here, because the delimeter | is used to separate sub-matches in the group, so that's why you're getting the target of repeat operator is not specified error.

Probably not a bug in FediBlockHole since the tool filters out wildcard domains, and mastodon.social doesn't have any wildcards in its public blocklist that I can see.

Mastodon automatically blocks subdomains, so you don't need the *activitypub-troll.cf entry. Try going into your instance and removing that block and then rerunning tootctl domains crawl?

sgrigson commented 1 year ago

@jpwarren It does have some wildcards. Not that this is at issue here, but worth mentioning.

https://github.com/sgrigson/oliphant/blob/main/blocklists/mastodon.social.csv

jpwarren commented 1 year ago

You are correct! I am a dumbass, because I looked at the merged export from FediBlockHole (after it stripped them out) and not the separate pre-merged list for mastodon.social that FediBlockHole saves out.

You can write the tool and still fail to use it correctly.

Computers are terrible and we should throw them all into the sea.

oculos commented 1 year ago

My bad - it was the * that was the culprit.