pub struct AppConfig {Show 25 fields
pub database_url: String,
pub database_password: Option<String>,
pub max_database_pool_connections: Option<u32>,
pub database_connection_idle_timeout_seconds: Option<f64>,
pub database_connection_max_lifetime_seconds: Option<f64>,
pub sqlite_extensions: Vec<String>,
pub listen_on: Option<SocketAddr>,
pub port: Option<u16>,
pub unix_socket: Option<PathBuf>,
pub database_connection_retries: u32,
pub database_connection_acquire_timeout_seconds: f64,
pub web_root: PathBuf,
pub configuration_directory: PathBuf,
pub allow_exec: bool,
pub max_uploaded_file_size: usize,
pub https_domain: Option<String>,
pub https_certificate_email: Option<String>,
pub https_certificate_cache_dir: PathBuf,
pub https_acme_directory_url: String,
pub environment: DevOrProd,
pub site_prefix: String,
pub max_pending_rows: usize,
pub compress_responses: bool,
pub content_security_policy: Option<String>,
pub system_root_ca_certificates: bool,
}Fields§
§database_url: String§database_password: Option<String>A separate field for the database password. If set, this will override any password specified in the database_url.
max_database_pool_connections: Option<u32>§database_connection_idle_timeout_seconds: Option<f64>§database_connection_max_lifetime_seconds: Option<f64>§sqlite_extensions: Vec<String>§listen_on: Option<SocketAddr>§port: Option<u16>§unix_socket: Option<PathBuf>§database_connection_retries: u32Number of times to retry connecting to the database after a failure when the server starts up. Retries will happen every 5 seconds. The default is 6 retries, which means the server will wait up to 30 seconds for the database to become available.
database_connection_acquire_timeout_seconds: f64Maximum number of seconds to wait before giving up when acquiring a database connection from the pool. The default is 10 seconds.
web_root: PathBufThe directory where the .sql files are located. Defaults to the current directory.
configuration_directory: PathBufThe directory where the sqlpage configuration file is located. Defaults to ./sqlpage.
allow_exec: boolSet to true to allow the sqlpage.exec function to be used in SQL queries.
This should be enabled only if you trust the users writing SQL queries, since it gives
them the ability to execute arbitrary shell commands on the server.
max_uploaded_file_size: usizeMaximum size of uploaded files in bytes. The default is 10MiB (10 * 1024 * 1024 bytes)
https_domain: Option<String>A domain name to use for the HTTPS server. If this is set, the server will perform all the necessary steps to set up an HTTPS server automatically. All you need to do is point your domain name to the server’s IP address.
It will listen on port 443 for HTTPS connections, and will automatically request a certificate from Let’s Encrypt using the ACME protocol (requesting a TLS-ALPN-01 challenge).
https_certificate_email: Option<String>The email address to use when requesting a certificate from Let’s Encrypt.
Defaults to contact@<https_domain>.
https_certificate_cache_dir: PathBufThe directory to store the Let’s Encrypt certificate in. Defaults to ./sqlpage/https.
https_acme_directory_url: StringURL to the ACME directory. Defaults to the Let’s Encrypt production directory.
environment: DevOrProdWhether we should run in development or production mode. Used to determine whether to show error messages to the user.
site_prefix: StringServe the website from a sub path. For example, if you set this to /sqlpage/, the website will be
served from https://yourdomain.com/sqlpage/. Defaults to /.
This is useful if you want to serve the website on the same domain as other content, and
you are using a reverse proxy to route requests to the correct server.
max_pending_rows: usizeMaximum number of messages that can be stored in memory before sending them to the client. This prevents a single request from using up all available memory.
compress_responses: boolWhether to compress the http response body when the client supports it.
content_security_policy: Option<String>Content-Security-Policy header to send to the client. If not set, a default policy allowing scripts from the same origin is used and from jsdelivr.net
system_root_ca_certificates: boolWhether sqlpage.fetch should load trusted certificates from the operating system’s certificate store
By default, it loads Mozilla’s root certificates that are embedded in the SQLPage binary, or the ones pointed to by the
SSL_CERT_FILE and SSL_CERT_DIR environment variables.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AppConfig
impl<'de> Deserialize<'de> for AppConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for AppConfig
Auto Trait Implementations§
impl Freeze for AppConfig
impl RefUnwindSafe for AppConfig
impl Send for AppConfig
impl Sync for AppConfig
impl Unpin for AppConfig
impl UnwindSafe for AppConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more