Skip to content
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

Adding Custom DNS Provider model #285

Merged
merged 8 commits into from
Sep 10, 2021
Merged

Adding Custom DNS Provider model #285

merged 8 commits into from
Sep 10, 2021

Conversation

shibayan
Copy link
Owner

@shibayan shibayan commented Mar 9, 2021

Because of the high maintenance cost of integrating DNS providers into Acmebot, I will change to using HTTP-based custom providers for all but the major DNS providers, and implement the necessary APIs by ourselves.

I will no longer accept pull requests for non-major DNS providers.

@shibayan shibayan added the enhancement New feature or request label Mar 9, 2021
@shibayan shibayan self-assigned this Mar 9, 2021
@ypid-geberit
Copy link

I think the approach with a custom DNS provider is a good one. We would be interested in that feature. Looks like only the docs are missing. I guess you are waiting for feedback before you consider merging and releasing that? Can you point me to API docs that you expect so that I can consider testing it?

@shibayan
Copy link
Owner Author

shibayan commented Sep 1, 2021

The Custom DNS Provider API has not been defined yet, so there is no documentation available. It will be available after this PR is merged.

However, since there are very few requests for the Custom DNS Provider, the work has a low priority.

@johste93
Copy link

johste93 commented Sep 6, 2021

Found this plugin today, just want to say we need this feature. We're using dnsimple.

@ypid-geberit
Copy link

ypid-geberit commented Sep 8, 2021

I now took a deeper look at your work @shibayan to figure out how much work is needed to test/use the CustomDnsProvider. The implementation and API definition are already there and the CI test confirms that it builds.

The CustomDnsProvider exposes 2 app settings:

  • Acmebot:CustomDns:PropagationSeconds
  • Acmebot:CustomDns:Endpoint
    • Base URL of the CustomDNS endpoint.

The code assumes that there is a HTTP(S) REST API endpoint that supports the following methods:

  • GET /zones

  • POST /records/create

    • Should accept a JSON object like this example:
    {
      "Id": "example_net",
      "recordName": "_acme-challenge.example.net",
      "values": ["667drNmQL3vX6bu8YZlgy0wKNBlCny8yrjF1lSaUndc"]
    }
    • This needs to create a TXT record at _acme-challenge.example.net which is then used by the CA to verify domain control.
  • POST /records/delete

    • Should accept a JSON object like this example:
    {
      "Id": "example_net",
      "recordName": "_acme-challenge.example.net"
    }
    • This needs to delete/cleanup the TXT record at _acme-challenge.example.net.

To test this, I would need to fork your branch/this pull request, change "WEBSITE_RUN_FROM_PACKAGE" in https://github.com/shibayan/keyvault-acmebot/blob/master/azuredeploy.json to a zip file I have build with the CustomDnsProvider included.

Am I missing something? Could you publish the zip file/modified azuredeploy.json? I am a Linux developer and ops guy unfamiliar with this Mircosoft dev environment.

If I can give you feedback on the API design, I would propose those changes:

  • POST /records/example_net

    {
      "recordName": "_acme-challenge.example.net",
      "values": ["667drNmQL3vX6bu8YZlgy0wKNBlCny8yrjF1lSaUndc"]
    }
  • DELETE /records/example_net

    • Should accept a JSON object like this example:
    {
      "recordName": "_acme-challenge.example.net"
    }

A open question is authentication. I propose to add an app setting Acmebot:CustomDns:ApiToken with the same semantics as Acmebot:Cloudflare:ApiToken. Which would boil down to this code line getting added to this pull request:

_httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiToken);

Ref: https://github.com/shibayan/keyvault-acmebot/blob/ea3b49e4a2b46a0093545a0d08c22a8fee2437fe/KeyVault.Acmebot/Providers/CloudflareProvider.cs

PS: @johste93 I am a Free software maintainer myself and for comments like "I need this", GitHub Reactions are preferred in my eyes.

@shibayan
Copy link
Owner Author

shibayan commented Sep 9, 2021

I have made significant changes to the API specification based on feedback. The API should now be easier to use than before.

https://github.com/shibayan/keyvault-acmebot/wiki/DNS-Provider-Configuration#custom-dns-preview

@ypid-geberit
Copy link

Thanks very much! I reviewed your changes again. I am not a C# dev but what I understand looks good to me. Can we deploy this to Azure somehow for testing?

@shibayan
Copy link
Owner Author

shibayan commented Sep 9, 2021

It will be available after the PR is merged after a minimum of checking. However, it will be a preview feature for a while.

If you want to try it out right now, you can clone the repository, switch branches, and deploy it manually to Azure Functions to make it available.

@shibayan shibayan merged commit 944cc2c into master Sep 10, 2021
@shibayan shibayan deleted the custom-dns-provider branch September 10, 2021 07:38
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants