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) = Hash(String, UserConfig).new, domains : Hash(String, DomainConfig) = Hash(String, DomainConfig).new, defaults : DefaultsConfig | Nil = nil, branding : BrandingConfig = BrandingConfig.new)
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 = (ENV["EXU_DKIM_DIR"]? || "/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_held?

Checks if the advisory file lock is currently held by this fiber

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 re-entrant advisory file lock for safe mutations across processes

Source

Instance methods

branding
Source
branding=(branding : BrandingConfig)
Source
defaults
Source
defaults=(defaults : DefaultsConfig | Nil)
Source
domains
Source
domains=(domains : Hash(String, DomainConfig))
Source
users
Source
users=(users : Hash(String, UserConfig))
Source
version
Source
version=(version : String)
Source