This commit is contained in:
parent
cc8fcd682b
commit
91db5861c8
21 changed files with 1263 additions and 79 deletions
|
|
@ -14,6 +14,8 @@ pub struct Config {
|
|||
pub cookie_secure: bool,
|
||||
pub agent_max_turns: u32,
|
||||
pub agent_max_duration_secs: u64,
|
||||
pub vapid_private_key: String,
|
||||
pub vapid_public_key: String,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
|
|
@ -54,6 +56,11 @@ impl Config {
|
|||
.and_then(|s| s.parse().ok())
|
||||
.unwrap_or(120);
|
||||
|
||||
let vapid_private_key = env::var("VAPID_PRIVATE_KEY")
|
||||
.map_err(|_| AppError::Config("VAPID_PRIVATE_KEY must be set".into()))?;
|
||||
let vapid_public_key = env::var("VAPID_PUBLIC_KEY")
|
||||
.map_err(|_| AppError::Config("VAPID_PUBLIC_KEY must be set".into()))?;
|
||||
|
||||
Ok(Config {
|
||||
database_url,
|
||||
port,
|
||||
|
|
@ -66,6 +73,8 @@ impl Config {
|
|||
cookie_secure,
|
||||
agent_max_turns,
|
||||
agent_max_duration_secs,
|
||||
vapid_private_key,
|
||||
vapid_public_key,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue