CloudFlare integration enables to automatically create hostnames (sub-domains) for a given DNS zone. It allows to create/destroy multiple hostnames associated with a Chevereto container running in the same server.
It creates CNAMEs pointing to an A record which points to the server. This enables CNAMEs to point to the same server IP by controlling just one record.
A demo.chevereto.cloud -> <SERVER IP>
CNAME user1.chevereto.cloud -> demo.chevereto.cloud
CNAME user2.chevereto.cloud -> demo.chevereto.cloud
...etc
- Go to your CloudFlare domain DNS
- Create an A record pointing to server IP (DNS only, do not cache)
- Get an API token for the DNS zone
- Copy .env-stock to
.env
and fill in the values
CLOUDFLARE_TOKEN=
CLOUDFLARE_ZONE_ID=
CLOUDFLARE_ACCOUNT_ID=
CLOUDFLARE_A_NAME=
CLOUDFLARE_TOKEN
- Go to api-tokens and go to Create Token
- Use template Edit zone DNS
- Permissions: Zone DNS Edit
- Resources: Include Specific zone DOMAIN
- Continue to summary and Create Token
You get these values from domain overview.
CLOUDFLARE_A_NAME
The A record used to point CNAMEs generated by this project.
Note: Following commands must run only after creating the NAMESPACE.
Refer to make destroy.
make cloudflare--create NAMESPACE=yourproject
make cloudflare--delete NAMESPACE=yourproject