mholt / caddy-dynamicdns

Caddy app that keeps your DNS records (A/AAAA) pointed at itself.
Apache License 2.0
251 stars 25 forks source link

Refactor `lastIPs`, add `update_only` option #40

Closed francislavoie closed 1 year ago

francislavoie commented 1 year ago

Closes #18

Fix #30

francislavoie commented 1 year ago

This should also fix #30.

I pivoted this PR to also fix that, since they're related.

I haven't tested/ran this yet, but I think it's probably done.

I used ChatGPT to ask it if it sees any bugs. It said the code looks good, but recommended changing removeDuplicateIPs to use a map for uniqueness; O(n) instead of O(n^2) (but this obviously is such a small list it doesn't matter).

francislavoie commented 1 year ago

I forgot to update the README to add update_only, I'll do a follow-up soon