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:
11
apps/nxmesh-master/src/db/mod.rs
Normal file
11
apps/nxmesh-master/src/db/mod.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use sea_orm::{Database, DatabaseConnection};
|
||||
|
||||
pub mod entities;
|
||||
|
||||
pub(crate) async fn establish_connection(
|
||||
url: &str,
|
||||
) -> Result<DatabaseConnection, Box<dyn std::error::Error + Send + Sync>> {
|
||||
Database::connect(url)
|
||||
.await
|
||||
.map_err(|e| format!("Failed to connect to database: {}", e).into())
|
||||
}
|
||||
Reference in New Issue
Block a user