Files
kumomta/assets/init_with_tsa.lua
T
Wez Furlong 1872dc71a0 shaping: calling shaper.should_enqueue_log_record is no longer required
Allow multiple should_enqueue_log_record hooks to be registered,
and take advantage of that inside the shaping helper.

`shaper.should_enqueue_log_record` no longer needs to be explicitly
plumbed from the config, but we allow calling it still for compatibility
reasons.

We will remove that compatibility after the next stable release.
2023-11-03 08:52:40 -07:00

57 lines
1.3 KiB
Lua

local kumo = require 'kumo'
local shaping = require 'policy-extras.shaping'
local shaper = shaping:setup_with_automation {
publish = { 'http://127.0.0.1:8008' },
subscribe = { 'http://127.0.0.1:8008' },
extra_files = { 'assets/policy-extras/shaping.toml' },
}
kumo.on('init', function()
kumo.configure_accounting_db_path '/tmp/acct.db'
-- Configure publishing of logs to automation daemon
shaper.setup_publish()
kumo.start_esmtp_listener {
listen = '0.0.0.0:2025',
}
kumo.configure_local_logs {
log_dir = '/var/tmp/kumo-logs',
max_segment_duration = '1s',
}
kumo.start_http_listener {
listen = '0.0.0.0:8000',
-- allowed to access any http endpoint without additional auth
trusted_hosts = { '127.0.0.1', '::1' },
}
kumo.start_http_listener {
use_tls = true,
listen = '0.0.0.0:8001',
-- allowed to access any http endpoint without additional auth
trusted_hosts = { '127.0.0.1', '::1' },
}
kumo.define_spool {
name = 'data',
path = '/var/tmp/kumo-spool/data',
kind = 'RocksDB',
}
kumo.define_spool {
name = 'meta',
path = '/var/tmp/kumo-spool/meta',
kind = 'RocksDB',
}
end)
kumo.on('get_egress_source', function(source_name)
return kumo.make_egress_source {
name = source_name,
}
end)
kumo.on('get_egress_path_config', shaper.get_egress_path_config)