FEATURE: Init command#4208
Conversation
chicks-net
left a comment
There was a problem hiding this comment.
Very clean and useful.
| provider reduces to a few lines: | ||
|
|
||
| ```go | ||
| providers.RegisterCredsMetadata("MYPROVIDER", providers.CredsMetadata{ |
There was a problem hiding this comment.
This example is good and I wouldn't replace it, but it would be nice if the longer example from the github issue were also included. Another way to accomplish this without writing so much in this doc would be pointing at the other working examples you've done.
There was a problem hiding this comment.
Good call. Went with your second suggestion (point at the working examples) so the doc stays compact and does not drift when the providers evolve. The bind and transip references are now clickable links plus a one line description of what each example demonstrates (16e5e1f).
TomOnTime
left a comment
There was a problem hiding this comment.
Wow! This is really going to make onboarding a lot easier!
8f7f6bc to
fabc46c
Compare
|
Heads up: the lint job is failing on three |
|
@TomOnTime thanks for the wording suggestions on the documentation. I've processed your textual feedback in 0d23b6b, so the onboarding docs and the On top of that, I fixed the failing lint job in 371f05e by migrating from From my side this is ready for another review pass. Let me know if you'd like any further tweaks! |
|
Ah! We were both working on the golangci-lint issue at the same time! I will revert #4215 and use your solution. |
|
@TomOnTime I've re-resolved the merge conflict with #4222 in |
Co-authored-by: Tom Limoncelli <tal@whatexit.org>
|
@TomOnTime I've added an additional commit f25ce33 to apply the renamed import paths from |
Add interactive
dnscontrol initonboarding wizardCloses #4205
Summary
A new user can run
dnscontrol initand have a workingcreds.jsonplus a starterdnsconfig.jswithin a minute. The wizard asks the right questions for the chosen provider and writes both files for them. Existing workflows are unaffected; users who prefer to hand editcreds.jsoncan keep doing exactly that.Why
DNSControl's biggest entry barrier is the very first ten minutes. Newcomers have to discover, on their own, what fields belong in
creds.jsonfor their provider, where to create the API token, whether a value should be a secret, whether it spans multiple lines. That information lives in three places (the provider documentation, the provider's source, and the integration tests workflow) and rarely all in the same form. After helping multiple developers through that ramp myself, the friction is recognisable every time.The wizard collapses that into a single guided session. A maintainer describes their provider's credential fields once via
RegisterCredsMetadata, and from then on every newcomer reuses that knowledge.What this gives users
$EDITORso multiline values stay intact.dnsconfig.jswith the live zones at the provider, and to rundnscontrol previewas a sanity check.What this gives provider maintainers
A small registration block next to the existing
RegisterMaintainercall:That is enough for the provider to appear in the wizard. Providers with multiple auth methods (TransIP access token versus account name plus private key, or Route53 static keys versus assume role) can branch with
InternalandShowIf.Three providers ship with metadata in this PR as a starting point and a worked example: NONE, BIND, and TransIP. The remaining providers can land incrementally in follow up PRs, one per maintainer.
Scope and follow ups
Try it
Check out the branch:
Build and run the wizard against an empty directory:
Try one of the included providers (NONE, BIND, TransIP) to see the full flow including the optional zone comparison and
dnscontrol previewstep.Test plan
go build ./...go test ./...$EDITOR=nano).Documentation preview (GitBook)
The new and updated pages render through the GitBook Git Sync. Preview URLs:
index.md: https://docs.dnscontrol.org/~/revisions/qjuEAKjgO6xGzbKshhTH#try-itcommands/init.md: https://docs.dnscontrol.org/~/revisions/qjuEAKjgO6xGzbKshhTH/commands/initgetting-started/getting-started.md: https://docs.dnscontrol.org/~/revisions/qjuEAKjgO6xGzbKshhTH/getting-started/getting-started#id-3.-create-the-initial-dnsconfig.jsgetting-started/migrating.md: https://docs.dnscontrol.org/~/revisions/qjuEAKjgO6xGzbKshhTH/getting-started/migratingcommands/creds-json.md: https://docs.dnscontrol.org/~/revisions/qjuEAKjgO6xGzbKshhTH/commands/creds-jsonLinked discussion
Initial proposal and feedback live in #4205. Earlier consensus there: drop
DomainsURL, keep the auth method picker, drop the generic fallback for the first version of the PR, and keep the per provider documentation pages intact.