OverviewFilesCommitsIssuesDocsReleasesPeers

pear-git commits / dc7f0da

Hide private repos from frontpage SSR and git clone access
Filter private repos in home page renderer (SSR HTML) and repo list API. Private repos only visible to authenticated admins. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dc7f0da31c8ad28ec94b6d304266a72e17381040
by plankatron <fleeky@gmail.com> · 2026-04-07T04:31:05.000Z

Changed files (1) +8 -1

lib/routes/home.js +8 -1
……@@ -108,8 +108,15 @@ async function serveHome(req, res, server) {
108108 // Compute activity graphs (cached, non-blocking)
109109 const activity = await getActivityData(repoRegistry.gitReposPath, repos).catch(() => ({}))
110110
111 // Filter private repos for non-admin users
112 const isAdmin = req.user && req.user.globalPermissions && req.user.globalPermissions.admin
113 const visibleRepos = repos.filter(r => {
114 if (r.visibility === 'private' && !isAdmin) return false
115 return true
116 })
117
111118 // Attach activity data to repos
112 const reposWithActivity = repos.map(r => ({
119 const reposWithActivity = visibleRepos.map(r => ({
113120 ...r,
114121 activity: activity[r.name] || null
115122 }))