pub struct ConfigFile {
Show 27 fields pub hostname: String, pub address: String, pub port: u16, pub capture_packets: bool, pub log_level: String, pub tcp_client_timeout: u64, pub enable_hinfo: bool, pub sqlite_path: String, pub zone_file: Option<String>, pub allowed_tlds: Vec<String>, pub ip_allow_lists: IPAllowList, pub enable_api: bool, pub api_port: u16, pub api_tls_cert: PathBuf, pub api_tls_key: PathBuf, pub api_static_dir: String, api_cookie_secret: String, pub oauth2_client_id: String, pub oauth2_redirect_url: Url, pub oauth2_secret: String, pub oauth2_config_url: String, pub oauth2_user_scopes: Vec<String>, pub sql_log_statements: bool, pub sql_log_slow_duration: u64, pub sql_db_cleanup_seconds: u64, pub admin_contact: ContactDetails, pub user_auto_provisioning: bool,
}
Expand description

The main config blob for GoatNS, write this as a JSON file and load it and it’ll make things go.

Fields

hostname: String

The server’s hostname when generating an SOA record, defaults to the results of gethostname()

address: String

DNS listener address, default is 127.0.0.1

port: u16

Listen for DNS queries on this port, default is 15353

capture_packets: bool

If we should capture packets on request/response

log_level: String

Default is “DEBUG”

tcp_client_timeout: u64

How long until we drop TCP client connections, defaults to 5 seconds.

enable_hinfo: bool

Enable a HINFO record at hinfo.goat

sqlite_path: String

The location for the zone sqlite file

zone_file: Option<String>

Where the JSON zone file is

allowed_tlds: Vec<String>

List of “valid” TLDs - if this is empty let anything be created

ip_allow_lists: IPAllowList

IP Allow lists

enable_api: bool

Do you really want an API?

api_port: u16

API / Web UI Port

api_tls_cert: PathBuf

Certificate path

api_tls_key: PathBuf

TLS key path

api_static_dir: String

Static File Directory for api things

api_cookie_secret: String

Secret for cookie storage - it’ll randomly generate on startup by default

oauth2_client_id: String

OAuth2 Resource server name

oauth2_redirect_url: Url

If your instance is behind a proxy/load balancer/whatever, you need to specify this, eg https://example.com:12345

oauth2_secret: String

Oauth2 Secret

oauth2_config_url: String

OIDC Discovery URL, eg for Kanidm you’d use https://idm.example.com/oauth2/openid/:client_id:/.well-known/openid-configuration

oauth2_user_scopes: Vec<String>

A list of scopes to request from the IdP

sql_log_statements: bool

Log things sometimes

sql_log_slow_duration: u64

When queries take more than this many seconds, log them

sql_db_cleanup_seconds: u64

Clean up sessions table every n seconds

admin_contact: ContactDetails

Administrator contact details

user_auto_provisioning: bool

Allow auto-provisioning of users

Implementations

JSONify the configfile in a pretty way using serde

Get a bindable SocketAddr for use in the DNS listeners

get a string version of the listener address

It’s a sekret!

Uses Self::try_from and wraps it in a CowCell (moo)

The default locations are ~/.config/goatns.json and ./goatns.json.

Loads the configuration from a given file or from some default locations.

The default locations are ~/.config/goatns.json and ./goatns.json.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from a reference to the input type.
The associated error which can be returned from parsing.
Parses a string s to return a value of this type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Converts self into T using Into<T>. Read more
Compare self to key and return true if they are equal.
Causes self to use its Binary implementation when Debug-formatted.
Causes self to use its Display implementation when Debug-formatted. Read more
Causes self to use its LowerExp implementation when Debug-formatted. Read more
Causes self to use its LowerHex implementation when Debug-formatted. Read more
Causes self to use its Octal implementation when Debug-formatted.
Causes self to use its Pointer implementation when Debug-formatted. Read more
Causes self to use its UpperExp implementation when Debug-formatted. Read more
Causes self to use its UpperHex implementation when Debug-formatted. Read more
Formats each item in a sequence. Read more

Returns the argument unchanged.

Converts to this type from a reference to the input type.
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Pipes by value. This is generally the method you want to use. Read more
Borrows self and passes that borrow into the pipe function. Read more
Mutably borrows self and passes that borrow into the pipe function. Read more
Borrows self, then passes self.borrow() into the pipe function. Read more
Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Borrows self, then passes self.as_ref() into the pipe function.
Mutably borrows self, then passes self.as_mut() into the pipe function. Read more
Borrows self, then passes self.deref() into the pipe function.
Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
Immutable access to a value. Read more
Mutable access to a value. Read more
Immutable access to the Borrow<B> of a value. Read more
Mutable access to the BorrowMut<B> of a value. Read more
Immutable access to the AsRef<R> view of a value. Read more
Mutable access to the AsMut<R> view of a value. Read more
Immutable access to the Deref::Target of a value. Read more
Mutable access to the Deref::Target of a value. Read more
Calls .tap() only in debug builds, and is erased in release builds.
Calls .tap_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
Attempts to convert self into T using TryInto<T>. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more