Commit graph

127 commits

Author SHA1 Message Date
b5e4094f15 New domain filtering method: domain contains 2026-04-28 18:17:35 +07:00
edbba509bf services: add BIMI service backend
Adds support for Brand Indicators for Message Identification (BIMI),
the emerging standard that lets receiving mail clients display verified
brand logos next to authenticated messages.
2026-04-28 17:58:48 +07:00
af517907d6 Fix OPENPGPKEY/SMIMEA hash to use SHA-256 truncated per RFC 7929/8162
All checks were successful
continuous-integration/drone/push Build is passing
Replace sha256.Sum224 (SHA-224 algorithm) with SHA-256 truncated to 28
bytes, matching what RFCs 7929 and 8162 actually specify and what the
frontend was already computing correctly. Also wrap GetRecords errors
with the service type name for easier diagnosis.
2026-03-30 21:54:54 +07:00
8adc08b4c0 Remove redundant work in ACME and server analyzers 2026-03-28 21:42:17 +07:00
3f2c923754 Fix GenComment showing only NS count instead of SOA details 2026-03-28 21:42:17 +07:00
1523b549d2 fix: propagate UseRR errors consistently across all service analyzers
Several service analyzers were silently discarding errors returned by
a.UseRR(), unlike txt.go and others that properly checked them. This
could mask issues like double-claimed records during zone analysis.
2026-03-28 21:42:17 +07:00
d06b73c3dd Fix RFC6186 editor not displaying records and failing on new service 2026-03-28 21:42:17 +07:00
e571a629b7 services: move service registry to internal/service package
All checks were successful
continuous-integration/drone/push Build is passing
Analogous to internal/provider, extract the service registry (Svc,
RegisterService, FindService, ListServices, OrderedServices, FindSubService,
RegisterSubServices) and the zone analyzer (ServiceAnalyzer, Analyzer,
AnalyzeZone) from services/ into a new internal/service package.
2026-03-24 14:59:24 +07:00
2572e8c319 Preserve service metadata across zone re-analyses
After AnalyzeZone rebuilds services from raw DNS records, metadata that
cannot be derived from DNS (Id, UserComment, OwnerId, Aliases, TTL, and
service-specific fields like OpenPGP/SMimeCert Username) was lost.

Add a post-processing function ReassociateMetadata that matches new
services to old ones by type and subdomain (using RDATA hashing for
disambiguation) and transfers metadata. Services opt in to body-level
transfer via the new MetadataEnricher interface.
2026-03-14 11:06:49 +07:00
f4bcb1c9cf refactor: decompose Analyzer into recordPool and serviceAccumulator
Restructure the service analyzer architecture to improve maintainability:

- Extract recordPool (zone records + mark-delete claiming) and
  serviceAccumulator (service registry + domain normalization) as
  embedded structs in Analyzer
- Replace swap-delete with mark-delete to eliminate mutation-during-iteration
- Centralize domain normalization using helpers.DomainRelative
- Make Comment/NbResources lazy via Service.MarshalJSON instead of
  eager assignment at three separate call sites
- Extract SPF merging from usecase layer into services.CollectAndMergeSPF
- Add GetDefaultTTL accessor and comprehensive Analyzer doc comments
- Add round-trip test infrastructure covering MX, CNAME, CAA, TXT, SPF,
  DMARC, GSuite, Origin, Server and more
2026-03-14 11:06:49 +07:00
6de814a247 docs: add comments to all functions and types in analyzer.go
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 10:36:53 +07:00
2a00d69ebb refactor: use random identifiers instead of SHA1 hashes for service IDs
Replace SHA1-based service ID generation with happydns.NewRandomIdentifier()
for consistency with the rest of the codebase.
2026-03-14 10:36:53 +07:00
3d196088c2 fix: prevent duplicate results in SearchRR when multiple filters match
When a record matched more than one AnalyzerRecordFilter, it was
appended to the result slice multiple times. Break after the first
matching filter to include each record at most once.
2026-03-14 10:36:53 +07:00
c7f309b867 fix: break after finding record in UseRR swap-delete loop
The swap-and-shrink deletion inside a range loop skipped the element
swapped into position k. Since there should only be one matching
record (pointer equality), breaking immediately is both correct and
clearer.
2026-03-14 10:36:53 +07:00
31950811c0 Merge SPF records from multiple services into single TXT record
RFC 7208 requires exactly one SPF record per domain. Previously, the
standalone SPF service and provider services like GSuite each emitted
their own SPF TXT record, producing invalid DNS when both existed.

Introduce SPFContributor interface so services can declare SPF
directives independently. At zone generation time, all contributions
for the same domain are merged into a single SPF record with the
strictest "all" policy winning. During zone import, GSuite claims its
directive via ClaimSPFDirective so the SPF analyzer excludes it from
the standalone SPF service.
2026-03-14 10:36:53 +07:00
f457071d5d chore: replace interface{} with any across the codebase
Use the modern Go type alias `any` instead of `interface{}` throughout
all packages for improved readability and consistency with current Go idioms.
2026-03-01 17:38:04 +07:00
74ef579cba Refactor RR relativization to use subdomain-aware helpers 2026-01-16 21:52:05 +08:00
dc880d31a8 Handle CAA issuevmc, contactemail and contactphone
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2026-01-12 15:46:41 +07:00
0794192679 Update and migrate GSuite to store records instead of generating them 2026-01-12 10:19:33 +07:00
b00b3302bd gsuite: Fix invalid type leading to panic
Fixes: https://github.com/happyDomain/happydomain/issues/42
2026-01-11 22:16:50 +07:00
437cf4d80b Create copy of returned records 2026-01-07 22:26:19 +07:00
040769064b Centralize relative RData transformation in helper 2026-01-07 22:26:19 +07:00
dbca7c6bbc Add tests on services 2026-01-07 22:26:19 +07:00
df825f1f50 Services stores records instead of abstact data 2026-01-07 22:26:19 +07:00
61c2b000ce Fix generated orphan records not including origin in domain name
Some checks are pending
continuous-integration/drone/push Build is running
2025-09-10 15:44:27 +09:00
5ef9419072 refactor: restructure project architecture and folder hierarchy
- Moved usecases into internal/usecase
- Renamed internal/utils to internal/helpers for better naming semantics
- Clarified separation between domain model, usecases, adapters, and web/API
2025-05-28 22:00:02 +02:00
b77e2b8c3a Refactor App to add clarity 2025-05-22 15:46:06 +02:00
996b20e67b Fix a panic with SRV on classic subdomain 2025-05-10 00:11:14 +02:00
afd4e21a4c Fix zone analysis expecting a non-dot ended FQDN in domain search
All checks were successful
continuous-integration/drone/push Build is passing
2025-04-24 16:54:15 +02:00
0edc2e66e2 Clean architecture refactoring 2025-04-22 14:15:03 +02:00
9c6de4fdae Don't require origin when generating service comment 2025-04-22 14:15:03 +02:00
f97670ad08 Update all structs to use dns.RR 2025-04-22 14:15:03 +02:00
e7877e9363 Make the records relatives inside the storage 2025-04-19 15:10:05 +02:00
70e271ce84 Generate dns.RR, limit dnscontrol structs 2025-04-19 15:10:05 +02:00
8f34c45f00 Store raw DNS records under Services instead of custom attributes 2025-04-19 15:10:05 +02:00
109023aa75 GenerateRRs can now return error 2025-04-19 15:10:05 +02:00
787c295ee4 google-site-verification: Can't be NearAlone as it is not a subdomain of the current domain 2025-04-19 15:10:04 +02:00
7da68e4923 Implement form for RFC 6186 (Use of SRV Records for Locating Email Submission/Access Services)
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-05 15:21:07 +01:00
ff3e1f9172 MXs: Fix analyze that merges all MX found in zone 2025-01-05 15:17:57 +01:00
0c0557bd12 gsuite: Add SPF version
Some checks reported errors
continuous-integration/drone/push Build was killed
Fixes: https://framagit.org/happyDomain/happyDomain/-/issues/7
2024-12-12 16:41:20 +01:00
ec952b50fa SSHFP can also be independant records 2024-12-12 16:41:20 +01:00
597bdcbcff server: Fix nbresources return 2024-12-12 16:41:20 +01:00
fd30989e3a Update categories to be more usefull 2024-12-12 16:41:20 +01:00
e38baf825e Deprecate Email service 2024-12-12 16:41:20 +01:00
70a189163e TLS-RPT is now a dedicated service 2024-12-12 16:41:20 +01:00
8062973169 MTA-STS is now a dedicated service 2024-12-12 16:41:20 +01:00
d69e1992d8 DMARC is now a dedicated service 2024-12-12 16:41:20 +01:00
56054b23e3 DKIM is now a dedicated service 2024-12-12 16:41:20 +01:00
0fd9b26266 SPF is now a dedicated service 2024-12-12 16:41:20 +01:00
b7bb771c9b GitlabPageVerif: Fix wrong analysis
Some checks failed
continuous-integration/drone/push Build is failing
2024-11-07 09:10:30 +01:00