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
+9 -1
View File
@@ -106,6 +106,7 @@ type Fetcher struct {
Client *http.Client
UserAgent string
Delay time.Duration // between requests, to be polite
MaxPages int // pages an audit reads; 0: MaxAuditPages
}
// NewFetcher returns a fetcher that doesn't follow redirects itself, so
@@ -239,7 +240,7 @@ func RunAudit(ctx context.Context, d *db.DB, f *Fetcher, siteURL, property strin
seen := map[string]bool{queue[0]: true}
add := func(u string) {
n := normalize(u)
if n == "" || seen[n] || len(seen) >= MaxAuditPages {
if n == "" || seen[n] || len(seen) >= f.maxPages() {
return
}
if p, err := url.Parse(n); err != nil || strings.TrimPrefix(p.Hostname(), "www.") != host {
@@ -801,3 +802,10 @@ func LastDoneAudit(d *db.DB, site string) time.Time {
t, _ := time.Parse(time.RFC3339, s.String)
return t
}
func (f *Fetcher) maxPages() int {
if f.MaxPages > 0 {
return f.MaxPages
}
return MaxAuditPages
}