Add back the default database path.

Allow default server_name when testing.

Default to smoke test vector when testing.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-09-27 15:49:46 +00:00
parent 292b601755
commit ae52676e33
6 changed files with 57 additions and 11 deletions

View File

@@ -76,14 +76,14 @@ pub struct Config {
/// WIPE.
///
/// example: "girlboss.ceo"
#[cfg_attr(test, serde(default = "default_server_name"))]
pub server_name: OwnedServerName,
/// This is the only directory where tuwunel will save its data, including
/// media. Note: this was previously "/var/lib/matrix-conduit".
///
/// YOU NEED TO EDIT THIS.
///
/// example: "/var/lib/tuwunel"
/// default: "/var/lib/tuwunel"
#[serde(default = "default_database_path")]
pub database_path: PathBuf,
/// Text which will be added to the end of the user's displayname upon
@@ -1870,6 +1870,12 @@ pub struct Config {
#[serde(default)]
pub tokio_console: bool,
/// Arbitrary argument vector for integration testing. Functionality in the
/// server is altered or informed for the requirements of integration tests.
/// - "smoke" performs a shutdown after startup admin commands rather than
/// hanging on client handling.
///
/// default: []
#[serde(default)]
pub test: BTreeSet<String>,
@@ -2571,6 +2577,11 @@ impl Config {
fn true_fn() -> bool { true }
#[cfg(test)]
fn default_server_name() -> OwnedServerName { ruma::owned_server_name!("localhost") }
fn default_database_path() -> PathBuf { "/var/lib/tuwunel".to_owned().into() }
fn default_address() -> ListeningAddr {
ListeningAddr {
addrs: Right(vec![Ipv4Addr::LOCALHOST.into(), Ipv6Addr::LOCALHOST.into()]),