blob: 4786d28e8343a543e14551d2cda3fe3f48fc90b9 [file] [log] [blame]
Matthias Andreas Benkardad5f1cd2026-11-15 19:23:02 +01001* GitLab Pages
2
3 Status: *not enabled yet.* =gitlab.yaml= has no =pages= settings. This
4 section records what is needed and the chosen way around the missing
5 DNS-01 support at Regfish.
6
7** Requirements
8 - Chart values (=global.pages=, =global.hosts.pages=,
9 =gitlab.gitlab-pages=) in the GitLab CR, =gitlab.yaml=.
10 - A =gitlab-pages= bucket in Garage. The existing
11 =gitlab-object-storage= connection is reused.
12 - A wildcard A/AAAA record =*.<pages-domain>= pointing at ifirn.
13 - A wildcard TLS certificate for =*.<pages-domain>=. Wildcards require
14 DNS-01, because HTTP-01 (as used with Traefik) cannot issue them.
15 - A runner (=gitlab-runner/=) and a =pages= job publishing =public/=
16 in each project.
17
18 Prefer a Pages domain that is /not/ a subdomain of
19 =gitlab.benkard.de= (cookie isolation), e.g. =pages.benkard.de=.
20
21** The Regfish problem
22 Regfish cannot be used for DNS-01 (no usable API for cert-manager).
23 DNS-01 does not need the registrar's API, though, only that the
24 =_acme-challenge= name resolves into a zone we can update
25 automatically.
26
27*** Option 1 (recommended): CNAME delegation of the challenge
28 - At Regfish, add once:
29 #+BEGIN_SRC text
30 _acme-challenge.pages.benkard.de. CNAME <name>.<challenge-zone>.
31 #+END_SRC
32 - Host =<challenge-zone>= at a provider with an API and a cert-manager
33 solver or webhook (Cloudflare free tier, deSEC, Route53), or run
34 [[https://github.com/joohoi/acme-dns][acme-dns]] ourselves (needs
35 port 53 reachable and an NS delegation).
36 - The DNS-01 solver in the =ClusterIssuer= must set
37 =cnameStrategy: Follow=.
38 - Only the challenge zone moves. Everything else stays at Regfish,
39 including the =*.pages= A/AAAA record.
40
41*** Option 2: NS delegation of the whole Pages domain
42 Delegate =pages.benkard.de= via NS records to a nameserver we control
43 or a free DNS provider. The wildcard record and the challenge both
44 live there. Cleaner separation, but more to run.
45
46*** Option 3: per-site certificates
47 Only works for custom domains (GitLab requests one Let's Encrypt
48 certificate per domain). The default =*.pages= domain still needs a
49 wildcard certificate or plain HTTP.
50
51*** Option 4: plain HTTP or a self-signed wildcard
52 Only for private use. Browsers warn, or traffic is unencrypted.
53
54** Plan (option 1)
55 1. Add the CNAME at Regfish.
56 2. Create the challenge zone and an API token at the chosen provider,
57 and store the token as a Secret in the cert-manager namespace.
58 3. Add a DNS-01 =ClusterIssuer= (=cnameStrategy: Follow=).
59 4. Add a =Certificate= for =*.pages.benkard.de= writing the secret
60 =gitlab-pages-tls=.
61 5. Create the =gitlab-pages= bucket in Garage.
62 6. Add to the CR in =gitlab.yaml=:
63 #+BEGIN_SRC yaml
64 global:
65 pages:
66 enabled: true
67 objectStore:
68 enabled: true
69 bucket: gitlab-pages
70 accessControl: false
71 artifactsServer: true
72 hosts:
73 pages:
74 name: pages.benkard.de
75 gitlab:
76 gitlab-pages:
77 ingress:
78 tls:
79 secretName: gitlab-pages-tls
80 #+END_SRC
81 7. Add the =*.pages= wildcard A/AAAA record at Regfish.
82 8. Check that the global per-IP Traefik =rateLimit= does not throttle
83 Pages sites with many assets.
84
85** Open decisions
86 - Pages domain (=pages.benkard.de= assumed).
87 - Challenge-zone provider (Cloudflare, deSEC or self-hosted acme-dns).
88 - Custom domains: not planned. They would need port 80/443 reachable
89 by the Pages service directly, which is awkward behind Traefik.