Replies: 12 comments 6 replies
|
That looks easier. I would also remove SERVERS would be more technical. But maybe thats just my opinion because thats my dnscontrol use case. |
|
Why do we need the wrappers I get that you were trying to do a named-paramater sort of thing, but if you're not happy with the names for these, what's wrong with treating them as positional parameters instead? |
|
Thinking out loud. Ideally we'd remove the "PROVIDER(name)" call, and just have The problem with that is the PROVIDER function allows options. For example: That metadata would be lost. Well, I guess we could require people to repeat it in each instance. That seems like a PITA. Alternatively, we could (breaking change alert!) move that metadata to the creds.json file. Actually, I think making people repeat the metadata wouldn't be so bad. |
|
As long as you can choose between the two ways you can decide if you want to repeat that that or not. The question is if you want to support booth ways in the future. I dont want to open a new discussion here, but for me we have already to much in the Do we need a single place for provider configuration? |
|
Random thought: What if creds.json was just for credentials/secrets (things that shouldn't be in Git) and dnsconfig.js had a way of adding other info to the provider: |
|
Trying the new syntax, but |
|
Ah I see, still need |
|
+1 to the idea of having only credentials in creds.json, all config/options belong in dnsconfig.js |
Trying a different formatThe release coming out today supports this syntax. (The original NewDnsProvider/NewRegistrar commands still work, of course!). OLD: var DSP_GANDI = NewDnsProvider("gandi_main", {setting: "value"});
var REG_GANDI = NewRegistrar("gandi_main");
D("example.com",
REG_GANDI,
DnsProvider(DSP_GANDI),
A("@", "192.0.2.1")
);NEW: D("example.com",
REGISTRAR("gandi_main"),
SERVICE("gandi_main", ALL_NS, {setting: "value"}),
A("@", "192.0.2.1")
);The win here is that you don't have to declare variables. Also notice that the optional metadata on NewDnsProvider() has moved to SERVICE(). But I like variables!What if you really love using variables? Well, sure, you can still do that. Here's how we use a variable so we don't have to repeat the metadata: MY_METADATA = { setting: "value" };
D("example.com", REGISTRAR("none"),
SERVICE("gandi_main", ALL_NS, MY_METADATA),
...
);
D("example.net", REGISTRAR("none"),
SERVICE("gandi_main", ALL_NS, MY_METADATA),
...
);You can even store the output of SERVICE() and re-use it: var MY_SERVICE = SERVICE("gandi_main", ALL_NS, {setting: "value"});
D("example.com", REGISTRAR("gandi_main"),
MY_SERVICE,
...
);
D("example.net", REGISTRAR("none"),
MY_SERVICE,
...
);The result of REGISTRAR() can be stored and re-used the same way. Thoughts? |
|
I like it! It's compact and yet has the expressive power to do most whatever customization is needed.
…--[Lance]
Tom Limoncelli wrote on 10/9/2026 10:26 AM:
The release coming out today supports this syntax. (The original NewDnsProvider/NewRegistrar
commands still work, of course!).
OLD:
var DSP_GANDI = NewDnsProvider("gandi_main", {setting:"value"});
var REG_GANDI = NewRegistrar("gandi_main");
D("example.com",
REG_GANDI,
DnsProvider(DSP_GANDI),
A("@", "192.0.2.1")
);
NEW:
D("example.com",
REGISTRAR("gandi_main"),
SERVICE("gandi_main", ALL_NS, {setting:"value"}),
A("@", "192.0.2.1")
);
The win here is that you don't have to declare variables. Also notice that the optional metadata
on NewDnsProvider() has moved to SERVICE().
But I like variables!
What if you really love using variables? Well, sure, you can still do that.
Here's how we use a variable so we don't have to repeat the metadata:
MY_METADATA = { setting:"value" };
D("example.com", REGISTRAR("none"),
SERVICE("gandi_main", ALL_NS, MY_METADATA),
...
);
D("example.net", REGISTRAR("none"),
SERVICE("gandi_main", ALL_NS, MY_METADATA),
...
);
You can even store the output of SERVICE() and re-use it:
var MY_SERVICE = SERVICE("gandi_main", ALL_NS, {setting:"value"});
D("example.com", REGISTRAR("gandi_main"),
MY_SERVICE,
...
);
D("example.net", REGISTRAR("none"),
MY_SERVICE,
...
);
The result of REGISTRAR() can be stored and re-used the same way.
Thoughts?
—
Reply to this email directly, view it on GitHub
<#4949?email_source=notifications&email_token=AAASQLDO23U67CLRBDZZI6L5TDYS5A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBYGM3TCMZRUZZGKYLTN5XKO3LFNZ2GS33OUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#discussioncomment-18837131>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAASQLEXLXCGTPWZKWEAB7T5TDYS5AVCNFSNUABHKJSXA33TNF2G64TZHM3DMOJWGM3TCNR3IRUXGY3VONZWS33OHMYTAOJQG43DQM5BOYBA>.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with
GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AAASQLCH7D7AP4IIUFENBLL5TDYS5A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBYGM3TCMZRUZZGKYLTN5XKO3LFNZ2GS33OUVSXMZLOOSVGM33PORSXEX3JN5ZQ>
and Android
<https://github.com/notifications/mobile/android/AAASQLGYUTAOFALY3S5PSAD5TDYS5A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBYGM3TCMZRUZZGKYLTN5XKO3LFNZ2GS33OUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
@TomOnTime Thanks for this! Works great. Now it would be awesome to remove configs from the |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Currently
dnsconfig.jslooks like this:Problems:
Wouldn't it be easier if dnsconfig.js looked like this?
I think it would.
However the names SVC_GANDI_MAIN and DNS_SERVICE aren't my fav. However I can't think of better ones.
Do you like this? What names would you suggest?
CC @cafferata @chicks-net @labrown @eliheady @fm for visibility
All reactions