Phase 14, part 1: plans, each team's account, and their limits

The multi-tenant edition's plans (Free and Paid as decided, or a plans
file) and each team's billing account, with a 14-day trial of Paid. A
team's plan caps what its people and agents may change: modules outside it
stay readable, a lapsed team changes nothing, and agents, Market entries,
crawls and background jobs keep to it. Without a Stripe key, no billing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 13:15:00 -07:00
co-authored by Claude Opus 5.5
parent e47764a78e
commit a47990f9bf
19 changed files with 848 additions and 7 deletions
+5 -2
View File
@@ -617,7 +617,9 @@ func (s *Server) startAudit(site seoSite, speed bool) {
defer release()
ctx, cancel := context.WithTimeout(lctx, 45*time.Minute)
defer cancel()
a, err := seo.RunAudit(ctx, s.DB, seo.NewFetcher("Supermarket/"+s.Version+" (SEO audit)"), site.URL, site.Property)
f := seo.NewFetcher("Supermarket/" + s.Version + " (SEO audit)")
f.MaxPages, _ = s.crawlLimits()
a, err := seo.RunAudit(ctx, s.DB, f, site.URL, site.Property)
if err == nil && speed {
for _, p := range busiest(a, 5) {
a.Speed = append(a.Speed, seo.CheckSpeed(ctx, p, s.Secrets.Get(secrets.PageSpeedAPIKey)))
@@ -682,8 +684,9 @@ func (s *Server) seoAuditStatus(w http.ResponseWriter, r *http.Request) {
// weeklyAudits audits each website once a week.
func (s *Server) weeklyAudits(now time.Time) {
_, every := s.crawlLimits()
for _, site := range s.seoSites() {
if site.URL != "" && now.Sub(seo.LastDoneAudit(s.DB, site.URL)) > 7*24*time.Hour {
if site.URL != "" && now.Sub(seo.LastDoneAudit(s.DB, site.URL)) > every {
if a, _ := seo.LatestAudit(s.DB, site.URL); a != nil && a.Status == "failed" && now.Sub(a.StartedAt) < 24*time.Hour {
continue // don't retry a failing site more than daily
}