Skip to content

Latest commit

 

History

History
70 lines (46 loc) · 1.7 KB

CLOUDFLARE.md

File metadata and controls

70 lines (46 loc) · 1.7 KB

CloudFlare

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.

How it works?

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

Setup

  • 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

.env file

CLOUDFLARE_TOKEN=
CLOUDFLARE_ZONE_ID=
CLOUDFLARE_ACCOUNT_ID=
CLOUDFLARE_A_NAME=

CloudFlare Token

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

CloudFlare Zone/Account ID

You get these values from domain overview.

CloudFlare A Name

CLOUDFLARE_A_NAME

The A record used to point CNAMEs generated by this project.

Commands

Note: Following commands must run only after creating the NAMESPACE.

Destroy instance

Refer to make destroy.

Create CNAME record

make cloudflare--create NAMESPACE=yourproject

Delete CNAME record

make cloudflare--delete NAMESPACE=yourproject