mirror of
https://github.com/mailscope/kumomta.git
synced 2026-08-19 02:48:18 +00:00
1690e6526a
We're keeping a reference to it via kumo.start_proxy_listener briefly, just in case someone is using that live somewhere. We don't need to changelog this, as this whole feature hasn't been in a stable tag yet. refs: https://github.com/KumoCorp/kumomta/pull/472
21 lines
714 B
Lua
21 lines
714 B
Lua
-- Proxy configuration with optional authentication
|
|
-- Auth credentials are passed via environment variables
|
|
local kumo = require 'kumo'
|
|
local proxy = require 'proxy'
|
|
|
|
local REQUIRE_AUTH = os.getenv 'KUMO_PROXY_REQUIRE_AUTH' == 'true'
|
|
local AUTH_USERNAME = os.getenv 'KUMO_PROXY_AUTH_USERNAME' or 'testuser'
|
|
local AUTH_PASSWORD = os.getenv 'KUMO_PROXY_AUTH_PASSWORD' or 'testpass'
|
|
|
|
kumo.on('proxy_init', function()
|
|
proxy.start_proxy_listener {
|
|
listen = '127.0.0.1:0',
|
|
require_auth = REQUIRE_AUTH,
|
|
}
|
|
end)
|
|
|
|
kumo.on('proxy_server_auth_rfc1929', function(username, password, conn_meta)
|
|
-- Validate credentials against expected values
|
|
return username == AUTH_USERNAME and password == AUTH_PASSWORD
|
|
end)
|