From e02c8dd138c61f730cb6711e2b5e361aaf4c90ae Mon Sep 17 00:00:00 2001 From: miyuko Date: Mon, 27 Jul 2026 18:57:02 +0100 Subject: [PATCH] Group domains belonging to the same owner when analyzing storage. Resolves: https://codeberg.org/git-pages/git-pages/issues/239 --- src/analysis.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/analysis.go b/src/analysis.go index 5ed82e3..19082d7 100644 --- a/src/analysis.go +++ b/src/analysis.go @@ -4,6 +4,8 @@ import ( "context" "fmt" "strings" + + "golang.org/x/net/publicsuffix" ) type StorageSize struct { @@ -30,6 +32,10 @@ func AnalyzeStorage(ctx context.Context) ([]*StorageSize, error) { thinStats := []*StorageSize{} getStats := func(domain string) *storageData { + eTLDPlusOne, err := publicsuffix.EffectiveTLDPlusOne(domain) + if err == nil { + domain = eTLDPlusOne + } if _, found := thickStats[domain]; !found { thickStats[domain] = &storageData{ siteBlobs: map[string]int64{},