mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-09-06 21:24:18 +08:00
Fixed Cloudflare docs (#224)
- Grammar fixes - Fixed wrong highlighting type - Formatted markdown better - Other various fixes
This commit is contained in:
parent
8dedfb1017
commit
efe302a957
1 changed files with 6 additions and 13 deletions
|
@ -7,9 +7,7 @@ jsId: CLOUDFLAREAPI
|
||||||
# Cloudflare Provider
|
# Cloudflare Provider
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
In the credentials file you must provide your Cloudflare API username and access token:
|
||||||
In your providers config json file you must provide your cloudflare.com api
|
|
||||||
username and access token:
|
|
||||||
|
|
||||||
{% highlight json %}
|
{% highlight json %}
|
||||||
{
|
{
|
||||||
|
@ -21,7 +19,6 @@ username and access token:
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
## Metadata
|
## Metadata
|
||||||
|
|
||||||
Record level metadata availible:
|
Record level metadata availible:
|
||||||
* `cloudflare_proxy` ("on", "off", or "full")
|
* `cloudflare_proxy` ("on", "off", or "full")
|
||||||
|
|
||||||
|
@ -40,10 +37,10 @@ What does on/off/full mean?
|
||||||
|
|
||||||
**Aliases:**
|
**Aliases:**
|
||||||
|
|
||||||
To make configuration files more readable and less prone to typos,
|
To make configuration files more readable and less prone to errors,
|
||||||
the following aliases are pre-defined:
|
the following aliases are pre-defined:
|
||||||
|
|
||||||
{% highlight json %}
|
{% highlight js %}
|
||||||
// Meta settings for individual records.
|
// Meta settings for individual records.
|
||||||
var CF_PROXY_OFF = {'cloudflare_proxy': 'off'}; // Proxy disabled.
|
var CF_PROXY_OFF = {'cloudflare_proxy': 'off'}; // Proxy disabled.
|
||||||
var CF_PROXY_ON = {'cloudflare_proxy': 'on'}; // Proxy enabled.
|
var CF_PROXY_ON = {'cloudflare_proxy': 'on'}; // Proxy enabled.
|
||||||
|
@ -57,7 +54,7 @@ var CF_PROXY_DEFAULT_ON = {'cloudflare_proxy_default': 'on'};
|
||||||
|
|
||||||
The following example shows how to set meta variables with and without aliases:
|
The following example shows how to set meta variables with and without aliases:
|
||||||
|
|
||||||
{% highlight json %}
|
{% highlight js %}
|
||||||
D('example.tld', REG_NONE, DnsProvider(CLOUDFLARE),
|
D('example.tld', REG_NONE, DnsProvider(CLOUDFLARE),
|
||||||
A('www1','1.2.3.11', CF_PROXY_ON), // turn proxy ON.
|
A('www1','1.2.3.11', CF_PROXY_ON), // turn proxy ON.
|
||||||
A('www2','1.2.3.12', CF_PROXY_OFF), // default is OFF, this is a no-op.
|
A('www2','1.2.3.12', CF_PROXY_OFF), // default is OFF, this is a no-op.
|
||||||
|
@ -66,8 +63,7 @@ D('example.tld', REG_NONE, DnsProvider(CLOUDFLARE),
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
Example Javascript:
|
||||||
Example javascript:
|
|
||||||
|
|
||||||
{% highlight js %}
|
{% highlight js %}
|
||||||
var REG_NONE = NewRegistrar('none', 'NONE')
|
var REG_NONE = NewRegistrar('none', 'NONE')
|
||||||
|
@ -94,18 +90,15 @@ D('example2.tld', REG_NONE, DnsProvider(CLOUDFLARE),
|
||||||
{%endhighlight%}
|
{%endhighlight%}
|
||||||
|
|
||||||
## Activation
|
## Activation
|
||||||
|
|
||||||
DNSControl depends on a Cloudflare Global API Key that's available under "My Settings".
|
DNSControl depends on a Cloudflare Global API Key that's available under "My Settings".
|
||||||
|
|
||||||
## New domains
|
## New domains
|
||||||
|
|
||||||
If a domain does not exist in your CloudFlare account, DNSControl
|
If a domain does not exist in your CloudFlare account, DNSControl
|
||||||
will *not* automatically add it. You'll need to do that via the
|
will *not* automatically add it. You'll need to do that via the
|
||||||
control panel manually or via the `dnscontrol create-domains` command.
|
control panel manually or via the `dnscontrol create-domains` command.
|
||||||
|
|
||||||
## Redirects
|
## Redirects
|
||||||
|
The Cloudflare provider can manage Page-Rule based redirects for your domains. Simply use the `CF_REDIRECT` and `CF_TEMP_REDIRECT` functions to make redirects:
|
||||||
The cloudflare provider can manage Page-Rule based redirects for your domains. Simply use the `CF_REDIRECT` and `CF_TEMP_REDIRECT` functions to make redirects:
|
|
||||||
|
|
||||||
{% highlight js %}
|
{% highlight js %}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue