This is a bit of a PITA.
In the docker build we end up with some bad linkage on libssl.so.1.1
on Ubuntu. That is the legacy ssl library, to which we should not
have been able to link, and for which there are no apt installable
sources.
See
<https://askubuntu.com/questions/1465498/update-libssl-so-1-1-for-the-latest-version>
Looking at the deps, the source of this linkage is the new HTTP
client bindings.
This commit dances around this issue by using the rustls implementation
for the client instead.
It's possible that this won't be sufficient, but it at least removes
the openssl linkage issue as a source of headaches for now.
I used a config like this for testing:
```
global
log stdout format raw local0 debug
defaults
timeout connect 10s
timeout client 30s
timeout server 30s
log global
listen outboundsmtp
log global
bind 0:2526 accept-proxy
mode tcp
use-server v4 if { src 0.0.0.0/0 }
use-server v6 if { src ::/0 }
server v4 0.0.0.0 source 0.0.0.0 usesrc clientip
server v6 ::: source ::: usesrc clientip
```
Launched via:
```console
$ sudo haproxy -f assets/haproxy.conf -V
```
with the source:
```lua
kumo.define_egress_source {
name = 'w00t',
ha_proxy_server = '127.0.0.1:2526',
ha_proxy_source_address = '192.168.1.92',
}
```
refs: #19
This makes it easier to compose secret management with a variety
of lua functions without having to build that directly into each
of them.
In particular: one can now use vaults or other secret stores that
we add in the future to manage credentials for HTTP clients.
```lua
local response = kumo.http
.build_client({})
:get('https://example.com/')
:send()
print(response:status_code(), response:status_reason())
for k, v in pairs(response:headers()) do
print("Header", k, v)
end
print(response:text())
```
Still need to write up some proper docs, but the gist is that
the example below will enqueue a message holding the content
of the JsonRecord for each log event, and that message will be
dispatched via a custom lua delivery mechanism.
```lua
kumo.on('init', function()
kumo.configure_log_hook {}
end)
kumo.on('make.lua-sender', function(domain, tenant, campaign)
print 'making lua sender'
local sender = {}
function sender:send(message)
print('Sending a message!', message:get_data())
return 'Super!'
end
return sender
end)
kumo.on('should_enqueue_log_record', function(msg)
local log_record = msg:get_meta 'log_record'
print('should_enqueue_log_record', log_record)
-- avoid an infinite loop caused by logging that we logged
if log_record.queue ~= 'lua-stuff' then
msg:set_meta('queue', 'lua-stuff')
return true
end
return false
end)
kumo.on('get_queue_config', function(domain, tenant, campaign)
print('get_queue_config', domain, tenant, campaign)
if domain == 'lua-stuff' then
return kumo.make_queue_config {
protocol = {
custom_lua = {
constructor = 'make.lua-sender',
},
},
}
end
return kumo.make_queue_config {}
end)
```