fix starting the server when db/media dirs do not exist yet

This used to be supported, as we explicitly call std::fs::create_dir_all
when initializing these, but it was broken in
b01b70fc20, which attempts to canonicalize
the paths to check for overlap before creating them.
This commit is contained in:
Olivia Lee 2025-04-06 19:38:55 -07:00
parent abb1b5681e
commit 33f3592612
No known key found for this signature in database
GPG key ID: 54D568A15B9CD1F9
2 changed files with 6 additions and 7 deletions

View file

@ -15,7 +15,7 @@ use ruma::{
use serde::Deserialize;
use strum::{Display, EnumIter, IntoEnumIterator};
use crate::error;
use crate::{error, utils::partial_canonicalize};
mod env_filter_clone;
mod proxy;
@ -548,13 +548,13 @@ where
}
if !sandboxed {
let media_path = x
.path
.canonicalize()
let media_path = partial_canonicalize(&x.path)
.await
.map_err(|e| Error::Canonicalize(e, x.path.clone()))?;
let database_path =
config.database.path.canonicalize().map_err(|e| {
let database_path = partial_canonicalize(&config.database.path)
.await
.map_err(|e| {
Error::Canonicalize(e, config.database.path.clone())
})?;