#[non_exhaustive]pub struct DevtoolsConfig {
pub enabled: Option<bool>,
pub error_text: bool,
pub key: Option<String>,
pub local: bool,
}Expand description
The developer tools’ settings, read from the environment.
An application may change them in src/app.rs, after they are read:
use laravel_rust_devtools::DevtoolsConfig;
laravel::Application::configure().with_config(|config, _| {
config.section_mut::<DevtoolsConfig>().error_text = true;
});Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.enabled: Option<bool>DEVTOOLS_ENABLED: false turns the developer tools off where they would run. Unset, they
run in a build with debug assertions with APP_ENV=local. true asks for them: such a
build that runs anywhere else, except in the application’s tests, then refuses to start
rather than run without them unnoticed. A build without debug assertions has none of the
developer tools and ignores it.
error_text: boolDEVTOOLS_ERROR_TEXT: whether traces record what an error says, which may quote a value.
Off by default: a trace then keeps an error’s kind, where it was raised and when, and records
its text as [masked], in a reported error, a job that will be retried and every field
named error. Turn it on while looking for a bug. Everyone who can read the traces sees
those texts, as the developer tools’ API at /_devtools/api gives them.
key: Option<String>DEVTOOLS_KEY: the key that opens the developer tools to someone who isn’t on the
application’s own machine, such as a browser behind a proxy. They enter it once at
/_devtools/login, and a cookie signed with APP_KEY lets them in for 12 hours, which the
application checks itself; a new key shuts out every cookie made with the old one. Between
32 and 72 bytes: the application doesn’t start with a shorter or longer one. Unset, only the
machine itself gets in.
local: boolDEVTOOLS_LOCAL: whether a browser on the application’s own machine gets in without the
key. On by default; turn it off where a proxy or tunnel on the same machine forwards to the
application, such as nginx with proxy_pass http://127.0.0.1:8000: its requests look
local.
Implementations§
Source§impl DevtoolsConfig
impl DevtoolsConfig
Sourcepub fn from_env(env: &Env) -> Self
pub fn from_env(env: &Env) -> Self
Read the section from the environment, starting from its defaults.
| Field | Variable | Default |
|---|---|---|
enabled | DEVTOOLS_ENABLED | none |
error_text | DEVTOOLS_ERROR_TEXT | false |
key | DEVTOOLS_KEY | none |
local | DEVTOOLS_LOCAL | true |
from_env records invalid values and missing required values in env. Those problems
stop the application from starting.
Trait Implementations§
Source§impl Clone for DevtoolsConfig
impl Clone for DevtoolsConfig
Source§impl Debug for DevtoolsConfig
The key stays out of logs and error messages.
impl Debug for DevtoolsConfig
The key stays out of logs and error messages.