A container registry that uses the AT Protocol for manifest storage and S3 for blob storage. atcr.io
docker container atproto go
72
fork

Configure Feed

Select the types of activity you want to include in your feed.

more style fixes for the og cards

+50 -6
+28
pkg/appview/handlers/opengraph.go
··· 120 120 } 121 121 } 122 122 123 + // DefaultOGHandler generates the default OpenGraph image for the home page 124 + type DefaultOGHandler struct{} 125 + 126 + func (h *DefaultOGHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { 127 + // Generate the OG image 128 + card := ogcard.NewCard() 129 + card.Fill(ogcard.ColorBackground) 130 + 131 + // Draw large centered "ATCR" title 132 + centerY := float64(ogcard.CardHeight) / 2 133 + card.DrawText("ATCR", float64(ogcard.CardWidth)/2, centerY-20, 96.0, ogcard.ColorText, ogcard.AlignCenter, true) 134 + 135 + // Draw tagline below 136 + card.DrawText("Distributed Container Registry", float64(ogcard.CardWidth)/2, centerY+60, ogcard.FontDescription, ogcard.ColorMuted, ogcard.AlignCenter, false) 137 + 138 + // Draw subtitle 139 + card.DrawText("Push and pull Docker images on the AT Protocol", float64(ogcard.CardWidth)/2, centerY+110, ogcard.FontStats, ogcard.ColorMuted, ogcard.AlignCenter, false) 140 + 141 + // Set cache headers and content type (cache longer since it's static content) 142 + w.Header().Set("Content-Type", "image/png") 143 + w.Header().Set("Cache-Control", "public, max-age=86400") 144 + 145 + if err := card.EncodePNG(w); err != nil { 146 + slog.Error("Failed to encode default OG image", "error", err) 147 + http.Error(w, "Failed to generate image", http.StatusInternalServerError) 148 + } 149 + } 150 + 123 151 // UserOGHandler generates OpenGraph images for user profile pages 124 152 type UserOGHandler struct { 125 153 DB *sql.DB
+6 -6
pkg/appview/ogcard/card.go
··· 44 44 // Font sizes 45 45 FontTitle = 48.0 46 46 FontDescription = 32.0 47 - FontStats = 24.0 48 - FontBadge = 20.0 47 + FontStats = 40.0 // Larger for visibility when scaled down 48 + FontBadge = 32.0 // Larger for visibility when scaled down 49 49 FontBranding = 28.0 50 50 51 51 // Spacing 52 52 LineSpacingLarge = 65 // Gap after title 53 53 LineSpacingSmall = 60 // Gap between description lines 54 - StatsIconGap = 30 // Gap between stat icon and text 55 - StatsItemGap = 40 // Gap between stat items 56 - BadgeGap = 15 // Gap between badges 54 + StatsIconGap = 48 // Gap between stat icon and text 55 + StatsItemGap = 60 // Gap between stat items 56 + BadgeGap = 20 // Gap between badges 57 57 ) 58 58 59 59 // Layout holds computed positions for a standard OG card layout ··· 403 403 404 404 // Common colors 405 405 var ( 406 - ColorBackground = color.RGBA{R: 13, G: 17, B: 23, A: 255} // #0d1117 - GitHub dark 406 + ColorBackground = color.RGBA{R: 22, G: 27, B: 34, A: 255} // #161b22 - GitHub dark elevated 407 407 ColorText = color.RGBA{R: 230, G: 237, B: 243, A: 255} // #e6edf3 - Light text 408 408 ColorMuted = color.RGBA{R: 125, G: 133, B: 144, A: 255} // #7d8590 - Muted text 409 409 ColorAccent = color.RGBA{R: 47, G: 129, B: 247, A: 255} // #2f81f7 - Blue accent
+2
pkg/appview/routes/routes.go
··· 142 142 ).ServeHTTP) 143 143 144 144 // OpenGraph image generation (public, cacheable) 145 + router.Get("/og/home", (&uihandlers.DefaultOGHandler{}).ServeHTTP) 146 + 145 147 router.Get("/og/u/{handle}", (&uihandlers.UserOGHandler{ 146 148 DB: deps.ReadOnlyDB, 147 149 }).ServeHTTP)
+14
pkg/appview/templates/pages/home.html
··· 3 3 <html lang="en"> 4 4 <head> 5 5 <title>ATCR - Distributed Container Registry</title> 6 + <!-- Open Graph --> 7 + <meta property="og:title" content="ATCR - Distributed Container Registry"> 8 + <meta property="og:description" content="Push and pull Docker images on the AT Protocol. Same Docker, decentralized."> 9 + <meta property="og:image" content="https://{{ .RegistryURL }}/og/home"> 10 + <meta property="og:image:width" content="1200"> 11 + <meta property="og:image:height" content="630"> 12 + <meta property="og:type" content="website"> 13 + <meta property="og:url" content="https://{{ .RegistryURL }}"> 14 + <meta property="og:site_name" content="ATCR"> 15 + <!-- Twitter Card (used by Discord) --> 16 + <meta name="twitter:card" content="summary_large_image"> 17 + <meta name="twitter:title" content="ATCR - Distributed Container Registry"> 18 + <meta name="twitter:description" content="Push and pull Docker images on the AT Protocol. Same Docker, decentralized."> 19 + <meta name="twitter:image" content="https://{{ .RegistryURL }}/og/home"> 6 20 {{ template "head" . }} 7 21 </head> 8 22 <body>