@cryptotaxi247 / infra / commits / 040fb831

add wiki-test fastly configuration

Jörg Thalheim committed Sep 27, 2025 at 15:56 UTC 040fb83197af0c9b5252b6b24a364f6961cd8779
2 files changed +70
dns/nixos.org.js
+7
@@ -151,6 +151,9 @@ D("nixos.org",
151 // wiki
152 A("wiki", "65.21.240.250"),
153 AAAA("wiki", "2a01:4f9:c012:8178::"),
154 + // Direct access to wiki server in Helsinki (for deployments)
155 + A("he1.wiki", "65.21.240.250"),
156 + AAAA("he1.wiki", "2a01:4f9:c012:8178::"),
157 DMARC_BUILDER({
158 label: "wiki",
159 policy: "none"
@@ -166,6 +169,10 @@ D("nixos.org",
169 }),
170 TXT("mail._domainkey.wiki", "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDa+KjIljYr3q5MWWK7sEYzjR8OcA32zBh9BCPo6/HlY1q2ODTYsmE/FDZWpYMzM5z+ddnuGYdXia322XnZaNpZNoq1TbGYuQ5DsgAEK09CGoLuzONg3PSXTrkG7E2Sd6wstwHGJ5FHxSLKtNoWkknt9F5XAFZgXapO0w54p+BWvwIDAQAB"),
171
172 + // test.wiki subdomain with Fastly
173 + CNAME("test.wiki", "dualstack.v2.shared.global.fastly.net."),
174 + CNAME("_acme-challenge.test.wiki", "zsz0meyel8hxoy9dtb.fastly-validations.com."),
175 +
176 // cloudflare pages
177 CNAME("20th", "20th-nix.pages.dev."),
178
terraform/wiki-test.tf new
+63
@@ -0,0 +1,63 @@
1 +locals {
2 + wiki_test_domain = "test.wiki.nixos.org"
3 +}
4 +
5 +resource "fastly_service_vcl" "wiki-test" {
6 + name = local.wiki_test_domain
7 + default_ttl = 86400
8 +
9 + backend {
10 + address = "he1.wiki.nixos.org"
11 + auto_loadbalance = false
12 + between_bytes_timeout = 10000
13 + connect_timeout = 5000
14 + error_threshold = 0
15 + first_byte_timeout = 15000
16 + max_conn = 200
17 + name = "wiki_backend"
18 + port = 443
19 + # Shield location for Helsinki backend
20 + shield = "hel-helsinki-fi"
21 + ssl_cert_hostname = "he1.wiki.nixos.org"
22 + ssl_check_cert = true
23 + use_ssl = true
24 + weight = 100
25 + }
26 +
27 + domain {
28 + name = local.wiki_test_domain
29 + }
30 +
31 + # Pass through the original Host header
32 + header {
33 + destination = "http.Host"
34 + type = "request"
35 + action = "set"
36 + name = "Set Host Header"
37 + source = "\"wiki.nixos.org\""
38 + }
39 +
40 + logging_s3 {
41 + name = "${local.wiki_test_domain}-to-s3"
42 + bucket_name = local.fastlylogs["bucket_name"]
43 + compression_codec = "zstd"
44 + domain = local.fastlylogs["s3_domain"]
45 + format = local.fastlylogs["format"]
46 + format_version = 2
47 + path = "${local.wiki_test_domain}/"
48 + period = local.fastlylogs["period"]
49 + message_type = "blank"
50 + s3_iam_role = local.fastlylogs["iam_role_arn"]
51 + }
52 +}
53 +
54 +resource "fastly_tls_subscription" "wiki-test" {
55 + domains = [for domain in fastly_service_vcl.wiki-test.domain : domain.name]
56 + configuration_id = local.fastly_tls12_sni_configuration_id
57 + certificate_authority = "lets-encrypt"
58 +}
59 +
60 +output "wiki_test_acme_challenge" {
61 + value = fastly_tls_subscription.wiki-test.managed_dns_challenges
62 + description = "ACME challenge records for test.wiki.nixos.org - add these to DNS"
63 +}