Fix sessions persisting across server restart
Need a non-random session secret.
This commit is contained in:
parent
609f6d3d9f
commit
d5c5185351
@ -67,6 +67,7 @@ builds
|
||||
SMTP_USER=user
|
||||
SMTP_PASSWORD=password
|
||||
EMAIL_FROM="crawlnicle <no-reply@mail.crawlnicle.com>"
|
||||
SESSION_SECRET=64-bytes-of-secret
|
||||
```
|
||||
|
||||
1. Run `just migrate` (or `sqlx migrate run`) which will run all the database
|
||||
|
@ -30,4 +30,6 @@ pub struct Config {
|
||||
pub smtp_password: String,
|
||||
#[clap(long, env)]
|
||||
pub email_from: Mailbox,
|
||||
#[clap(long, env)]
|
||||
pub session_secret: String,
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ async fn main() -> Result<()> {
|
||||
let domain_locks = DomainLocks::new();
|
||||
let client = Client::builder().user_agent(USER_AGENT).build()?;
|
||||
|
||||
let secret = rand::thread_rng().gen::<[u8; 64]>();
|
||||
let secret = config.session_secret.as_bytes();
|
||||
|
||||
let pool = PgPoolOptions::new()
|
||||
.max_connections(config.database_max_connections)
|
||||
|
Loading…
Reference in New Issue
Block a user