diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index 52b3cb4c..f8ed49ff 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -18,15 +18,14 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - - name: Authenticate Github CLI + - name: Authenticate GitHub CLI + shell: bash run: | - Write-Output $Env:GITHUB_TOKEN | gh auth login --with-token + echo "$GITHUB_TOKEN" | gh auth login --with-token - name: Download cli-windows-x86_64.exe from this release run: | - gh release download "${{ github.event.release.tag_name }}" \ - --pattern cli-windows-x86_64.exe \ - --dir . + gh release download "${{ github.event.release.tag_name }}" --pattern cli-windows-x86_64.exe --dir . - name: Copy ICO into workspace root run: | @@ -38,8 +37,8 @@ jobs: - name: Build Windows Installer run: | iscc cli\setup.iss /Ooutput - + - name: Upload Windows Installer to Release uses: softprops/action-gh-release@v2 with: - files: cli-windows-x86_64-setup.exe + files: cli-windows-x86_64-setup.exe \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1fd1b396..023c8e4c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,8 +91,7 @@ jobs: - name: Build Projects run: | rustup target add x86_64-pc-windows-gnu - cargo build --release --all --all-features --target x86_64-unknown-linux-gnu - cargo build --release --all --all-features --target x86_64-pc-windows-gnu + cargo build --release --all --all-features --target x86_64-unknown-linux-gnu --target x86_64-pc-windows-gnu env: CURRENT_COMMIT: ${{ steps.vars.outputs.sha_short }} CURRENT_BUILD: ${{ github.run_number }} diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 52d02b38..aca7a163 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -11,6 +11,7 @@ common = { path = "../common" } crossterm = { version = "0.28.1", features = ["event-stream"] } ratatui = { version = "0.29.0", features = ["unstable-rendered-line-info"] } tui-textarea = "0.7.0" +ansi-parser = "0.9.1" ansi-to-tui = "7.0.0" # File management diff --git a/cli/src/application/window/connect/tab/server/screen.rs b/cli/src/application/window/connect/tab/server/screen.rs index 36e69ad0..fb60b7e9 100644 --- a/cli/src/application/window/connect/tab/server/screen.rs +++ b/cli/src/application/window/connect/tab/server/screen.rs @@ -1,8 +1,8 @@ use std::{ - fmt::{Display, Formatter}, - sync::Arc, + fmt::{Display, Formatter}, sync::Arc }; +use ansi_parser::{AnsiParser, AnsiSequence, Output}; use ansi_to_tui::IntoText; use color_eyre::eyre::Result; use crossterm::event::{Event, KeyCode, KeyEventKind}; @@ -130,7 +130,7 @@ impl Window for ScreenTab { if line.is_empty() { continue; } - if let Ok(text) = line.into_text() { + if let Ok(text) = clean_ansi(&line).into_text() { for line in text { self.lines.push(line); } @@ -304,3 +304,20 @@ impl Display for common_server::Short { write!(formatter, "{}", self.name) } } + +fn is_allowed_escape(sequence: &AnsiSequence) -> bool { + match sequence { + AnsiSequence::SetGraphicsMode(_) => true, + _ => false, + } +} + +fn clean_ansi(input: &str) -> String { + input.ansi_parse() + .filter_map(|item| match item { + Output::TextBlock(text) => Some(text.to_string()), + Output::Escape(sequence) if is_allowed_escape(&sequence) => Some(sequence.to_string()), + _ => None, + }) + .collect() +} \ No newline at end of file diff --git a/clients/java/paper/src/main/java/io/atomic/cloud/paper/transfer/TransferHandler.java b/clients/java/paper/src/main/java/io/atomic/cloud/paper/transfer/TransferHandler.java index 29d791a3..8b716ed3 100644 --- a/clients/java/paper/src/main/java/io/atomic/cloud/paper/transfer/TransferHandler.java +++ b/clients/java/paper/src/main/java/io/atomic/cloud/paper/transfer/TransferHandler.java @@ -7,6 +7,7 @@ import io.grpc.stub.StreamObserver; import java.util.UUID; import lombok.RequiredArgsConstructor; +import org.jetbrains.annotations.NotNull; @RequiredArgsConstructor public class TransferHandler implements StreamObserver { @@ -47,7 +48,10 @@ public void onNext(Transfer.TransferRes resolvedTransfer) { } @Override - public void onError(Throwable throwable) { + public void onError(@NotNull Throwable throwable) { + if (throwable.getMessage().contains("CANCELLED")) { + return; + } CloudPlugin.LOGGER.error("Failed to handle transfer request", throwable); } diff --git a/plugins/cloudflare/Cargo.toml b/plugins/cloudflare/Cargo.toml index 6da43619..75955e8c 100644 --- a/plugins/cloudflare/Cargo.toml +++ b/plugins/cloudflare/Cargo.toml @@ -22,13 +22,11 @@ getset = "0.1.5" # Configuration serde = { version = "1.0.219", features = ["derive"] } toml = "0.8.22" -walkdir = "2.5.0" # Servers regex = "1.11.1" # Cloudflare API -url = { version = "2.5.4", features = ["serde"] } serde_json = "1.0.140" [build-dependencies] diff --git a/plugins/cloudflare/src/plugin/dns/manager.rs b/plugins/cloudflare/src/plugin/dns/manager.rs index 0b45d89a..0c6612c4 100644 --- a/plugins/cloudflare/src/plugin/dns/manager.rs +++ b/plugins/cloudflare/src/plugin/dns/manager.rs @@ -33,6 +33,9 @@ impl Records { pub fn new(config: &Config) -> Self { let mut zones: HashMap = HashMap::new(); for entry in &config.entries { + if entry.zone.is_empty() { + continue; + } zones .entry(entry.zone.clone()) .or_default() @@ -40,7 +43,7 @@ impl Records { .entry(entry.clone()) .or_default(); } - info!("Found {} unique zones", zones.len()); + info!("Found {} unique zone(s)", zones.len()); Self { zones } }