docs(installer): clarify Cloudflare token creation

This commit is contained in:
Meghdad committed 2026-08-13 03:50:10 +03:30
1 parent 66f9811f48
commit e0a3fd49da
3 files changed
+29 -1

No files matched your search

+7
View File
@@ -65,6 +65,13 @@ Cloudflare DNS after asking for a scoped API token through a hidden prompt. It
previews the records before making changes and never stores the token. The token
needs `Zone:Read` and `DNS:Edit` for the selected zone.
Create the token from the
[Cloudflare API Tokens dashboard](https://dash.cloudflare.com/profile/api-tokens),
choose **Create Custom Token**, grant `Zone → Zone → Read` and
`Zone → DNS → Edit`, and restrict its resources to the specific mail zone. Do
not use the Global API Key. The installer prints these instructions before its
hidden token prompt.
Automatic DNS setup creates or updates the mail-host A/AAAA record, the primary
MX record, and autoconfiguration CNAMEs. It adds monitoring-mode DMARC and a
soft-fail SPF default only when those policies do not already exist. It cannot
+6
View File
@@ -47,6 +47,12 @@ process and is not written to disk or placed in a command argument. Before
changing DNS, the installer shows the selected zone, detected public addresses,
and complete record plan for confirmation.
The prompt links directly to the
[Cloudflare API Tokens dashboard](https://dash.cloudflare.com/profile/api-tokens).
Choose **Create Custom Token**, add `Zone → Zone → Read` and
`Zone → DNS → Edit`, and restrict **Zone Resources** to the selected zone. A
Global API Key is neither required nor recommended.
It manages the mail hostname's unproxied A/AAAA records, the zone MX record, and
the `autoconfig` and `autodiscover` CNAMEs. Existing SPF and DMARC policies are
preserved; conservative defaults are created only when no corresponding policy
+16 -1
View File
@@ -411,7 +411,22 @@ configure_cloudflare_dns() {
CF_API_TOKEN="${CLOUDFLARE_API_TOKEN:-}"
unset CLOUDFLARE_API_TOKEN || true
if [[ -z "$CF_API_TOKEN" ]] && [[ -t 0 ]]; then
read -r -s -p "Cloudflare API token (Zone:Read and DNS:Edit): " CF_API_TOKEN
cat <<EOF
Create a scoped Cloudflare API token here:
https://dash.cloudflare.com/profile/api-tokens
Select "Create Custom Token" and configure:
Permissions:
Zone | Zone | Read
Zone | DNS | Edit
Zone Resources:
Include | Specific zone | $DNS_ZONE
Do not use the Global API Key. Paste the newly created token below; input is
hidden and the token is used only for this installation process.
EOF
read -r -s -p "Cloudflare API token (hidden): " CF_API_TOKEN
printf '\n'
fi
[[ -n "$CF_API_TOKEN" ]] || \