Skip to content

Commit f678213

Browse files
committed
add wiki-test fastly configuration
1 parent 13230e2 commit f678213

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

dns/nixos.org.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ D("nixos.org",
148148
// wiki
149149
A("wiki", "65.21.240.250"),
150150
AAAA("wiki", "2a01:4f9:c012:8178::"),
151+
// Direct access to wiki server in Helsinki (for deployments)
152+
A("he1.wiki", "65.21.240.250"),
153+
AAAA("he1.wiki", "2a01:4f9:c012:8178::"),
151154
DMARC_BUILDER({
152155
label: "wiki",
153156
policy: "none"
@@ -163,6 +166,10 @@ D("nixos.org",
163166
}),
164167
TXT("mail._domainkey.wiki", "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDa+KjIljYr3q5MWWK7sEYzjR8OcA32zBh9BCPo6/HlY1q2ODTYsmE/FDZWpYMzM5z+ddnuGYdXia322XnZaNpZNoq1TbGYuQ5DsgAEK09CGoLuzONg3PSXTrkG7E2Sd6wstwHGJ5FHxSLKtNoWkknt9F5XAFZgXapO0w54p+BWvwIDAQAB"),
165168

169+
// test.wiki subdomain with Fastly
170+
CNAME("test.wiki", "dualstack.v2.shared.global.fastly.net."),
171+
CNAME("_acme-challenge.test.wiki", "zsz0meyel8hxoy9dtb.fastly-validations.com."),
172+
166173
// cloudflare pages
167174
CNAME("20th", "20th-nix.pages.dev."),
168175

terraform/wiki-test.tf

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
}

0 commit comments

Comments
 (0)