Mercurial > prosody-modules
comparison mod_firewall/README.markdown @ 5704:ad5c77793750
mod_firewall: Add FROM COUNTRY condition based on GeoIP DB
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 12 Nov 2023 16:37:47 +0100 |
parents | 0ac4545cb4f9 |
children | 1ae8f7b3787a |
comparison
equal
deleted
inserted
replaced
5703:0ac4545cb4f9 | 5704:ad5c77793750 |
---|---|
299 **Note:** Some chains execute before Prosody has performed any | 299 **Note:** Some chains execute before Prosody has performed any |
300 normalisation or validity checks on the to/from JIDs on an incoming | 300 normalisation or validity checks on the to/from JIDs on an incoming |
301 stanza. It is not advisable to perform access control or similar rules | 301 stanza. It is not advisable to perform access control or similar rules |
302 on JIDs in these chains (see the [chain documentation](#chains) for more info). | 302 on JIDs in these chains (see the [chain documentation](#chains) for more info). |
303 | 303 |
304 #### GeoIP matching | |
305 | |
306 Condition Matches | |
307 ---------------- -------------------------------------------------------------- | |
308 `FROM COUNTRY` Two or three letter country code looked up in GeoIP database | |
309 | |
310 This condition uses a GeoIP database to look up the origin country of | |
311 the IP attached to the current session. | |
312 | |
313 For example: | |
314 | |
315 # 3 letter country code | |
316 FROM COUNTRY: SWE | |
317 | |
318 # or 2 letter | |
319 FROM COUNTRY: SE | |
320 | |
321 # Explicit | |
322 FROM COUNTRY: code=SE | |
323 FROM COUNTRY: code3=SWE | |
324 | |
325 **Note:** This requires that the `lua-geoip` and `geoip-database` | |
326 packages are installed (on Debian, package names may differ on other | |
327 operating systems). | |
328 | |
304 #### INSPECT | 329 #### INSPECT |
305 | 330 |
306 INSPECT takes a 'path' through the stanza to get a string (an attribute | 331 INSPECT takes a 'path' through the stanza to get a string (an attribute |
307 value or text content). An example is the best way to explain. Let's | 332 value or text content). An example is the best way to explain. Let's |
308 check that a user is not trying to register an account with the username | 333 check that a user is not trying to register an account with the username |