feat(backup): add dns_config into backup (#5166)
This commit is contained in:
@@ -288,6 +288,12 @@ pub fn create_backup() -> Result<(String, PathBuf), Error> {
|
||||
zip.start_file(dirs::VERGE_CONFIG, options)?;
|
||||
zip.write_all(serde_yaml_ng::to_string(&verge_config)?.as_bytes())?;
|
||||
|
||||
let dns_config_path = dirs::app_home_dir()?.join(dirs::DNS_CONFIG);
|
||||
if dns_config_path.exists() {
|
||||
zip.start_file(dirs::DNS_CONFIG, options)?;
|
||||
zip.write_all(fs::read(&dns_config_path)?.as_slice())?;
|
||||
}
|
||||
|
||||
zip.start_file(dirs::PROFILE_YAML, options)?;
|
||||
zip.write_all(fs::read(dirs::profiles_path()?)?.as_slice())?;
|
||||
zip.finish()?;
|
||||
|
||||
@@ -20,6 +20,7 @@ pub static PORTABLE_FLAG: OnceCell<bool> = OnceCell::new();
|
||||
pub static CLASH_CONFIG: &str = "config.yaml";
|
||||
pub static VERGE_CONFIG: &str = "verge.yaml";
|
||||
pub static PROFILE_YAML: &str = "profiles.yaml";
|
||||
pub static DNS_CONFIG: &str = "dns_config.yaml";
|
||||
|
||||
/// init portable flag
|
||||
pub fn init_portable_flag() -> Result<()> {
|
||||
|
||||
Reference in New Issue
Block a user