pub struct ServerConfig {Show 14 fields
pub bake_worker: Option<Config>,
pub secure_cookies: CookieSecurity,
pub trust_proxy: bool,
pub tls: bool,
pub lock_script_editor: bool,
pub max_attachment_bytes: u64,
pub max_document_bytes: u64,
pub min_client_version: Option<String>,
pub backup_dir: Option<PathBuf>,
pub backup_every_minutes: u64,
pub backup_keep: usize,
pub cad_app_dir: Option<PathBuf>,
pub web_dir: Option<PathBuf>,
pub cad_connect_src: Vec<String>,
}Expand description
How the server faces the network. Set from the command line at start-up; nothing in the browser can change it.
Fields§
§bake_worker: Option<Config>Native worker pinned by the server operator, controlled by admins.
trust_proxy: boolBelieve X-Forwarded-For and X-Forwarded-Proto. Only right behind a
reverse proxy that sets them; otherwise any client could claim any
address and dodge the per-address throttle.
tls: boolThe server terminates TLS itself (--tls-cert / --tls-key).
lock_script_editor: bool--lock-script-editor: the in-browser script editor is off whatever
the settings say. The one protection an admin login cannot undo.
max_attachment_bytes: u64--max-attachment-mb: the largest attachment an upload may carry, in
bytes. 0 means DEFAULT_MAX_ATTACHMENT.
max_document_bytes: u64--max-document-mb: the largest body a document write — a revision’s
document, or the @recovery preference that mirrors unsaved ones — may
carry, in bytes. 0 means DEFAULT_MAX_DOCUMENT.
min_client_version: Option<String>--min-client-version: a floor on the CAD app’s version ABOVE
crate::version::MIN_CLIENT_VERSION, for an administrator retiring
old installs — and for a test runner provoking the app’s refusal. None
means the built-in floor.
backup_dir: Option<PathBuf>--backup-dir: where scheduled and “Back up now” backups are saved.
None: backups are only downloaded.
backup_every_minutes: u64--backup-every: minutes between scheduled backups; 0 is none.
backup_keep: usize--backup-keep: how many saved backups to keep; 0 means 7.
cad_app_dir: Option<PathBuf>--cad-app: the directory the wasm CAD app is served from
(crate::cad). None: no app is hosted.
web_dir: Option<PathBuf>--web-dir: live PLM frontend files overriding the embedded bundle.
cad_connect_src: Vec<String>--cad-connect-src: origins the hosted CAD app may call besides this
server (crate::cad::policy).
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn attachment_limit(&self) -> u64
pub fn attachment_limit(&self) -> u64
The upload limit in force.
Sourcepub fn min_client_version(&self) -> &str
pub fn min_client_version(&self) -> &str
The oldest CAD app this server serves: --min-client-version when
given, else the built-in crate::version::MIN_CLIENT_VERSION.
Sourcepub fn document_limit(&self) -> u64
pub fn document_limit(&self) -> u64
The document body limit in force.
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn is_secure_request(&self, headers: &HeaderMap) -> bool
pub fn is_secure_request(&self, headers: &HeaderMap) -> bool
Whether this request reached the server over TLS, as far as the server can know.
Whether a cookie set in answer to this request is Secure.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§impl Debug for ServerConfig
impl Debug for ServerConfig
Auto Trait Implementations§
impl Forget for ServerConfig
impl Freeze for ServerConfig
impl Move for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfigwhere
RawVecInner: Send,
impl Sync for ServerConfigwhere
RawVecInner: Sync,
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfigwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for ServerConfigwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
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,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.