-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLOUDFLAREAPI: Enable CanUseLOC #2799
base: main
Are you sure you want to change the base?
Conversation
Some advice: Update |
CC @systemcrash |
LocOrigAltitude int32 `json:"locorigaltitude,omitempty"` | ||
LocOrigSize float32 `json:"locorigsize,omitempty"` | ||
LocOrigHorizPre float32 `json:"locorighorizpre,omitempty"` | ||
LocOrigVertPre float32 `json:"locorigvertpre,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this provider need new fields when multiple providers already support LOC without needing the extra fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Cloudflare API requires the original degrees, minutes, seconds values whereas to my knowledge the LOC model converts to decimal degrees, which doesn't fit into the request data Cloudflare asks for.
I'm trying to pass through both the DD and the original DMS values to the provider to allow either to be used.
https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-create-dns-record (Body -> LOC Record)
I may be wrong here, or there may be a better way about this - but this is just what I've come to so far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! So if I understand it correctly: Some of the fields are what the user input. Those inputs are then massaged and stored as another set of fields.
If that's the situation, then please be clear in the comments which are the user-input fields and which are the derived fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to have RecordConfig contain a field called LOC which is a pointer to a LOCConfig. All those fields would be moved to LOCConfig. That would conserve memory. (You don't have to make this change right now. First let's see if the extra RAM causes problems. If we really want to save memory, we should come up with a solution that works for Naptr, Loc, and other fields too.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Tim. I recall implementing LOC for what was necessary in the final result. I referenced the original RFC. There are several ways to write coordinates, with a few which are commonly accepted everywhere. I tried handling the common ones in the js import, so there might need to be a bit of work there also. So be mindful of the import process done via the Javascript files (and test coverage) if those routes are necessary.
Might not be a bad idea to pass through components from the original js config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refer to my original commit or PR to find the js bits. Good to see Cloud Flare filling out their portfolio with LOC. 🥳
LocLatDirection string `json:"loclatdirection,omitempty"` | ||
LocLongDegrees uint8 `json:"loclongdegrees,omitempty"` | ||
LocLongMinutes uint8 `json:"lotlongminutes,omitempty"` | ||
LocLongSeconds float32 `json:"loclongseconds,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't see the LOC records at cloud flare link. So we assume only seconds will take decimal fractions ie floats. Degrees and minutes are whole integers.
I've done some research and now I think I can give a (hopefully!) more useful recommendation. Rather than derive those fields and store them in RecordConfig, those fields should be derived "on demand" when needed. That is, the cloudflare createRecDiff2() function should generate those additional fields. This would have a few benefits:
Hope that helps, |
Evidently cloudflare constructs the content record for you. They probably consider this a tricky record type. https://developers.cloudflare.com/api-next/resources/dns/subresources/records/models/loc_record/#(schema)
|
Enables LOC records with the Cloudflare provider for #2798.
Draft PR as this currently doesn't work.