Software /
code /
prosody-modules
Diff
mod_firewall/definitions.lib.lua @ 2898:9fd61234b6f0
mod_firewall/definitions: Comments on LIST backends
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 06 Mar 2018 18:24:34 +0100 |
parent | 2859:22e11645a895 |
child | 3240:c30f2cfe9f15 |
line wrap: on
line diff
--- a/mod_firewall/definitions.lib.lua Fri Feb 23 20:53:28 2018 +0200 +++ b/mod_firewall/definitions.lib.lua Tue Mar 06 18:24:34 2018 +0100 @@ -62,6 +62,7 @@ end local list_backends = { + -- %LIST name: memory (limit: number) memory = { init = function (self, type, opts) if opts.limit then @@ -88,6 +89,8 @@ return self.items[item] == true; end; }; + + -- %LIST name: http://example.com/ (ttl: number, pattern: pat, hash: sha1) http = { init = function (self, url, opts) local poll_interval = assert(tonumber(opts.ttl or "3600"), "invalid ttl for <"..url.."> (expected number of seconds)"); @@ -140,6 +143,8 @@ return self.items and self.items[item] == true; end; }; + + -- %LIST: file:/path/to/file file = { init = function (self, file_spec, opts) local filename = file_spec:gsub("^file:", "");