Availability
Available as of blojsom 2.25.
Description
The IP address moderation plugin checks the IP address for incoming comments or trackbacks against a user-defined whitelist and/or blacklist.
The IP address of the incoming request if first checked against the IP whitelist. If the IP address is in the IP whitelist, the request is processed further. If the IP address of the incoming request is on the IP blacklist, the comment or trackback can be moderated or delete automatically.
There is also an administration plugin available so that you can edit the whitelist and blacklist settings from the web administration console.
Installation and Setup
In your global /WEB-INF/plugin.properties file, add the following line:
ip-moderation=org.blojsom.plugin.moderation.IPAddressModerationPlugin
ip-moderation-admin=org.blojsom.plugin.moderation.admin.IPAddressModerationAdminPlugin
In your individual blog.properties file, there are a number of properties that control how this plugin operates.
| Property |
Description |
Default value |
| delete-ipspam |
Determines if the comment or trackback should be deleted automatically if it contains a blacklisted IP address. |
false |
For example:
delete-ipspam=true
The plugin's default IP whitelist file is called ip-whitelist.properties and the plugin looks for this file in the individual /WEB-INF/(blog-id)/ directory. The plugin's default IP blacklist file is called ip-blacklist.properties and the plugin looks for this file in the individual /WEB-INF/(blog-id)/ directory.
If you would like to change the name of the IP whitelist or blacklist file used, you can set this as an initialization parameter using the property ip-whitelist or ip-blacklist in /WEB-INF/web.xml. For example:
<init-param>
<param-name>ip-whitelist</param-name>
<param-value>ip-whitelist.properties</param-value>
</init-param>
<init-param>
<param-name>ip-blacklist</param-name>
<param-value>ip-blacklist.properties</param-value>
</init-param>
Usage
Each line in either the IP whitelist or blacklist file may be either a full IP address or a regular expression. For example, the following, if in the IP blacklist:
127.0.0.1
99.99.99.99
would ban the IP addresses, 127.0.0.1 and 99.99.99.99 from leaving a response on your blog. However, the following, if in the IP blacklist:
127.*
99.*
would ban the entire spectrum of IP addresses starting with 127 and 99 from leaving a response on your blog.