From 511d10efc9120316d0b10393947cc60730a5bbff Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Thu, 22 Mar 2018 09:30:09 -0400 Subject: [PATCH] Document SRV, CF*REDIRECT, and note where docs are needed. (#346) --- docs/_functions/domain/CF_REDIRECT.md | 16 +++++++++++++ docs/_functions/domain/CF_TEMP_REDIRECT.md | 22 ++++++++++++++++++ docs/_functions/domain/FRAME.md | 9 ++++++++ docs/_functions/domain/IMPORT_TRANSFORM.md | 8 +++---- docs/_functions/domain/SRV.md | 27 ++++++++++++++++++++++ docs/_functions/domain/URL.md | 8 +++++++ docs/_functions/domain/URL301.md | 8 +++++++ 7 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 docs/_functions/domain/CF_REDIRECT.md create mode 100644 docs/_functions/domain/CF_TEMP_REDIRECT.md create mode 100644 docs/_functions/domain/FRAME.md create mode 100644 docs/_functions/domain/SRV.md create mode 100644 docs/_functions/domain/URL.md create mode 100644 docs/_functions/domain/URL301.md diff --git a/docs/_functions/domain/CF_REDIRECT.md b/docs/_functions/domain/CF_REDIRECT.md new file mode 100644 index 000000000..47dc7d1ee --- /dev/null +++ b/docs/_functions/domain/CF_REDIRECT.md @@ -0,0 +1,16 @@ +--- +name: CF_REDIRECT +parameters: + - destination + - modifiers... +--- + +`CF_REDIRECT` is the same as `CF_TEMP_REDIRECT` but generates a +http 301 redirect (permanent redirect) instead of a temporary +redirect. + +These redirects are cached by browsers forever, usually ignoring +any TTLs or other cache invalidation techniques. It should be +used with great care. We suggest using a `CF_TEMP_REDIRECT` +initially, then changing to a `CF_REDIRECT` only after sufficient +time has elapsed to prove this is what you really want. diff --git a/docs/_functions/domain/CF_TEMP_REDIRECT.md b/docs/_functions/domain/CF_TEMP_REDIRECT.md new file mode 100644 index 000000000..1985bc88e --- /dev/null +++ b/docs/_functions/domain/CF_TEMP_REDIRECT.md @@ -0,0 +1,22 @@ +--- +name: CF_TEMP_REDIRECT +parameters: + - destination + - modifiers... +--- + +`CF_REDIRECT` uses CloudFlare-specific features ("page rules") to +generate an HTTP 301 redirect. + +WARNING: If the domain has other pagerules in place, they may be +deleted. At this time this feature is best used on bare domains +that need to redirect to another domain, perhaps with wildcard +substitutions. + +{% include startExample.html %} +{% highlight js %} +D("foo.com", .... , + CF_TEMP_REDIRECT("example.mydomain.com/*", "https://otherplace.yourdomain.com/$1"), +); +{%endhighlight%} +{% include endExample.html %} diff --git a/docs/_functions/domain/FRAME.md b/docs/_functions/domain/FRAME.md new file mode 100644 index 000000000..1bff42e88 --- /dev/null +++ b/docs/_functions/domain/FRAME.md @@ -0,0 +1,9 @@ +--- +name: FRAME +parameters: + - name + - target + - modifiers... +--- + +Documentation needed. diff --git a/docs/_functions/domain/IMPORT_TRANSFORM.md b/docs/_functions/domain/IMPORT_TRANSFORM.md index a5c121ef1..0992d2c6f 100644 --- a/docs/_functions/domain/IMPORT_TRANSFORM.md +++ b/docs/_functions/domain/IMPORT_TRANSFORM.md @@ -3,14 +3,12 @@ name: IMPORT_TRANSFORM parameters: - transform table - domain - - ttl - modifiers... --- -Don't use this feature. It was added for a very specific situation. Bugs -and feature requests from outside that situation will be rejected. +Don't use this feature. It was added for a very specific situation at Stack Overflow. -IMPORT_TRANSFORM adds to the domain all the records from another +`IMPORT_TRANSFORM` adds to the domain all the records from another domain, after making certain transformations and resetting the TTL. Example: @@ -23,7 +21,7 @@ the IP address to be based on 123.123.123.100 (i.e. .113 or .114). You wouldn't want to maintain bar.com manually, would you? It would be very error prone. Therefore instead you maintain foo.com and -let IMPORT_TRANSFORM automatically generate bar.com. +let `IMPORT_TRANSFORM` automatically generate bar.com. {% include startExample.html %} {% highlight html %} diff --git a/docs/_functions/domain/SRV.md b/docs/_functions/domain/SRV.md new file mode 100644 index 000000000..878c09f2c --- /dev/null +++ b/docs/_functions/domain/SRV.md @@ -0,0 +1,27 @@ +--- +name: SRV +parameters: + - name + - priority + - weight + - port + - target + - modifiers... +--- + +`SRV` adds a `SRV` record to a domain. The name should be the relative label for the record. + +Priority, weight, and port are ints. + +{% include startExample.html %} +{% highlight js %} + +D("example.com", REGISTRAR, DnsProvider("GCLOUD"), + // Create SRV records for a a SIP service: + // pr w port, target + SRV('_sip._tcp', 10, 60, 5060, 'bigbox.example.tld.'), + SRV('_sip._tcp', 10, 20, 5060, 'smallbox1.example.tld.'), +); + +{%endhighlight%} +{% include endExample.html %} diff --git a/docs/_functions/domain/URL.md b/docs/_functions/domain/URL.md new file mode 100644 index 000000000..cc318142c --- /dev/null +++ b/docs/_functions/domain/URL.md @@ -0,0 +1,8 @@ +--- +name: URL +parameters: + - name + - modifiers... +--- + +Documentation needed. diff --git a/docs/_functions/domain/URL301.md b/docs/_functions/domain/URL301.md new file mode 100644 index 000000000..f95ddb989 --- /dev/null +++ b/docs/_functions/domain/URL301.md @@ -0,0 +1,8 @@ +--- +name: URL301 +parameters: + - name + - modifiers... +--- + +Documentation needed.