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

Support for provider: Variomedia #1637

Closed
4 of 5 tasks
SIMULATAN opened this issue May 1, 2022 · 7 comments · Fixed by #1654
Closed
4 of 5 tasks

Support for provider: Variomedia #1637

SIMULATAN opened this issue May 1, 2022 · 7 comments · Fixed by #1654

Comments

@SIMULATAN
Copy link

SIMULATAN commented May 1, 2022

Welcome

  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, the DNS provider exposes a public API.
  • Yes, I know that the lego maintainers don't have an account in all DNS providers in the world.
  • Yes, I'm able to create a pull request and be able to maintain the implementation.
  • Yes, I'm able to test an implementation if someone creates a pull request to add the support of this DNS provider.

How do you use lego?

Through Traefik

Link to the DNS provider

https://www.variomedia.de

Link to the API documentation

Additional Notes

The site is entirely in german, the "docs" can be found in the google translated version here and here

The shell script version is here

@ldez
Copy link
Member

ldez commented May 1, 2022

Hello,

Can you give me the output of the following command?
Because the API documentation doesn't describe the response of the API endpoints

API_TOKEN=<your_token> \
DOMAIN=<your_domain> \
SUBDOMAIN=<your_subdomain> \
curl -s -X POST "https://api.variomedia.de/dns-records" \
-H "Authorization: token $API_TOKEN" \
-H "Content-Type: application/vnd.api+json" \
-H "Accept: application/vnd.variomedia.v1+json" \
--data '{"data":{"type":"dns-record","attributes":{"record_type":"TXT","name":"'_acme-challenge${SUBDOMAIN}'","domain":"'$DOMAIN'","data":"test","ttl":300}}}'

@ldez
Copy link
Member

ldez commented May 7, 2022

@SIMULATAN any news?

@SIMULATAN
Copy link
Author

Unfortunately, it turns out that it's harder to get a key than stated on the website. I contacted the support and they said that they can create a key for me which is what I'll ask for today, I will notify you once I have it and can test the call.

I'm very sorry for the delay, I really didn't expect it to be harder than stated in the FAQ.

@ldez
Copy link
Member

ldez commented May 28, 2022

@SIMULATAN any news?

@SIMULATAN
Copy link
Author

I'm very sorry for the delay, I had a lot of things going on for school and thus couldn't get the API key.
I now finally received one, so here are the results:

POST /dns-records

(the snippet you provided)

Unauthorized (wrong token supplied)

HTTP 401 - Body: {"errors":[{"status":"401","title":"The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.","id":"unauthorized"}],"links":{"self":"https://api.variomedia.de/dns-records"}}

Correct options

!!HTTP 202 ACCEPTED!!

{
    "data": {
        "type": "queue-job",
        "id": "18181818",
        "attributes": {
            "status": "pending"
        },
        "links": {
            "queue-job": "https://api.variomedia.de/queue-jobs/18181818",
            "dns-record": "https://api.variomedia.de/dns-records/19191919"
        }
    },
    "links": {
        "self": "https://api.variomedia.de/dns-records"
    }
}

Judging by the response of the API call GET https://api.variomedia.de/dns-records with the authorization header it seems like the record got created (I used my-test-record as the TXT name in this example, also works fine with _acme-challenge).

{
  "id": "20202020",
  "type": "dns-record",
  "links": {
      "self": "https://api.variomedia.de/dns-records/20202020"
  },
  "attributes": {
      "record_type": "TXT",
      "fqdn": "my-test-record.example.com",
      "fqdn_ace": "my-test-record.example.com",
      "name": "my-test-record",
      "name_ace": "my-test-record",
      "domain": "example.com",
      "data": "test",
      "ttl": 300
  }
}

(only the relevant part of the response)

If you need any further things checked just message me, I now have the API key and I'm happy to provide other necessary information. Thank you so much for working on this and sorry again for the delay ❤️

@ldez
Copy link
Member

ldez commented Jun 6, 2022

It seems like POST "https://api.variomedia.de/dns-records" only queues a job and returns the job id.

So I will need to get the job status.

Can you do the following commands and give the output?

API_TOKEN=<your_token> \
DOMAIN=<your_domain> \
SUBDOMAIN=<your_subdomain> \
curl -s -X POST "https://api.variomedia.de/dns-records" \
-H "Authorization: token $API_TOKEN" \
-H "Content-Type: application/vnd.api+json" \
-H "Accept: application/vnd.variomedia.v1+json" \
--data '{"data":{"type":"dns-record","attributes":{"record_type":"TXT","name":"'_acme-challenge${SUBDOMAIN}'","domain":"'$DOMAIN'","data":"test","ttl":300}}}'
JOB_ID=<your_job_id> \
API_TOKEN=<your_token> \
curl -s -X GET "https://api.variomedia.de/queue-jobs/${JOB_ID}" \
-H "Authorization: token $API_TOKEN" \
-H "Content-Type: application/vnd.api+json" \
-H "Accept: application/vnd.variomedia.v1+json"

I also need the output of the delete record calls:

RECORD_ID=<your_record_id> \
API_TOKEN=<your_token> \
DOMAIN=<your_domain> \
SUBDOMAIN=<your_subdomain> \
curl -s -X DELETE "https://api.variomedia.de/dns-records/${RECORD_ID}" \
-H "Authorization: token $API_TOKEN" \
-H "Content-Type: application/vnd.api+json" \
-H "Accept: application/vnd.variomedia.v1+json"

@SIMULATAN
Copy link
Author

GET https://api.variomedia.de/queue-jobs/JOB_ID

HTTP 200

{
    "data": {
        "id": "171717",
        "type": "queue-job",
        "links": {
            "self": "https://api.variomedia.de/queue-jobs/171717",
            "object": "https://api.variomedia.de/dns-records/212121"
        },
        "attributes": {
            "job_type": "dns-record",
            "status": "done"
        },
        "relationships": {
            "owner": {
                "data": {
                    "id": "505050",
                    "type": "customer"
                }
            }
        }
    },
    "links": {
        "self": "https://api.variomedia.de/queue-jobs/171717"
    }
}

DELETE https://api.variomedia.de/dns-records/RECORD_ID

!HTTP 202 ACCEPTED!

{
    "data": {
        "type": "queue-job",
        "id": "303030",
        "attributes": {
            "status": "pending"
        },
        "links": {
            "queue-job": "https://api.variomedia.de/queue-jobs/303030"
        }
    },
    "links": {
        "self": "https://api.variomedia.de/dns-records/212121"
    }
}

(another job, running the status for this returns this:)

{
    "data": {
        "id": "303030",
        "type": "queue-job",
        "links": {
            "self": "https://api.variomedia.de/queue-jobs/303030",
            "object": "https://api.variomedia.de/dns-records/212121"
        },
        "attributes": {
            "job_type": "dns-record",
            "status": "done"
        },
        "relationships": {
            "owner": {
                "data": {
                    "id": "505050",
                    "type": "customer"
                }
            }
        }
    },
    "links": {
        "self": "https://api.variomedia.de/queue-jobs/303030"
    }
}

(this is pretty much the same as the create request)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants
@ldez @SIMULATAN and others