diff --git a/infrastructure/Caddyfile b/infrastructure/Caddyfile index 9958540..1a8a3f2 100644 --- a/infrastructure/Caddyfile +++ b/infrastructure/Caddyfile @@ -2,6 +2,10 @@ reverse_proxy journal:3000 } +www.{$DOMAIN:trails.cool} { + redir https://{$DOMAIN:trails.cool}{uri} permanent +} + planner.{$DOMAIN:trails.cool} { reverse_proxy planner:3001 } diff --git a/infrastructure/terraform/main.tf b/infrastructure/terraform/main.tf index 08a8264..a5f14ff 100644 --- a/infrastructure/terraform/main.tf +++ b/infrastructure/terraform/main.tf @@ -84,6 +84,14 @@ resource "hcloud_zone_rrset" "root_a" { records = [{ value = hcloud_server.trails.ipv4_address }] } +resource "hcloud_zone_rrset" "root_aaaa" { + zone = "trails.cool" + name = "@" + type = "AAAA" + ttl = 300 + records = [{ value = hcloud_server.trails.ipv6_address }] +} + resource "hcloud_zone_rrset" "planner_a" { zone = "trails.cool" name = "planner" @@ -92,6 +100,22 @@ resource "hcloud_zone_rrset" "planner_a" { records = [{ value = hcloud_server.trails.ipv4_address }] } +resource "hcloud_zone_rrset" "planner_aaaa" { + zone = "trails.cool" + name = "planner" + type = "AAAA" + ttl = 300 + records = [{ value = hcloud_server.trails.ipv6_address }] +} + +resource "hcloud_zone_rrset" "www_cname" { + zone = "trails.cool" + name = "www" + type = "CNAME" + ttl = 300 + records = [{ value = "trails.cool." }] +} + # Outputs output "server_ip" {