Compare commits

...
Author SHA1 Message Date
Ian Graham Martinez 0ba2e23032 List the screened hosts from the config
Building a Firewall needs a runtime, which an installer has no use for.
2026-10-13 10:51:44 -04:00
2 changed files with 13 additions and 8 deletions

No files matched your search

+12
View File
@@ -80,6 +80,18 @@ impl FirewallConfig {
pub fn local_url(&self, path: &str) -> String {
crate::local_url(self.port, path)
}
/// Without building a `Firewall`, which needs a runtime.
pub fn hosts(&self) -> Vec<&'static str> {
let mut hosts: Vec<&'static str> = Vec::new();
for registry in &self.registries {
let host = registry.host();
if !hosts.contains(&host) {
hosts.push(host);
}
}
hosts
}
}
pub fn path() -> Option<PathBuf> {
+1 -8
View File
@@ -40,14 +40,7 @@ impl Firewall {
}
pub fn hosts(&self) -> Vec<&'static str> {
let mut hosts: Vec<&'static str> = Vec::new();
for registry in &self.config.registries {
let host = registry.host();
if !hosts.contains(&host) {
hosts.push(host);
}
}
hosts
self.config.hosts()
}
pub fn is_index_url(&self, url: &str) -> bool {