external-mdns icon indicating copy to clipboard operation
external-mdns copied to clipboard

feat: Add record truncation and improve logging

Open thekoma opened this issue 1 year ago • 5 comments

  • Add new flag --truncate-long-records to handle long record names
  • Implement record validation and truncation using SHA-256 hash
  • Enhance logging with emoji-based status indicators
  • Update Dockerfile to use Go 1.23
  • Update .dockerignore to exclude manifests directory
  • Improve error and configuration logging messages
  • added skaffold.yaml to simplify development

thekoma avatar Jan 28 '25 16:01 thekoma

Added requested changes

thekoma avatar Feb 22 '25 17:02 thekoma

@blake Cannot reassign back to you.

thekoma avatar Feb 22 '25 17:02 thekoma

As the name while predictable is not straightforward I opted to skip it instead of shortening it. So we are still in RFC. Before this patch the program would just crash when creating an out of RFC record.

Andrea Cervesato

Phone: +39.392.23.80.611 Mail: @.***

Il lun 24 feb 2025, 06:39 Blake Covarrubias @.***> ha scritto:

@.**** commented on this pull request.

In main.go https://github.com/blake/external-mdns/pull/29#discussion_r1967061259:

@@ -216,6 +220,7 @@ func main() { flag.BoolVar(&exposeIPv4, "expose-ipv4", lookupEnvOrBool("EXTERNAL_MDNS_EXPOSE_IPV4", exposeIPv4), "Publish A DNS entry (default: true)") flag.BoolVar(&exposeIPv6, "expose-ipv6", lookupEnvOrBool("EXTERNAL_MDNS_EXPOSE_IPV6", exposeIPv6), "Publish AAAA DNS entry (default: false)") flag.IntVar(&recordTTL, "record-ttl", lookupEnvOrInt("EXTERNAL_MDNS_RECORD_TTL", recordTTL), "DNS record time-to-live")

  • flag.BoolVar(&truncateLongRecords, "truncate-long-records", lookupEnvOrBool("EXTERNAL_MDNS_TRUNCATE_LONG_RECORDS", false), "Truncate long record names using SHA-256 hash (default: false)")

@thekoma https://github.com/thekoma What do you think about enabling this by default given that the current behavior violates section 2.3.1 https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.1 of RFC 1035, DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION.

— Reply to this email directly, view it on GitHub https://github.com/blake/external-mdns/pull/29#pullrequestreview-2636043602, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB4LAV4PPBR3ATEEEKO26L2RKV7ZAVCNFSM6AAAAABWA3UPO6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMMZWGA2DGNRQGI . You are receiving this because you were mentioned.Message ID: @.***>

thekoma avatar Feb 24 '25 11:02 thekoma

@thekoma are you okay with me rebasing these changes onto master, resolving the merge conflicts, and force pushing the changes to your branch?

blake avatar Mar 02 '25 00:03 blake

Sure Blake! Rebase it as you like!

thekoma avatar Mar 02 '25 09:03 thekoma