Files
Easytier/easytier-core/src/management/full/compiled.rs
T
KKRainbow 3fe427bc99 feat(credentials): manage declarative credentials through TOML (#2515)
* feat(credentials): manage declarative credentials through TOML

Make managed credentials part of the canonical TOML configuration and
load them before peers can authenticate.

Reuse ConfigRpc hot patches to durably replace the configured credential
set without restarting the instance. Serialize credential mutations so
base, managed, and ephemeral keys cannot race into conflicts.

Remove the managed overlay file format, digest protocol, capability
negotiation, force reconciliation, and database CAS machinery. Redact
credential secrets from debug output and management events. Write
credential-bearing files atomically with private permissions.

* fix(core): release JoinSet reapers with their owners

Pass weak task-set references into background reapers so they cannot
retain the JoinSet they are meant to collect. This lets stale smoltcp
bridge tasks terminate when an IPv4 generation is replaced.

Add ownership and TCP generation-replacement regressions covering the
production port-forward failure.
2026-08-22 16:30:51 +08:00

48 lines
1.8 KiB
Rust

use std::sync::Arc;
use easytier_proto::{
api::{
config::ConfigRpcServer,
instance::{
AclManageRpcServer, ConnectorManageRpcServer, CredentialManageRpcServer,
MappedListenerManageRpcServer, PeerManageRpcServer, PortForwardManageRpcServer,
StatsRpcServer, VpnPortalRpcServer,
},
},
peer_rpc::PeerCenterRpcServer,
};
use super::super::instance_rpc::InstanceManagementRpc;
use super::ConfigFileStorage;
use crate::{
instance::{
CoreInstance, CoreInstanceHost,
manager::{InstanceFactory, InstanceManager},
},
rpc::service_registry::ServiceRegistry,
};
/// Registers each Instance-targeted management protocol Interface once for
/// the complete process-level Instance collection.
pub fn register_instance_management_rpc<F, H>(
manager: Arc<InstanceManager<F>>,
registry: &ServiceRegistry,
storage: Arc<dyn ConfigFileStorage>,
) where
F: InstanceFactory<Instance = CoreInstance<H>>,
H: CoreInstanceHost,
{
let rpc = InstanceManagementRpc::<F>::new_with_config_storage(manager.clone(), storage);
registry.register(PeerManageRpcServer::new(rpc.clone()), "");
registry.register(ConnectorManageRpcServer::new(rpc.clone()), "");
registry.register(MappedListenerManageRpcServer::new(rpc.clone()), "");
registry.register(VpnPortalRpcServer::new(rpc.clone()), "");
super::packet_proxy::register(manager.clone(), registry);
registry.register(AclManageRpcServer::new(rpc.clone()), "");
registry.register(PortForwardManageRpcServer::new(rpc.clone()), "");
registry.register(StatsRpcServer::new(rpc.clone()), "");
registry.register(ConfigRpcServer::new(rpc.clone()), "");
registry.register(CredentialManageRpcServer::new(rpc.clone()), "");
registry.register(PeerCenterRpcServer::new(rpc), "");
}