Skip to content

Commit ac5087e

Browse files
authored
🐛 fix wrong icon path for cargo bundle (#26)
1 parent ef13a6b commit ac5087e

File tree

9 files changed

+29
-30
lines changed

9 files changed

+29
-30
lines changed

crates/desktop/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ osx_url_schemes = ["org.xdsec.wsrx"]
6666
short_description = "Controlled TCP-over-WebSocket forwarding tunnel."
6767

6868
icon = [
69-
"arts/logo.png",
70-
"macos/WebSocketReflectorX.icns",
71-
"windows/WebSocketReflectorX.ico",
69+
"../../arts/logo.png",
70+
"../../macos/WebSocketReflectorX.icns",
71+
"../../windows/WebSocketReflectorX.ico",
7272
]

crates/desktop/src/daemon/api_controller.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@ use tower_http::{
1818
use tracing::{Span, debug};
1919
use wsrx::utils::create_tcp_listener;
2020

21+
use super::latency_worker::update_instance_latency;
2122
use crate::{
2223
bridges::ui_state::sync_scoped_instance,
2324
daemon::model::{FeatureFlags, InstanceData, ProxyInstance, ScopeData, ServerState},
2425
ui::{Instance, InstanceBridge, Scope, ScopeBridge},
2526
};
2627

27-
use super::latency_worker::update_instance_latency;
28-
2928
pub fn router(state: ServerState) -> axum::Router {
3029
let cors_state = state.clone();
3130
let cors_layer = CorsLayer::new()
@@ -168,9 +167,7 @@ async fn launch_instance(
168167
if instances.iter().any(|i| i.local.as_str() == local) {
169168
return Err((
170169
StatusCode::BAD_REQUEST,
171-
format!(
172-
"The local address {local} is already taken by another instance"
173-
),
170+
format!("The local address {local} is already taken by another instance"),
174171
));
175172
}
176173

crates/desktop/src/daemon/latency_worker.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ async fn pingfall(state: ServerState, instance: InstanceData) {
109109
.find(|scope| scope.host == instance.scope_host.as_str());
110110

111111
if let Some(scope) = scope
112-
&& scope.features.contains(FeatureFlags::PingFall) {
113-
on_instance_del(&state, &instance.local).await;
114-
}
112+
&& scope.features.contains(FeatureFlags::PingFall)
113+
{
114+
on_instance_del(&state, &instance.local).await;
115+
}
115116
}

crates/desktop/src/daemon/ui_controller.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
use slint::{ComponentHandle, Model, ToSharedString, VecModel};
2+
use tracing::{debug, info, warn};
3+
use wsrx::utils::create_tcp_listener;
4+
5+
use super::latency_worker::update_instance_latency;
16
use crate::{
27
bridges::ui_state::sync_scoped_instance,
38
daemon::{
@@ -6,11 +11,6 @@ use crate::{
611
},
712
ui::{Instance, InstanceBridge, MainWindow, Scope, ScopeBridge},
813
};
9-
use slint::{ComponentHandle, Model, ToSharedString, VecModel};
10-
use tracing::{debug, info, warn};
11-
use wsrx::utils::create_tcp_listener;
12-
13-
use super::latency_worker::update_instance_latency;
1414

1515
pub async fn on_instance_add(state: &ServerState, remote: &str, local: &str) {
1616
let listener = match create_tcp_listener(local).await {

crates/wsrx/src/cli/daemon.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,10 @@ fn build_router(secret: Option<String>) -> axum::Router {
149149
|State(secret): State<Option<String>>, req: ExtractRequest, next: Next| async move {
150150
if let Some(secret) = secret {
151151
if let Some(auth) = req.headers().get("authorization")
152-
&& auth.to_str().map_err(|_| StatusCode::UNAUTHORIZED)? == secret {
153-
return Ok(next.run(req).await);
154-
}
152+
&& auth.to_str().map_err(|_| StatusCode::UNAUTHORIZED)? == secret
153+
{
154+
return Ok(next.run(req).await);
155+
}
155156
return Err(StatusCode::UNAUTHORIZED);
156157
}
157158
Ok(next.run(req).await)

crates/wsrx/src/cli/serve.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ fn build_router(secret: Option<String>) -> axum::Router {
7272
|State(secret): State<Option<String>>, req: ExtractRequest, next: Next| async move {
7373
if let Some(secret) = secret {
7474
if let Some(auth) = req.headers().get("authorization")
75-
&& auth.to_str().map_err(|_| StatusCode::UNAUTHORIZED)? == secret {
76-
return Ok(next.run(req).await);
77-
}
75+
&& auth.to_str().map_err(|_| StatusCode::UNAUTHORIZED)? == secret
76+
{
77+
return Ok(next.run(req).await);
78+
}
7879
return Err(StatusCode::UNAUTHORIZED);
7980
}
8081
Ok(next.run(req).await)

crates/wsrx/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ pub mod utils;
1111
#[cfg(feature = "client")]
1212
pub mod tunnel;
1313

14-
pub use proxy::{proxy, Error, Message, WrappedWsStream};
14+
pub use proxy::{Error, Message, WrappedWsStream, proxy};

crates/wsrx/src/tunnel.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ pub struct TunnelConfig {
1818

1919
/// A tunnel that proxies TCP connections to a remote WebSocket server.
2020
///
21-
/// This struct is responsible for creating a TCP listener and accepting incoming
22-
/// connections. It will then establish a WebSocket connection to the remote
23-
/// server and proxy the data between the TCP connection and the WebSocket
24-
/// connection.
21+
/// This struct is responsible for creating a TCP listener and accepting
22+
/// incoming connections. It will then establish a WebSocket connection to the
23+
/// remote server and proxy the data between the TCP connection and the
24+
/// WebSocket connection.
2525
#[derive(Debug)]
2626
pub struct Tunnel {
2727
config: TunnelConfig,

crates/wsrx/src/utils.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@ use std::net::ToSocketAddrs;
22

33
use axum::http::StatusCode;
44
use tokio::net::TcpListener;
5-
65
#[cfg(feature = "log")]
76
use tracing::error;
87

9-
108
/// Creates a TCP listener on the specified local address.
119
///
1210
/// @param local The local address to bind the TCP listener to.
1311
///
14-
/// @returns A `Result` containing the `TcpListener` if successful, or an error tuple
12+
/// @returns A `Result` containing the `TcpListener` if successful,
13+
/// or an error tuple
1514
pub async fn create_tcp_listener(local: &str) -> Result<TcpListener, (StatusCode, String)> {
1615
let mut tcp_addr_obj = local.to_socket_addrs().map_err(|err| {
1716
#[cfg(feature = "log")]

0 commit comments

Comments
 (0)