Software / code / prosody-modules
Comparison
mod_firewall/README.markdown @ 4126:68ceb7e0cfe6
mod_firewall: Add docs for list types and parameters
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 15 Sep 2020 11:45:09 +0100 |
| parent | 4072:2dcbc01c9931 |
| child | 4127:e9e10ec1b91c |
comparison
equal
deleted
inserted
replaced
| 4125:24404c289014 | 4126:68ceb7e0cfe6 |
|---|---|
| 118 List type Example | 118 List type Example |
| 119 ----------- ----------------------- | 119 ----------- ----------------------- |
| 120 memory %LIST spammers: memory | 120 memory %LIST spammers: memory |
| 121 file %LIST spammers: file:/etc/spammers.txt | 121 file %LIST spammers: file:/etc/spammers.txt |
| 122 http %LIST spammers: http://example.com/spammers.txt | 122 http %LIST spammers: http://example.com/spammers.txt |
| 123 | |
| 124 #### List types | |
| 125 ##### memory | |
| 126 | |
| 127 ``` | |
| 128 %LIST name: memory (limit: number) | |
| 129 ``` | |
| 130 | |
| 131 A memory-only list, with an optional limit. Supports addition and removal of items by scripts. | |
| 132 | |
| 133 If a limit is provided, the oldest item will be discarded to make room for a new item if the | |
| 134 list is full. The limit is useful to prevent infinite memory growth on busy servers. | |
| 135 | |
| 136 ##### file | |
| 137 | |
| 138 ``` | |
| 139 %LIST name: file:/path/to/file (missing: string) | |
| 140 ``` | |
| 141 | |
| 142 Reads a list from a file. The list can be added to and removed from by scripts, but | |
| 143 these changes do not persist between restarts. | |
| 144 | |
| 145 If the file is missing, an error will be raised. The optional 'missing' parameter can be set | |
| 146 to 'ignore' (e.g. `(missing: ignore)`) to ignore a missing file. | |
| 147 | |
| 148 ##### http | |
| 149 | |
| 150 ``` | |
| 151 %LIST name: http://example.com/ (ttl: number, pattern: pat, hash: sha1, checkcerts: when-sni) | |
| 152 ``` | |
| 153 | |
| 154 Fetches a list from a HTTP or HTTPS URL. The following options are accepted: | |
| 155 | |
| 156 Option Description | |
| 157 ------- ----------- | |
| 158 ttl Seconds to cache the list for. After expiry, it will be refetched. Default 3600 (1 hour). | |
| 159 pattern Optional pattern used to extract list entries from the response. Default is to treat each line as a single item. | |
| 160 hash Optional hash to be applied to items before looking them up in the list, e.g. sha1 or sha256. | |
| 123 | 161 |
| 124 #### CHECK LIST | 162 #### CHECK LIST |
| 125 | 163 |
| 126 Checks whether a simple expression is found in a given list. | 164 Checks whether a simple expression is found in a given list. |
| 127 | 165 |