-
-
Notifications
You must be signed in to change notification settings - Fork 763
Get Cloudflare API
The purpose of this work is to connect the panel to the Cloudflare. By doing this, when you create a subdomain in the panel; Cloudflare automatically creates them and gets a certificate for them. Also, the process of creating workers is automated. Follow the steps below in order to get the Cloudflare key token.
-
First of all, log in to your Cloudflare account and register your domain. If you need more information for this, please read this link.
-
From here , go to My Profile > API Tokens.
-
Select
Create Token
.
- Choose a template from available templates or create a custom token. We suggest to use
Edit zone DNS
template as in the example below.
- In this step, configure Zone permission and resources as follows.
You can change token permissions from (Account, User, or Zone). Most groups offer "Edit" or "Read" options. "Edit" is full CRUDL (create, read, update, delete, list) access, while "Read" is read and list permission if necessary. See available token permissions for more information.
Proceed as follows to apply changes to your domains and Workers.
-
Set the Zone permission to DNS and in Edit mode to allow adding different subdomains.
-
Click the
Add more
button and select theWorkers Scripts
option in theAccount
section and give it Edit permission. -
In the
Account Resources
section, selectAll accounts
. -
In the
Zone Resources
section, allocate resources to your account. That is, selectAll zones from an account
and then select your Cloudflare account. -
Finally, click
Continue to summary
.
- Select Create Token to create the token.
- Copy the token.
After creating the token; go to the panel and in Very advanced settings
; paste the token in the specified field as shown in the image below.
Now, if you create a new subdomain in the domains section of the panel; Cloudflare settings are done automatically. Also, workers are created automatically.