Created
March 24, 2025 22:24
-
-
Save blakethepatton/6d830d3dbd0e51400e6675b47a7c86aa to your computer and use it in GitHub Desktop.
tsa example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local tsa = require 'tsa' | |
local kumo = require 'kumo' | |
kumo.on('tsa_init', function() | |
tsa.start_http_listener { | |
listen = '0.0.0.0:8008', | |
trusted_hosts = { '127.0.0.1', '::1', '0.0.0.0', '0.0.0.0/0' }, | |
} | |
end) | |
local cached_load_shaping_data = kumo.memoize(kumo.shaping.load, { | |
name = 'tsa_load_shaping_data', | |
ttl = '5 minutes', | |
capacity = 4, | |
}) | |
kumo.on('tsa_load_shaping_data', function() | |
local shaping = cached_load_shaping_data { | |
'/opt/kumomta/share/policy-extras/shaping.toml', | |
'/opt/kumomta/share/community/shaping.toml', | |
'/opt/kumomta/etc/policy/shaping.toml', | |
} | |
return shaping | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment