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

feat: add multiple zone with same authentication. #144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xuandung38
Copy link

@xuandung38 xuandung38 commented Jul 2, 2023

Currently when you want to add multiple zone_ids with the same authenticator account, you have to repeat many times for example:

{
  "cloudflare": [
    {
      "authentication": {
        "api_token": "api_token_here", // Either api_token or api_key
        "api_key": {
          "api_key": "api_key_here",
          "account_email": "your_email_here"
        }
      },
      "zone_id": "zone_id_1_here",
      "subdomains": [
        {
          "name": "", // Root domain (example.com)
          "proxied": true
        },
      ]
    },
    {
      "authentication": {
        "api_token": "api_token_here", // Either api_token or api_key
        "api_key": {
          "api_key": "api_key_here",
          "account_email": "your_email_here"
        }
      },
      "zone_id": "zone_id_2_here",
      "subdomains": [
        {
          "name": "", // Root domain (example2.com)
          "proxied": true
        },
      ]
    }
  ],
  "a": true,
  "aaaa": true,
  "purgeUnknownRecords": false,
  "ttl": 300
}

Now you just need to declare zones and authentication accounts right in its own object.

Example:

{
  "cloudflare": [
    {
      "authentication": {
        "api_token": "api_token_here",
        "api_key": {
          "api_key": "api_key_here",
          "account_email": "your_email_here"
        }
      },
      "zones": [
        {
          "zone_id": "your_zone_id_1_here",
          "subdomains": [
            {
              "name": "",
              "proxied": false
            },
            {
              "name": "remove_or_replace_with_your_subdomain",
              "proxied": false
            }
          ]
        },
        {
          "zone_id": "your_zone_id_2_here",
          "subdomains": [
            {
              "name": "subdomain1",
              "proxied": true
            },
            {
              "name": "subdomain2",
              "proxied": false
            }
          ]
        }
      ]
    },
  ],
  "a": true,
  "aaaa": true,
  "purgeUnknownRecords": false
}

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

Successfully merging this pull request may close these issues.

1 participant