feat: Implement SSH Agent Connector and gRPC server

- Added `AgentConnectorTrait` and `AgentConnector` for managing agent connections.
- Introduced `SshAgentConnector` to handle SSH-related functionalities and start a gRPC server.
- Created database entities for `agents`, `certificates`, `organizations`, `public_key_revocations`, `setup_tokens`, `upstreams`, `users`, `virtual_hosts`, and `workspaces` using SeaORM.
- Developed `CertificateService` for managing certificate generation and retrieval.
- Implemented the main server logic to initialize the database connection and start the agent server.
- Configured development settings in `development.toml` for server and database connections.
This commit is contained in:
GW_MC
2026-03-21 03:09:39 +00:00
parent 9640f03d69
commit f5eb25993b
27 changed files with 1581 additions and 2 deletions

View File

@@ -0,0 +1,44 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 2.0
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "virtual_hosts")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
pub workspace_id: Uuid,
pub name: String,
pub server_name: String,
pub listen_port: i32,
pub ssl_enabled: bool,
pub ssl_certificate_id: Option<Uuid>,
pub locations: Option<Json>,
pub http2_enabled: bool,
pub http3_enabled: bool,
pub gzip_enabled: bool,
pub target_agents: Option<Json>,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::workspaces::Entity",
from = "Column::WorkspaceId",
to = "super::workspaces::Column::Id",
on_update = "NoAction",
on_delete = "Cascade"
)]
Workspaces,
}
impl Related<super::workspaces::Entity> for Entity {
fn to() -> RelationDef {
Relation::Workspaces.def()
}
}
impl ActiveModelBehavior for ActiveModel {}