mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 10:10:30 +08:00
httpd: Filter-out private-but-pinned repos
They should only be visible to localhost.
This commit is contained in:
@@ -100,7 +100,14 @@ async fn project_root_handler(
|
||||
Visibility::Public => true,
|
||||
})
|
||||
.collect::<Vec<_>>(),
|
||||
ProjectQuery::Pinned => storage.repositories_by_id(pinned.repositories.iter())?,
|
||||
ProjectQuery::Pinned => storage
|
||||
.repositories_by_id(pinned.repositories.iter())?
|
||||
.into_iter()
|
||||
.filter(|repo| match &repo.doc.visibility {
|
||||
Visibility::Private { .. } => addr.ip().is_loopback(),
|
||||
Visibility::Public => true,
|
||||
})
|
||||
.collect::<Vec<_>>(),
|
||||
};
|
||||
projects.sort_by_key(|p| p.rid);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user