Trigger before Download¶
- if user requests "download-url" directly, the request is denied and he is redirected to "deny-url"
- if user visits "trigger-url" before requesting "download-url", access is granted
- if user visits "download-url" again after "trigger-timeout" has elapsed, the request is denied and he is redirected to "deny-url"
The trigger information is either stored locally in a gdbm file or remotely in memcached.
- libgdbm or libmemcached
trigger-before-download.gdbm-filename = "/home/weigon/testbase/trigger.db" trigger-before-download.memcache-hosts = ( "127.0.0.1:11211" ) trigger-before-download.trigger-url = "^/trigger/" trigger-before-download.download-url = "^/download/" trigger-before-download.deny-url = "http://192.168.1.5:1025/index.html" trigger-before-download.trigger-timeout = 10
trigger-before-download.memcache-hosts is set gdbm will take precedence.
memcached should be started with the option -M as we don't want to remove entry if the memory is full.
Updated by gstrauss about 3 years ago · 12 revisions