Commit graph

6 commits

Author SHA1 Message Date
5ccf81173f feat(checker): add domain availability watchlist
Introduce a DomainAvailabilityWatch entity (model, storage, usecase and
REST endpoints) letting a user track a domain they do not own and get
notified the moment it becomes available for registration. A dedicated
domain_availability checker reads WHOIS/RDAP via pkg/domaininfo and inverts
the status (OK while registered, Crit once free) so the existing dispatcher
fires exactly once on the transition. The scheduler enumerates watches and
enqueues the check, carrying the watch id in CheckTarget.DomainId; autofill
and notification payloads fall back to the watch store to resolve the name.
Watches are included in per-user backup/restore. The web UI adds an
availability watchlist page and navigation entry.
2026-06-06 20:14:01 +09:00
efb4659346 notification: add storage interfaces and KV implementations 2026-04-30 14:05:01 +00:00
b424ac1234 storage: add FindDomainsByName lookup across all users
Adds an unauthenticated domain lookup by FQDN, needed by the upcoming
public email auto-configuration HTTP responders which must serve any
domain hosted by happyDomain regardless of the requesting client.
2026-04-29 18:51:51 +07:00
b7da1f5e23 checkers: add storage for discovery entries and observation lineage
Introduce the two KV indexes that back the cross-checker discovery
mechanism described in docs/checker-discovery.md:

  dscent|{producer}|{target}|{type}|{ref}         primary record
  dscent-tgt|{target}|{producer}|{type}|{ref}     target lookup (auto-fill)
  dscobs|{producer}|{target}|{ref}|{consumer}|{k} observation lineage
  dscobs-snap|{snapshotId}|...                     cascade on snapshot delete

ReplaceDiscoveryEntries is the canonical publication path: the whole
set previously stored for (producer, target) is cleared, then the new
set is written. The observation-lineage side uses a single upsert per
(producer, target, ref, consumer, key) tuple, with a snapshot-scoped
reverse index so deleting a snapshot cascades cleanly. Putting a ref
under a new snapshot removes the previous snap-index so a later
cascade on the old snapshot does not wipe the refreshed primary.

Adds StoredDiscoveryEntry and DiscoveryObservationRef to the host-only
model, DiscoveryEntryStorage / DiscoveryObservationStorage to the
checker usecase storage surface, embeds both in storage.Storage, and
regenerates the instrumented wrapper. Unit tests cover round-trip,
atomic replace, multi-producer aggregation, upsert, and cascade
delete.

No pipeline wiring yet.
2026-04-28 13:06:23 +07:00
fa7700355a backup: include core checker entities in backup/restore
All checks were successful
continuous-integration/drone/push Build is passing
Extend the admin backup to cover checker configurations, plans,
evaluations and executions — previously these were stored but silently
lost on restore. Add RestoreX storage methods so primary records keep
their original Id and secondary indexes are rebuilt (Create* generates
new IDs, Update* requires an existing record to clean stale indexes).
2026-04-22 12:45:45 +07:00
b7beefed3f Add Prometheus metrics package with HTTP middleware and storage instrumentation
- internal/metrics/metrics.go: defines all metric variables (http, scheduler,
  provider, storage, build info) using promauto for zero-config registration
- internal/metrics/http.go: Gin middleware recording request count, duration,
  and in-flight gauge using c.FullPath() to avoid high-cardinality labels
- internal/app/instrumented_storage.go: InstrumentedStorage wrapper implementing
  storage.Storage, recording operation counts and durations for all entities
2026-04-16 17:02:31 +07:00