Fix DNS Prober real RTT logic, fix Flutter DNS proxy UI, fix ServerInbound struct tags and migrator

This commit is contained in:
ospab 2026-06-19 15:18:41 +03:00
parent 0394971791
commit 8820a42359
6 changed files with 13 additions and 8 deletions

View File

@ -12,7 +12,7 @@ resolver = "2"
[workspace.package] [workspace.package]
edition = "2021" edition = "2021"
license = "BSL 1.1" license = "BSL 1.1"
version = "0.3.8" version = "0.3.9"
[workspace.dependencies] [workspace.dependencies]
anyhow = "1.0" anyhow = "1.0"

View File

@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 0.3.8+21 version: 0.3.9+22
environment: environment:
sdk: ^3.11.4 sdk: ^3.11.4

View File

@ -2665,7 +2665,7 @@ dependencies = [
[[package]] [[package]]
name = "ostp-client" name = "ostp-client"
version = "0.3.8" version = "0.3.9"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"base64 0.22.1", "base64 0.22.1",
@ -2700,7 +2700,7 @@ dependencies = [
[[package]] [[package]]
name = "ostp-core" name = "ostp-core"
version = "0.3.8" version = "0.3.9"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"byteorder", "byteorder",
@ -2742,7 +2742,7 @@ dependencies = [
[[package]] [[package]]
name = "ostp-tun" name = "ostp-tun"
version = "0.3.8" version = "0.3.9"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"libc", "libc",

View File

@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "ostp-gui", "productName": "ostp-gui",
"version": "0.3.8", "version": "0.3.9",
"identifier": "com.ospab.ostp", "identifier": "com.ospab.ostp",
"build": { "build": {
"frontendDist": "../src" "frontendDist": "../src"

View File

@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
use crate::{api::ApiConfig, fallback::FallbackConfig, outbound::OutboundConfig, dns::DnsConfig}; use crate::{api::ApiConfig, fallback::FallbackConfig, outbound::OutboundConfig, dns::DnsConfig};
#[derive(Debug, Deserialize, Serialize, Clone)] #[derive(Debug, Deserialize, Serialize, Clone)]
#[serde(tag = "type", rename_all = "snake_case")] #[serde(tag = "protocol", rename_all = "snake_case")]
pub enum ServerInbound { pub enum ServerInbound {
Ostp { Ostp {
tag: String, tag: String,
@ -82,8 +82,9 @@ pub struct TransportConfigRaw {
} }
#[derive(Debug, Deserialize, Serialize, Clone)] #[derive(Debug, Deserialize, Serialize, Clone)]
#[serde(tag = "type", rename_all = "snake_case")] #[serde(tag = "protocol", rename_all = "snake_case")]
pub enum ServerOutbound { pub enum ServerOutbound {
#[serde(rename = "socks5")]
Socks { Socks {
tag: String, tag: String,
server: String, server: String,

View File

@ -1407,6 +1407,7 @@ async fn run_app() -> Result<()> {
{{ {{
// Primary OSTP protocol listener // Primary OSTP protocol listener
"protocol": "ostp", "protocol": "ostp",
"tag": "ostp-in",
"listen": "0.0.0.0", "listen": "0.0.0.0",
"port": 50000, "port": 50000,
"users": [ "users": [
@ -1425,6 +1426,7 @@ async fn run_app() -> Result<()> {
{{ {{
// Web Administration API // Web Administration API
"protocol": "api", "protocol": "api",
"tag": "api-in",
"listen": "127.0.0.1", "listen": "127.0.0.1",
"port": 9090, "port": 9090,
"token": "YOUR_SECRET_TOKEN", "token": "YOUR_SECRET_TOKEN",
@ -1979,6 +1981,7 @@ fn cmd_migrate(config_path: &std::path::Path) -> Result<()> {
let mut ostp_inbound = serde_json::json!({ let mut ostp_inbound = serde_json::json!({
"protocol": "ostp", "protocol": "ostp",
"tag": "ostp-in",
"listen": host, "listen": host,
"port": port, "port": port,
"users": users "users": users
@ -1993,6 +1996,7 @@ fn cmd_migrate(config_path: &std::path::Path) -> Result<()> {
if let Some(api) = raw_json.get("api") { if let Some(api) = raw_json.get("api") {
let mut api_inbound = api.clone(); let mut api_inbound = api.clone();
api_inbound["protocol"] = serde_json::json!("api"); api_inbound["protocol"] = serde_json::json!("api");
api_inbound["tag"] = serde_json::json!("api-in");
let bind = api.get("bind").and_then(|b| b.as_str()).unwrap_or("127.0.0.1:9090"); let bind = api.get("bind").and_then(|b| b.as_str()).unwrap_or("127.0.0.1:9090");
let parts: Vec<&str> = bind.split(':').collect(); let parts: Vec<&str> = bind.split(':').collect();
api_inbound["listen"] = serde_json::json!(parts.get(0).unwrap_or(&"127.0.0.1")); api_inbound["listen"] = serde_json::json!(parts.get(0).unwrap_or(&"127.0.0.1"));