httpd: Filter-out private-but-pinned repos
They should only be visible to localhost.
This commit is contained in:
parent
9767b485c2
commit
0908c65f50
|
|
@ -100,7 +100,14 @@ async fn project_root_handler(
|
||||||
Visibility::Public => true,
|
Visibility::Public => true,
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>(),
|
.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);
|
projects.sort_by_key(|p| p.rid);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue