[][src]Struct df_st_core::config::ServerConfig

pub struct ServerConfig {
    pub address: Option<String>,
    pub port: Option<u16>,
    pub workers: Option<u16>,
    pub keep_alive: Option<u32>,
    pub log_level: Option<String>,
    pub secret_key: Option<String>,
    pub tls: Option<TLSConfig>,
    pub limits: Option<LimitsConfig>,
}

Everything in the configuration under df_storyteller-config.json.server.

Fields

address: Option<String>

Default is set to "127.0.0.1". To allow other devices to access the API use "0.0.0.0". Note: This comes with some advantages and security implications, like allowing traffic from other devices on the network (example phones). But if device is not behind NAT or port forwarding is set up, This can expose the interface to the internet and should be avoided! Using "localhost" or "127.0.0.1" can prevent these security implications. DO NOT USE "0.0.0.0" WHEN YOU ARE ON PUBLIC WIFI!

port: Option<u16>

Default is set to 20350

workers: Option<u16>

Default is set to None, if None, uses Rocket default = [number_of_cpus * 2]

keep_alive: Option<u32>

Default is set to None

log_level: Option<String>

This only effects logging from Rocket (server), not DF_Storyteller Allowed values: "Critical", "Normal", "Debug" and "Off" Default is set to None

secret_key: Option<String>

Secret key for private cookies. Should not be set in almost all cases. From Rocket Docs:

When manually specifying the secret key, the value should a 256-bit base64 encoded string. Such a string can be generated with the openssl command line tool: openssl rand -base64 32

If set this should be exactly 44 chars long. Default is None.

tls: Option<TLSConfig>

Set TLS settings, if not set, no TLS is used (just HTTP, no HTTPS) Default is None.

limits: Option<LimitsConfig>

Map from data type (string) to data limit (integer: bytes) The maximum size in bytes that should be accepted by a Rocket application for that data type. For instance, if the limit for "forms" is set to 256, only 256 bytes from an incoming form request will be read. Default is None.

Trait Implementations

impl Clone for ServerConfig[src]

impl Debug for ServerConfig[src]

impl Default for ServerConfig[src]

impl<'de> Deserialize<'de> for ServerConfig[src]

impl PartialEq<ServerConfig> for ServerConfig[src]

impl Serialize for ServerConfig[src]

impl StructuralPartialEq for ServerConfig[src]

Auto Trait Implementations

impl RefUnwindSafe for ServerConfig

impl Send for ServerConfig

impl Sync for ServerConfig

impl Unpin for ServerConfig

impl UnwindSafe for ServerConfig

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.