use key from config
This commit is contained in:
parent
b6111fb8fa
commit
233968fa97
6 changed files with 8 additions and 2 deletions
3
Cargo.lock
generated
3
Cargo.lock
generated
|
@ -575,8 +575,10 @@ checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747"
|
|||
dependencies = [
|
||||
"aes-gcm",
|
||||
"base64 0.22.1",
|
||||
"hkdf",
|
||||
"percent-encoding",
|
||||
"rand 0.8.5",
|
||||
"sha2",
|
||||
"subtle",
|
||||
"time",
|
||||
"version_check",
|
||||
|
@ -4268,6 +4270,7 @@ dependencies = [
|
|||
"axum-extra",
|
||||
"bollard",
|
||||
"config",
|
||||
"cookie",
|
||||
"futures-util",
|
||||
"http-body-util",
|
||||
"hyper",
|
||||
|
|
|
@ -15,6 +15,7 @@ askama_web = { version = "0.14.4", features = ["axum-0.8"] }
|
|||
axum = { version = "0.8", features = ["tokio", "http1", "http2", "macros"] }
|
||||
axum-extra = { version = "0.10", features = ["cookie-private", "typed-header"] }
|
||||
config = { version = "0.15", features = ["toml"] }
|
||||
cookie = { version = "0.18.1", features = ["key-expansion"] }
|
||||
futures-util = "0.3"
|
||||
hyper = "1.1"
|
||||
lettre = { version = "0.11.17", features = ["tokio1", "tokio1-native-tls", "tracing", "web"] }
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
[app]
|
||||
listen = "[::]:3742"
|
||||
key = "Q^,zH6M}*JY-W[oWCn6T7W!G=TvN,a5[~%cfRKZ7jse1EMDgG7GdTFy)ez*E(9I"
|
||||
|
||||
[email]
|
||||
server = "smtp.fastmail.com"
|
||||
|
|
|
@ -12,6 +12,7 @@ pub struct Database {
|
|||
pub struct App {
|
||||
pub listen: SocketAddr,
|
||||
pub public_url: String,
|
||||
pub key: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
|
|
|
@ -55,8 +55,7 @@ impl ZeroToAxum {
|
|||
|
||||
let app_state = AppState {
|
||||
conf: Arc::new(conf.clone()),
|
||||
// TODO: pull from config
|
||||
key: Key::generate(),
|
||||
key: Key::derive_from(conf.app.key.as_bytes()),
|
||||
db,
|
||||
email_client,
|
||||
};
|
||||
|
|
|
@ -49,6 +49,7 @@ impl TestServer {
|
|||
listen: "[::]:0".parse().unwrap(),
|
||||
// TODO: how do I both configure this and use a random port?
|
||||
public_url: "http://localhost/".to_string(),
|
||||
key: "Q^,zH6M}*JY-W[oWCn6T7W!G=TvN,a5[~%cfRKZ7jse1EMDgG7GdTFy)ez*E(9I".to_string(),
|
||||
},
|
||||
database: conf::Database { url },
|
||||
debug: true,
|
||||
|
|
Loading…
Add table
Reference in a new issue