From 17adc9eb5e79825b26a9d02cc2d21e9e4eb7a5a0 Mon Sep 17 00:00:00 2001 From: HttpRafa <60099368+HttpRafa@users.noreply.github.com> Date: Tue, 6 May 2025 08:05:23 +0200 Subject: [PATCH 1/5] fix: Make release action faster --- .github/workflows/release.yml | 3 +-- plugins/cloudflare/Cargo.toml | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) 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/plugins/cloudflare/Cargo.toml b/plugins/cloudflare/Cargo.toml index 6da43619..2e39ea8b 100644 --- a/plugins/cloudflare/Cargo.toml +++ b/plugins/cloudflare/Cargo.toml @@ -16,19 +16,14 @@ wit-bindgen = "0.41.0" # Error handling anyhow = "1.0.98" -# Getters -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] From ecb5f09109fef762861a79e0b90d45623d125045 Mon Sep 17 00:00:00 2001 From: HttpRafa <60099368+HttpRafa@users.noreply.github.com> Date: Wed, 7 May 2025 13:54:02 +0200 Subject: [PATCH 2/5] fix: Minecraft logs breaking CLI in screens --- cli/Cargo.toml | 1 + .../window/connect/tab/server/screen.rs | 23 ++++++++++++++++--- plugins/cloudflare/Cargo.toml | 3 +++ 3 files changed, 24 insertions(+), 3 deletions(-) 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/plugins/cloudflare/Cargo.toml b/plugins/cloudflare/Cargo.toml index 2e39ea8b..75955e8c 100644 --- a/plugins/cloudflare/Cargo.toml +++ b/plugins/cloudflare/Cargo.toml @@ -16,6 +16,9 @@ wit-bindgen = "0.41.0" # Error handling anyhow = "1.0.98" +# Getters +getset = "0.1.5" + # Configuration serde = { version = "1.0.219", features = ["derive"] } toml = "0.8.22" From 47d24d79f00d134f22a0b421588324547647a600 Mon Sep 17 00:00:00 2001 From: HttpRafa <60099368+HttpRafa@users.noreply.github.com> Date: Wed, 7 May 2025 14:07:09 +0200 Subject: [PATCH 3/5] fix: Fix cancel exception on shutdown --- .../io/atomic/cloud/paper/transfer/TransferHandler.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); } From 11329b2d242629479ab6b63433e9814048903c92 Mon Sep 17 00:00:00 2001 From: HttpRafa <60099368+HttpRafa@users.noreply.github.com> Date: Wed, 7 May 2025 14:14:39 +0200 Subject: [PATCH 4/5] fix: Stop cloudflare plugin from loading empty zones --- plugins/cloudflare/src/plugin/dns/manager.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 } } From 6fd30d4d62103c2f88104d8928d3beb8bc3b0939 Mon Sep 17 00:00:00 2001 From: HttpRafa <60099368+HttpRafa@users.noreply.github.com> Date: Wed, 7 May 2025 14:30:23 +0200 Subject: [PATCH 5/5] fix: Windows installer --- .github/workflows/installer.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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