mykiwi/mykiwi.blogpublic Fork 0
b9bda7a8b01c38c6369f1e073f36bb851049f34b
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 · 48 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`,
Add Spanish (es) language support 479f7e2 Romain Gautier 10h ago6`ja.mykiwi.blog`, `es.mykiwi.blog`). It assumes `mykiwi.blog` is already
7a zone in your Cloudflare account - this only manages what's *inside*
8that zone.
Add Cloudflare provisioning and deploy tooling e4c5d34 Romain Gautier 14h ago9
10Deploys (`wrangler pages deploy public/<lang> --project-name=...`) are out
11of scope here; this just provisions the projects and domains deploys land
12on.
13
14## Setup
15
16Create a token at https://dash.cloudflare.com/profile/api-tokens (Custom
17Token, scoped to the `mykiwi.blog` zone) with `Zone:DNS:Edit`,
Migrate www redirect from Page Rules to Single Redirects b9bda7a Romain Gautier 10h ago18`Zone:Zone:Read`, `Zone:Dynamic Redirect:Edit`, and
19`Account:Cloudflare Pages:Edit`, then:
Add Cloudflare provisioning and deploy tooling e4c5d34 Romain Gautier 14h ago20
21```sh
22export CLOUDFLARE_API_TOKEN=...
23```
24
25`cloudflare_account_id` is hardcoded in `variables.tf` (it's not a secret -
26just an identifier) - override it with `-var` if you're ever applying
27against a different account.
28
29## Usage
30
31From the repo root:
32
33```sh
34make infra-plan
35make infra-apply
36```
37
38Or directly, from this directory (`nix develop .#infra` for `tofu`):
39
40```sh
41tofu init
42tofu plan
43tofu apply
44```
45
46State is local (`terraform.tfstate`, gitignored) - fine for a single person
47operating this. If that ever changes, move the backend to something shared
48(e.g. an R2 bucket) before a second person touches this.