From e0a3fd49da6dfa83854a04de482f8c273d961c33 Mon Sep 17 00:00:00 2001 From: Meghdad <61308304+MeghdadFadaee@users.noreply.github.com> Date: Thu, 13 Aug 2026 03:50:10 +0330 Subject: [PATCH] docs(installer): clarify Cloudflare token creation --- README.md | 7 +++++++ docs/nginx-certbot.md | 6 ++++++ scripts/install-server.sh | 17 ++++++++++++++++- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0b791d9..98519fd 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/nginx-certbot.md b/docs/nginx-certbot.md index 01850b6..7b8bbb1 100644 --- a/docs/nginx-certbot.md +++ b/docs/nginx-certbot.md @@ -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 diff --git a/scripts/install-server.sh b/scripts/install-server.sh index 8bfa586..f4bf923 100755 --- a/scripts/install-server.sh +++ b/scripts/install-server.sh @@ -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 <