mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-06 17:59:11 +00:00
Added RPC portal whitelist function, allowing only local access by default to enhance security (#929)
This commit is contained in:
@@ -527,6 +527,20 @@ impl NetworkConfig {
|
||||
.with_context(|| format!("failed to parse rpc portal port: {:?}", self.rpc_port))?,
|
||||
);
|
||||
|
||||
if self.rpc_portal_whitelists.is_empty() {
|
||||
cfg.set_rpc_portal_whitelist(None);
|
||||
} else {
|
||||
cfg.set_rpc_portal_whitelist(Some(
|
||||
self.rpc_portal_whitelists
|
||||
.iter()
|
||||
.map(|s| {
|
||||
s.parse()
|
||||
.with_context(|| format!("failed to parse rpc portal whitelist: {}", s))
|
||||
})
|
||||
.collect::<Result<Vec<_>, _>>()?,
|
||||
));
|
||||
}
|
||||
|
||||
if self.enable_vpn_portal.unwrap_or_default() {
|
||||
let cidr = format!(
|
||||
"{}/{}",
|
||||
|
||||
Reference in New Issue
Block a user