Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
1 change: 1 addition & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 20 additions & 3 deletions cli/src/application/window/connect/tab/server/screen.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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()
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<Transfer.TransferRes> {
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 0 additions & 2 deletions plugins/cloudflare/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 4 additions & 1 deletion plugins/cloudflare/src/plugin/dns/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,17 @@ impl Records {
pub fn new(config: &Config) -> Self {
let mut zones: HashMap<String, Zone> = HashMap::new();
for entry in &config.entries {
if entry.zone.is_empty() {
continue;
}
zones
.entry(entry.zone.clone())
.or_default()
.records
.entry(entry.clone())
.or_default();
}
info!("Found {} unique zones", zones.len());
info!("Found {} unique zone(s)", zones.len());
Self { zones }
}

Expand Down