struct

Exu::Config

Inherits JSON::Serializable < YAML::Serializable < Struct < Value < Object

Master System Configuration

Constructors

load(path : String = config_path) : Config

Loads the configuration from disk, falling back to defaults if not found

Source
new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
Source
new(pull : JSON::PullParser)
Source
new(version : String = "1.0", users : Hash(String, UserConfig) = {} of String => UserConfig, domains : Hash(String, DomainConfig) = {} of String => DomainConfig)
Source
new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Class methods

config_path
Source
dkim_dns_record(domain : String, dkim_dir : String = "/etc/exu/dkim") : NamedTuple(host: String, type: String, value: String) | Nil

Formats DKIM public key DNS TXT record

Source
dmarc_dns_record(domain : String, dmarc : DmarcConfig) : NamedTuple(host: String, type: String, value: String)

Formats DMARC DNS TXT record

Source
lock_path
Source
mx_dns_record(domain : String, mail_hostname : String) : NamedTuple(host: String, type: String, priority: Int32, value: String)

Formats MX DNS record

Source
save(config : Config, path : String = config_path)

Saves the configuration atomically to disk under lock

Source
spf_dns_record(domain : String, mail_hostname : String) : NamedTuple(host: String, type: String, value: String)

Formats SPF DNS TXT record

Source
with_lock(timeout_seconds : Float64 = 5.0, &)

Acquire advisory file lock for safe mutations across processes

Source

Instance methods

domains
Source
domains=(domains : Hash(String, DomainConfig))
Source
users
Source
users=(users : Hash(String, UserConfig))
Source
version
Source
version=(version : String)
Source