[leafnode-list] config option: script file
clemens fischer
ino-news at spotteswoode.dnsalias.org
Sun Feb 8 16:23:30 CET 2009
Hi,
since leafnode(8) is growing scripting support in addition to
fetchnews(8), I think it might be justified to have a configuration
option defining the location of the script file. Anytime in the near
future people will face the same problem as I do: I have a working lua
script for spam filtering and archiving in fetchnews(8), and now I need
to experiment with and test another one for the per-group authorization
feature. I would like to continue to run fetchnews with the "stable"
version, while giving another one to leafnode.
This means possibly an option in /etc/leafnode/config, but definitely
a runtime option to all the programs of the leafnode suite.
Currently, the name of the script file is hardwired in the lua scripting
code to "/etc/leafnode/scripthooks.lua". Note that lua is not the only
scripting backend possible, there is an interface layer called
"script-redirects.c" allowing future extensions in other languages.
A clean solution would be a config file option like "script = lua
/etc/leafnode/scripthooks.lua" or maybe "script-lua = ...", and for the
runtime, there'd need to be one option to set a language and another one
to set the corresponding script file. The best solution would be to
make the options cummulative, so that people can run scripts in several
languages. Currently, the lua scripting can handle only one script
file, and there's no other language extension, so the minimum solution
for my immediate problem would be one single option to define that
filename.
Looking through the manual pages, I think there are no options "-L" and
"-l" to any of the leafnode programs, so I'd like to have "-l
<scriptfile>" with "-L lua" implied. "-L <language>" should be reserved
to select the scripting language and "-l <file>" to select the
associated program text file.
I hope this can be made to happen soonish, because the per-group auth
code is already written and checked in, but not tested yet, and it is
awkward to test it with active fetchnews spam filtering at the same
time.
clemens
More information about the leafnode-list
mailing list