mykiwi/mykiwi.blogpublic Fork 0
a74fe0a29252e8de5b737ff5cf56888380055981
Commits
Clone
git clone https://git.rickub.com/mykiwi/mykiwi.blog.git
git clone ssh://git@rickub.com/mykiwi/mykiwi.blog.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

README.md · 46 lines · 1.3 KBmarkdown Blame HistoryRaw
Add Cloudflare provisioning and deploy tooling e4c5d34 Romain Gautier 14h ago1# infra
2
3OpenTofu config for the Cloudflare side of the multihost setup in
4`blog/hugo.toml`: one Cloudflare Pages project, custom domain, and DNS
5record per language (`mykiwi.blog`, `fr.mykiwi.blog`, `pt.mykiwi.blog`,
6`ja.mykiwi.blog`). It assumes `mykiwi.blog` is already a zone in your
7Cloudflare account - this only manages what's *inside* that zone.
8
9Deploys (`wrangler pages deploy public/<lang> --project-name=...`) are out
10of scope here; this just provisions the projects and domains deploys land
11on.
12
13## Setup
14
15Create a token at https://dash.cloudflare.com/profile/api-tokens (Custom
16Token, scoped to the `mykiwi.blog` zone) with `Zone:DNS:Edit`,
17`Zone:Zone:Read`, and `Account:Cloudflare Pages:Edit`, then:
18
19```sh
20export CLOUDFLARE_API_TOKEN=...
21```
22
23`cloudflare_account_id` is hardcoded in `variables.tf` (it's not a secret -
24just an identifier) - override it with `-var` if you're ever applying
25against a different account.
26
27## Usage
28
29From the repo root:
30
31```sh
32make infra-plan
33make infra-apply
34```
35
36Or directly, from this directory (`nix develop .#infra` for `tofu`):
37
38```sh
39tofu init
40tofu plan
41tofu apply
42```
43
44State is local (`terraform.tfstate`, gitignored) - fine for a single person
45operating this. If that ever changes, move the backend to something shared
46(e.g. an R2 bucket) before a second person touches this.