More Languages to the F-Droid Planet?

You may know about Planet F-Droid, a feed aggregator that aims to collect the blogs of many free Android projects in one place. Currently all of the registered blogs are written in English (as is this post, so if you know someone who might be concerned by the matter below and is not able to understand English, please feel free to translate for them).

Recently someone suggested that we should maybe create additional feeds for blogs in other languages. I’m not sure if there is interest in having support for more languages, so that’s why I want to ask you.

If you feel that Planet F-Droid should offer additional feeds for non-English blogs, please vote by thumbs up/down in the planets repository.

Happy Hacking!

WordPress Anti Spam Measures using Fail2ban

I recently got really excited when I noticed, that the number of page views on my blog suddenly sky-rocketed from around 70 to over 300! What brought me back down to earth was the fact, that I also received around 120 spam comments on that single day. Luckily all of those were reliably caught by Antispam Bee.

Sudden peaks in page view and spam comment statistics.

Still, it would be nice to have accurate statistics about page views and those stupid spam requests distort the number of views. Also I’d like to fight spam with tooth and nail, so simply filtering out the comments is not enough for me.

That’s why I did some research and found out about the plugin WP Fail2Ban Redux, which allows logging of spammed comments for integration with the famous fail2ban tool. The plugin does not come with a settings page, so any settings and options have to be defined in the wp-config.php. In my case it was sufficient to just add the following setting:

/path/to/wordpress/wp-config.php

define('ANTISPAM_BEE_LOG_FILE', '/var/log/spam.log');

Now, whenever Antispam Bee classifies a comment as spam, the IP of the author is logged in the given log file.

Now all I need it to configure fail2ban to read host names from that file and to swing that ban hammer!

/etc/fail2ban/filter.d/antispambee.conf

[INCLUDES]
# Read common prefixes. If any customizations available -- read them from
# common.local
before = common.conf

[Definition]
_daemon = wp
failregex = ^%(__prefix_line)s comment for post.* from host= marked as spam$
/etc/fail2ban/jail.local 

[antispambee]
enabled = true
filter = antispambee
logpath = /var/log/spam.log
bantime = 21600
maxretry = 1
port = http,https

Now whenever a spammer leaves a “comment” on my blog, its IP is written in the spam.log file where it is picked up by fail2ban, which results in a 6 hour ban for that IP.

Those sweet, sweet bans 🙂

Update:

Yaaaay!

Setting up a Planet

Planets are a thing of the 90s, but still they are quite cool as they can bring a community closer together by helping users to exchange ideas. I hope this will also work out for the F-Droid community 🙂

For that reason I proposed to set up a planet for F-Droid / FOSS Android development in the F-Droid forum. After explaining my idea, Hans suggested that I should give it a try and go serverless by basing the setup on GitLab Pages.

Up to that point I didn’t even know, that GitLab Pages was a thing, as I only ever came in touch with Github Pages (shame on me). However, setting everything up was pretty straight forward and I’m quite happy with the outcome.

I chose the planet software Venus for the job, as it was one of the only search results I found while researching the topic. It was also the one used by some planets I already personally followed. Venus is a python program, which fetches the list of registered blogs and creates a directory with static HTML/CSS files which contain all the blog posts. That HTML can then be deployed somewhere (in our case GitLab Pages).

I configured GitLab CI to run Venus every 30 minutes. I might increase the interval at some point, as 30 minutes might be overkill.

Screenshot of the Planet F-Droid website
Screenshot Planet F-Droid

Design-wise I tried to mimic the style of the F-Droid website as close as possible, but I’m not a web designer and haven’t got in touch with HTML + CSS so far, so there are still a lot of things that can be improved. However, it was a lot of fun to experiment and do trial and error to come up with the current design. If you want to jump in and help me with the CSS/HTML, feel free to contact me!

The only thing missing now are blogs! If you run a cool FOSS, Android development related project and/or blog about your adventures in the FOSS world, please apply to be included 🙂

For now the planet can be found here, but I hope that it can at some point migrate to a F-Droid subdomain.