mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 01:40:21 +08:00
refactor: 拆分 gateway 单体为独立 crate,新增 systemd 部署方案
将 gateway 内部的 model-fetch、provider-transport、scheduler-core、 usage-runtime、video-tasks-core 模块提取为独立 crate;重构 gateway 内部模块结构(state/router/cache/data/query 等);移除大量遗留模块 文件;新增 systemd 二进制部署骨架及相关文档;更新前端 usage 相关 API 和组件。
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use crate::gateway::{AppState, LocalProviderDeleteTaskState};
|
||||
use crate::{AppState, LocalProviderDeleteTaskState};
|
||||
use serde_json::json;
|
||||
|
||||
pub(crate) fn admin_provider_id_for_keys(request_path: &str) -> Option<String> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::gateway::handlers::{json_string_list, unix_secs_to_rfc3339};
|
||||
use crate::gateway::AppState;
|
||||
use crate::handlers::{json_string_list, unix_secs_to_rfc3339};
|
||||
use crate::AppState;
|
||||
#[cfg(test)]
|
||||
use aether_crypto::DEVELOPMENT_ENCRYPTION_KEY;
|
||||
use aether_crypto::{decrypt_python_fernet_ciphertext, encrypt_python_fernet_plaintext};
|
||||
|
||||
@@ -190,7 +190,7 @@ pub(crate) struct InternalGatewayExecuteRequest {
|
||||
#[serde(default)]
|
||||
pub(crate) body_base64: Option<String>,
|
||||
#[serde(default)]
|
||||
pub(crate) auth_context: Option<crate::gateway::GatewayControlAuthContext>,
|
||||
pub(crate) auth_context: Option<crate::control::GatewayControlAuthContext>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
use crate::gateway::constants::{
|
||||
use crate::constants::{
|
||||
CONTROL_EXECUTE_FALLBACK_HEADER, TRUSTED_ADMIN_MANAGEMENT_TOKEN_ID_HEADER,
|
||||
TRUSTED_ADMIN_SESSION_ID_HEADER, TRUSTED_ADMIN_USER_ID_HEADER, TRUSTED_ADMIN_USER_ROLE_HEADER,
|
||||
};
|
||||
use crate::gateway::handlers::OFFICIAL_EXTERNAL_MODEL_PROVIDERS;
|
||||
use crate::gateway::headers::header_value_str;
|
||||
use crate::gateway::{GatewayControlDecision, GatewayPublicRequestContext};
|
||||
use crate::control::GatewayControlDecision;
|
||||
use crate::control::GatewayPublicRequestContext;
|
||||
use crate::handlers::OFFICIAL_EXTERNAL_MODEL_PROVIDERS;
|
||||
use crate::headers::header_value_str;
|
||||
use crate::tunnel::TUNNEL_ROUTE_FAMILY;
|
||||
use axum::http::{self, HeaderName};
|
||||
use chrono::{SecondsFormat, Utc};
|
||||
use url::form_urlencoded;
|
||||
@@ -347,25 +349,23 @@ pub(crate) fn internal_proxy_local_requires_buffered_body(
|
||||
decision.route_family.as_deref(),
|
||||
decision.route_kind.as_deref()
|
||||
),
|
||||
(
|
||||
Some(crate::gateway::TUNNEL_ROUTE_FAMILY),
|
||||
Some("heartbeat" | "node_status")
|
||||
) | (
|
||||
Some("internal_gateway"),
|
||||
Some(
|
||||
"resolve"
|
||||
| "auth_context"
|
||||
| "decision_sync"
|
||||
| "decision_stream"
|
||||
| "execute_sync"
|
||||
| "execute_stream"
|
||||
| "plan_sync"
|
||||
| "plan_stream"
|
||||
| "report_sync"
|
||||
| "report_stream"
|
||||
| "finalize_sync"
|
||||
(Some(TUNNEL_ROUTE_FAMILY), Some("heartbeat" | "node_status"))
|
||||
| (
|
||||
Some("internal_gateway"),
|
||||
Some(
|
||||
"resolve"
|
||||
| "auth_context"
|
||||
| "decision_sync"
|
||||
| "decision_stream"
|
||||
| "execute_sync"
|
||||
| "execute_stream"
|
||||
| "plan_sync"
|
||||
| "plan_stream"
|
||||
| "report_sync"
|
||||
| "report_stream"
|
||||
| "finalize_sync"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user