From 76b9fe606ba8c9bf580e142a08a95b6983b9f8ad Mon Sep 17 00:00:00 2001 From: Oliver Stenbom Date: Mon, 3 Jun 2024 12:55:09 +0200 Subject: [PATCH 1/2] Improve localdns install log --- linkup-cli/src/local_dns.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linkup-cli/src/local_dns.rs b/linkup-cli/src/local_dns.rs index 8b6a1fa..a79ebfe 100644 --- a/linkup-cli/src/local_dns.rs +++ b/linkup-cli/src/local_dns.rs @@ -34,6 +34,8 @@ pub fn install(config_arg: &Option) -> Result<()> { ensure_resolver_dir()?; install_resolvers(&input_config.top_level_domains())?; + + println!("Installing extra caddy packages, this could take a while..."); services::caddy::install_cloudflare_package()?; services::caddy::install_redis_package()?; From 85d0ddb20e17227279942da0f011f9059cb10c91 Mon Sep 17 00:00:00 2001 From: Oliver Stenbom Date: Mon, 3 Jun 2024 13:00:58 +0200 Subject: [PATCH 2/2] Clear previous caddy log on linkup start --- linkup-cli/src/services/caddy.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/linkup-cli/src/services/caddy.rs b/linkup-cli/src/services/caddy.rs index 28df53a..b303084 100644 --- a/linkup-cli/src/services/caddy.rs +++ b/linkup-cli/src/services/caddy.rs @@ -27,6 +27,15 @@ pub fn start(domains: Vec) -> Result<()> { write_caddyfile(&domains_and_subdomains)?; + // Clear previous log file on startup + fs::write(linkup_file_path(LOG_FILE), "").map_err(|err| { + CliError::WriteFile(format!( + "Failed to clear log file at {}, error: {}", + linkup_file_path(LOG_FILE).display(), + err + )) + })?; + Command::new("caddy") .current_dir(linkup_dir_path()) .arg("start")