feat(licenses): multi-site keys and domain enforcement #299

Open
opened 2026-05-31 04:28:40 +00:00 by jmiller · 1 comment
Owner

Current

  • DomainRestriction field exists on LicenseKey (CSV)
  • MaxSites field exists on LicenseKey and LicensePackage
  • No enforcement — domain/site limits not checked during validation

Required

  • ValidateLicenseKey checks domain against DomainRestriction if set
  • Track unique domains per key in usage table
  • Reject if unique domains exceed MaxSites
  • Multiple keys per user (already supported — just needs UI clarity)
  • Show domain count in key list

Files

  • models/licenses/license_key.go — ValidateLicenseKey domain check
  • models/licenses/license_key_usage.go — CountUniqueDomains function
  • routers/web/repo/updateserver.go — pass domain from request
  • templates — show domain count

Ref #296


@MokoBot - Claude Opus 4.6

## Current - DomainRestriction field exists on LicenseKey (CSV) - MaxSites field exists on LicenseKey and LicensePackage - No enforcement — domain/site limits not checked during validation ## Required - ValidateLicenseKey checks domain against DomainRestriction if set - Track unique domains per key in usage table - Reject if unique domains exceed MaxSites - Multiple keys per user (already supported — just needs UI clarity) - Show domain count in key list ## Files - models/licenses/license_key.go — ValidateLicenseKey domain check - models/licenses/license_key_usage.go — CountUniqueDomains function - routers/web/repo/updateserver.go — pass domain from request - templates — show domain count Ref #296 --- *@MokoBot - Claude Opus 4.6*
Author
Owner

Enhancement: regex and wildcard support for domain provisioning

The current domain restriction field accepts a comma-separated list of exact domain names. This should be extended to support:

  • Wildcards — e.g. *.example.com to allow all subdomains
  • Regex patterns — for complex matching across TLDs or subdomains

This would cover common scenarios like:

  • Allowing all subdomains of a customer domain (*.acme.com)
  • Matching multiple TLDs (example.com, example.net)
  • Staging/production patterns (*.staging.example.com, *.example.com)

The validation endpoint should evaluate these patterns when checking domain restrictions on license keys.


Authored by Jonathan Miller (@jmiller)

## Enhancement: regex and wildcard support for domain provisioning The current domain restriction field accepts a comma-separated list of exact domain names. This should be extended to support: - **Wildcards** — e.g. `*.example.com` to allow all subdomains - **Regex patterns** — for complex matching across TLDs or subdomains This would cover common scenarios like: - Allowing all subdomains of a customer domain (`*.acme.com`) - Matching multiple TLDs (`example.com`, `example.net`) - Staging/production patterns (`*.staging.example.com`, `*.example.com`) The validation endpoint should evaluate these patterns when checking domain restrictions on license keys. --- *Authored by Jonathan Miller (@jmiller)*
Sign in to join this conversation.