pub struct ServerConfig {Show 17 fields
pub environment: String,
pub root_path: String,
pub network: Network,
pub logging: Logging,
pub certificate: Option<Certificate>,
pub compression: Option<Compression>,
pub command_control: Option<Value>,
pub security: Option<Value>,
pub oidc: Option<Value>,
pub store: Option<Value>,
pub authentication: Option<Value>,
pub content: Option<Value>,
pub proxy: Option<Value>,
pub browser: Option<Value>,
pub crawler: Option<Value>,
pub vpn: Option<Value>,
pub connectors: Option<BTreeMap<String, Value>>,
}Expand description
Main configuration structure for Product OS Server
This structure contains all configuration options for running a Product OS server instance, including network settings, security, authentication, data stores, and more.
Individual domain crates own their own config types. This struct composes them for the server’s top-level configuration.
Fields§
§environment: StringEnvironment name (e.g., “development”, “production”)
root_path: StringRoot path for the server
network: NetworkNetwork configuration
logging: LoggingLogging configuration
certificate: Option<Certificate>TLS/SSL certificate configuration
compression: Option<Compression>Compression configuration
command_control: Option<Value>Command and control configuration (raw JSON, parsed by product-os-command-control)
security: Option<Value>Security configuration (raw JSON, parsed by product-os-security)
oidc: Option<Value>OIDC configuration
store: Option<Value>Data store configurations (raw JSON, parsed by product-os-store)
authentication: Option<Value>Authentication configuration (raw JSON, parsed by product-os-authentication)
content: Option<Value>Content server configuration (raw JSON, parsed by product-os-content-setup)
proxy: Option<Value>Network proxy configuration (raw JSON, parsed by product-os-proxy)
browser: Option<Value>Browser configuration (raw JSON, parsed by product-os-browser)
crawler: Option<Value>Web crawler configuration (raw JSON, parsed by product-os-crawler)
vpn: Option<Value>VPN configuration (raw JSON, parsed by product-os-vpn)
connectors: Option<BTreeMap<String, Value>>API connector definitions (raw JSON)
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn environment(&self) -> &str
pub fn environment(&self) -> &str
Get the environment name
Sourcepub fn url_address(&self) -> Url
👎Deprecated since 0.0.53: Use try_url_address which returns Result instead of panicking
pub fn url_address(&self) -> Url
Build the complete URL address from configuration
§Panics
Panics if the URL cannot be parsed. Use try_url_address for a non-panicking alternative.
Sourcepub fn try_url_address(&self) -> Result<Url>
pub fn try_url_address(&self) -> Result<Url>
Build the complete URL address from configuration, returning an error if parsing fails.
§Errors
Returns ConfigurationError if the URL cannot be parsed from the configured
protocol, host, port, and root path.
Sourcepub fn socket_address(&self, port: Option<u16>, default_all: bool) -> SocketAddr
pub fn socket_address(&self, port: Option<u16>, default_all: bool) -> SocketAddr
Get socket address for binding
Sourcepub fn get_socket_address(
host: &str,
port: u16,
default_all: bool,
) -> SocketAddr
pub fn get_socket_address( host: &str, port: u16, default_all: bool, ) -> SocketAddr
Create socket address from components
Sourcepub fn all_insecure(&self) -> bool
pub fn all_insecure(&self) -> bool
Check if insecure connections are allowed
Sourcepub fn insecure_port(&self) -> u16
pub fn insecure_port(&self) -> u16
Get insecure port number
Sourcepub fn insecure_force_secure(&self) -> bool
pub fn insecure_force_secure(&self) -> bool
Check if insecure connections should force redirect to secure
Sourcepub fn is_compression_gzip(&self) -> bool
pub fn is_compression_gzip(&self) -> bool
Check if gzip compression is enabled
Sourcepub fn is_compression_deflate(&self) -> bool
pub fn is_compression_deflate(&self) -> bool
Check if deflate compression is enabled
Sourcepub fn is_compression_brotli(&self) -> bool
pub fn is_compression_brotli(&self) -> bool
Check if brotli compression is enabled
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more