/cloudflare-add-multiple-sites

To add multiple sites to Cloudflare at once and more efficiently, you can do so via the Cloudflare API.

Primary LanguageShellMIT LicenseMIT

Add Multiple Sites to Cloudflare

To add multiple sites to Cloudflare at once and more efficiently, you can do so via the Cloudflare API.

Get Started

  1. Create an .env file in the root directory containing Cloudflare API Key information. You can copy the content from the .env.example file.
CLOUDFLARE_EMAIL=YOUR_EMAIL

# Ref: https://developers.cloudflare.com/fundamentals/api/get-started/keys/
CLOUDFLARE_API_KEY=YOUR_API_KEY

# Ref: https://developers.cloudflare.com/fundamentals/setup/find-account-and-zone-ids/
ACCOUNT_ID=YOUR_ACCOUNT_ID

# IMPORTANT: Last line must be empty
  1. Create a domains.txt file in the root directory that includes the domains that need to be added to Cloudflare, each domain name on a separate line (newline separated). For example:
example.com
example.net
example.org

Please read the Limitations section carefully.

  1. Open Terminal and run the following command:
./add-multiple-zones.sh

Acknowledgments