Skip to content

prasmussen/gandi-rrr

Repository files navigation

gandi-rrr

Overview

gandi-rrr is a web server that provides a RESTful interface for adding and removing resource records on a domain using the gandi.net API. Records are created by doing a POST request to the server with a JSON payload containing a name and value. A token header must also be sent with the request to identify the type of record and which domain the request is for. Tokens are defined in the config file of the server, see included config for examples. List of supported record types can be found here.

Prerequisites

None, binaries are statically linked. If you want to compile from source you need the go toolchain.

Downloads

Examples

All examples uses the jq tool to pretty-print the json response. Also note that the examples uses 'https'. gandi-rrr will only accept https requests if certfile and keyfile are defined in the config file. Self-signed certificates can be generated with the cert tool.

List all records on domain
$ curl --silent --insecure -H 'Token:foobarbaz' https://127.0.0.1:4430 | jq .
{
  "records": [
    {
      "ttl": 900,
      "type": "A",
      "value": "10.0.0.100",
      "name": "foo"
    },
    {
      "ttl": 900,
      "type": "A",
      "value": "10.0.0.101",
      "name": "bar"
    }
  ],
  "domain": "bazqux.com"
}
Info for specific record
$ curl --silent --insecure -H 'Token:foobarbaz' https://127.0.0.1:4430/foo | jq .
{
  "ttl": 900,
  "type": "A",
  "value": "10.0.0.100",
  "name": "foo"
}
Add new record
$ curl --silent --insecure -H 'Token:foobarbaz' -X POST -d '{"name": "baz", "value": "10.0.0.102"}' https://127.0.0.1:4430 | jq .
{
  "success": true
}
Delete record
$ curl --silent --insecure -H 'Token:foobarbaz' -X DELETE https://127.0.0.1:4430/baz | jq .
{
  "success": true
}

About

gandi - Restful Resource Records

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published