Added default update server

This commit is contained in:
Uber Veng
2026-05-22 11:24:33 +07:00
parent 5f152a750c
commit 0cbc128193
2 changed files with 15 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "ostiary"
version = "1.0.8"
version = "1.0.9"
edition = "2024"
[dependencies]

View File

@@ -61,10 +61,22 @@ impl Config {
server_url: server_url.to_string(),
timeout_sec: 10,
theme: default_theme(),
update_api: None,
update_api: Some("https://git.vainend.com/api/v1/repos/admin/ostiary".to_string()),
};
let contents = format!(
r#"server_url = "{}"
timeout_sec = {}
update_api = "https://git.vainend.com/api/v1/repos/admin/ostiary"
[theme]
selected_bg = "{}"
"#,
config.server_url,
config.timeout_sec,
config.theme.selected_bg,
);
fs::create_dir_all(path.parent().unwrap())?;
fs::write(&path, toml::to_string_pretty(&config)?)?;
fs::write(&path, contents)?;
Ok(config)
}
}