config.lua
author Tero Marttila <terom@fixme.fi>
Wed, 27 May 2009 23:57:48 +0300
branchnew-lib-errors
changeset 217 7728d6ec3abf
parent 138 a716c621cb90
permissions -rw-r--r--
nexus.c compiles
134
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
     1
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
     2
--
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
     3
-- Helper functions
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
     4
--
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
     5
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
     6
-- match all lines and output them as-is
138
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
     7
local function logwatch_filter_all (name)
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
     8
    return { name=name }
134
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
     9
end
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    10
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    11
-- match using a regex pattern, but output the full line
138
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    12
local function logwatch_filter_raw (name, pat)
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    13
    return { name=name, pat=pat }
134
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    14
end
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    15
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    16
-- match using a regexp pattern, and output a formatted line
138
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    17
local function logwatch_filter (name, pat, fmt)
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    18
    return { name=name, pat=pat, fmt=fmt }
134
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    19
end
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    20
138
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    21
-- match using a regexp pattern, and do *not* output
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    22
local function logwatch_filter_blackhole (name, pat)
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    23
    return { name=name, pat=pat, channel_is_null=true }
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    24
end
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    25
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    26
logwatch_timestamp_pat = "\\w{3} [0-9 ]\\d \\d{2}:\\d{2}:\\d{2}"
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    27
134
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    28
-- match auth.log sudo entries
138
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    29
local function logwatch_filter_sudo (name)
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    30
    return logwatch_filter(name,
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    31
        "^" .. logwatch_timestamp_pat .. " (?P<hostname>\\S+)\\s+sudo:\\s*(?P<username>\\S+) : TTY=(?P<tty>\\S+) ; PWD=(?P<pwd>.+?) ; USER=(?P<target_user>\\S+) ; COMMAND=(?P<command>.*)$",
134
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    32
        "{username}:{tty} - {target_user}@{hostname}:{pwd} - {command:r}"
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    33
    )
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    34
end
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    35
138
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    36
-- filter out the prefixed timestamp from lines
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    37
local function logwatch_filter_strip_timestamp (name)
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    38
    return logwatch_filter(name,
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    39
        "^" .. logwatch_timestamp_pat .. " (?P<line>.+)$",
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    40
        "{line}"
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    41
    )
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    42
end
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    43
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    44
-- filter out auth.log cron messages
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    45
local function logwatch_filter_no_cron (name)
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    46
    return logwatch_filter_blackhole(name,
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    47
        "^" .. logwatch_timestamp_pat .. " \\S+\\s+(CRON|su)\\[\\d+\\]: pam_unix\\(\\w+:\\w+\\): session (opened|closed) for user \\w+( by \\(uid=\\d+\\))?$"
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    48
    )
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    49
end
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    50
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    51
-- filter out auth.log 'su for nobody by root' messages
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    52
local function logwatch_filter_no_su_nobody (name)
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    53
    return logwatch_filter_blackhole(name,
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    54
        "^" .. logwatch_timestamp_pat .. " \\S+\\s+su\\[\\d+\\]: (Successful su for nobody by root|\\+ \\?\\?\\? root:nobody)$"
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    55
    )
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    56
end
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    57
134
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    58
--
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    59
-- Procedural config
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    60
--
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    61
local function apply_config (conf)
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    62
    -- apply general
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    63
    log_level(conf.log_level)
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    64
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    65
    -- apply conf.name
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    66
    client:set_defaults(conf.name.nickname, conf.name.username, conf.name.realname)
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    67
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    68
    -- apply conf.networks
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    69
    for network, settings in pairs(conf.networks) do
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    70
        -- establish the irc_net
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    71
        net = client:connect(network, settings.hostname)
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    72
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    73
        -- join each channel
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    74
        for i, channel in ipairs(settings.channels) do
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    75
            net:join(channel)
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    76
        end
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    77
    end
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    78
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    79
    -- apply conf.modules_path
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    80
    if conf.modules_path then
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    81
        modules:path(conf.modules_path)
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    82
    end
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    83
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    84
    -- apply conf.modules
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    85
    for name, settings in pairs(conf.modules) do
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    86
        -- load the module
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    87
        module = modules:load(name, settings.path)
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    88
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    89
        -- apply confs
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    90
        for key, value in pairs(settings.conf) do
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    91
            module:conf(key, value)
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    92
        end
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    93
    end
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    94
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    95
    -- conf.mod_logwatch
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    96
    if conf.mod_logwatch then
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    97
        module = modules:load("logwatch")
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    98
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    99
        for fifo_path, settings in pairs(conf.mod_logwatch) do
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   100
            module:conf("source_fifo", fifo_path)
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   101
            source_name = fifo_path
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   102
            
138
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
   103
            for i, filter in ipairs(settings.filters) do
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
   104
                if filter.channel_is_null then
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
   105
                    channel = nil
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
   106
                else
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
   107
                    channel = settings.channel
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
   108
                end
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
   109
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
   110
                module:conf("filter", filter.name, source_name, filter.pat, filter.fmt, channel)
134
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   111
            end
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   112
        end
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   113
    end
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   114
end
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   115
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   116
--
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   117
-- Declarative configuration settings
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   118
--
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   119
apply_config{
106
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   120
    log_level   = "DEBUG",
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   121
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   122
    name = {
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   123
        nickname    = "SpBotDev",
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   124
        username    = "spbot-dev",
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   125
        realname    = "SpBot (development version)"
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   126
    },
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   127
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   128
    networks = {
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   129
        PVLNet      = {
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   130
            hostname    = "irc.fixme.fi",
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   131
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   132
            channels    = {
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   133
                "#test"
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   134
            }
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   135
        },
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   136
    },
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   137
115
2d74b38b56de implement modules:path for config.lua
Tero Marttila <terom@fixme.fi>
parents: 106
diff changeset
   138
    modules_path    = "src/modules",
2d74b38b56de implement modules:path for config.lua
Tero Marttila <terom@fixme.fi>
parents: 106
diff changeset
   139
106
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   140
    modules = {
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   141
        irc_log     = {
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   142
            conf        = {
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   143
                db_info     = "dbname=spbot",
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   144
                channel     = "PVLNet/#test",
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   145
            }
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   146
        }
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   147
    },
134
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   148
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   149
    mod_logwatch = {
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   150
        ["test.fifo"] = {
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   151
            channel     = "PVLNet/#test",
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   152
            
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   153
            filters     = {
138
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
   154
                logwatch_filter_raw             ("test.foo", "foo"  ),
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
   155
                logwatch_filter_sudo            ("test.sudo"        ),
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
   156
                logwatch_filter_no_cron         ("test.no_cron"     ),
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
   157
                logwatch_filter_no_su_nobody    ("test.no_cron_su"  ),
a716c621cb90 implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
   158
                logwatch_filter_strip_timestamp ("test.all"         )
134
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   159
            }
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   160
        },
978041c1c04d update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
   161
    },
106
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   162
}
f00661136ac2 add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   163