From d6985a80e82ee671a562866d7ed978c6f6e1b659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Wed, 4 Dec 2024 12:02:25 +0000 Subject: [PATCH] fix: nit (#10392) i'm an idiot, but since I'm here I'll set up the redirect too --- iac/main.tf | 49 ++++++++++++++++++ spartan/releases/{rough-rhino => }/.gitignore | 0 spartan/releases/{rough-rhino => }/README.md | 2 +- .../{rough-rhino => }/assets/banner.jpeg | Bin .../{rough-rhino => }/create-spartan.sh | 2 +- 5 files changed, 51 insertions(+), 2 deletions(-) rename spartan/releases/{rough-rhino => }/.gitignore (100%) rename spartan/releases/{rough-rhino => }/README.md (98%) rename spartan/releases/{rough-rhino => }/assets/banner.jpeg (100%) rename spartan/releases/{rough-rhino => }/create-spartan.sh (85%) diff --git a/iac/main.tf b/iac/main.tf index 5e1dec466d6..46b145be06a 100644 --- a/iac/main.tf +++ b/iac/main.tf @@ -125,3 +125,52 @@ resource "aws_route53_record" "static" { evaluate_target_health = true } } + +resource "aws_s3_bucket" "sp_testnet_redirect" { + bucket = "sp-testnet.aztec.network" + + website { + redirect_all_requests_to { + host_name = "github.com" + protocol = "https" + path = "/AztecProtocol/aztec-packages/refs/heads/master/spartan/releases/create-spartan.sh" + } + } +} + +resource "aws_s3_bucket_public_access_block" "sp_testnet_public_access" { + bucket = aws_s3_bucket.sp_testnet_redirect.id + + block_public_acls = false + block_public_policy = false + ignore_public_acls = false + restrict_public_buckets = false +} + +resource "aws_s3_bucket_policy" "sp_testnet_policy" { + bucket = aws_s3_bucket.sp_testnet_redirect.id + + policy = jsonencode({ + Version = "2012-10-17" + Statement = [ + { + Effect = "Allow" + Principal = "*" + Action = "s3:GetObject" + Resource = "arn:aws:s3:::${aws_s3_bucket.sp_testnet_redirect.id}/*" + } + ] + }) +} + +resource "aws_route53_record" "sp_testnet" { + zone_id = data.terraform_remote_state.aztec2_iac.outputs.aws_route53_zone_id + name = "sp-testnet.aztec.network" + type = "A" + + alias { + name = aws_s3_bucket.sp_testnet_redirect.website_domain + zone_id = aws_s3_bucket.sp_testnet_redirect.hosted_zone_id + evaluate_target_health = true + } +} diff --git a/spartan/releases/rough-rhino/.gitignore b/spartan/releases/.gitignore similarity index 100% rename from spartan/releases/rough-rhino/.gitignore rename to spartan/releases/.gitignore diff --git a/spartan/releases/rough-rhino/README.md b/spartan/releases/README.md similarity index 98% rename from spartan/releases/rough-rhino/README.md rename to spartan/releases/README.md index 7e64b12a3aa..527762ae112 100644 --- a/spartan/releases/rough-rhino/README.md +++ b/spartan/releases/README.md @@ -18,7 +18,7 @@ It should work in most UNIX-based machines. To configure a new node, create a new directory and run the install script: ```bash -cd val1 +mkdir val1 && cd val1 curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/master/spartan/releases/rough-rhino/create-spartan.sh | bash ``` diff --git a/spartan/releases/rough-rhino/assets/banner.jpeg b/spartan/releases/assets/banner.jpeg similarity index 100% rename from spartan/releases/rough-rhino/assets/banner.jpeg rename to spartan/releases/assets/banner.jpeg diff --git a/spartan/releases/rough-rhino/create-spartan.sh b/spartan/releases/create-spartan.sh similarity index 85% rename from spartan/releases/rough-rhino/create-spartan.sh rename to spartan/releases/create-spartan.sh index 870263926eb..7fd1dd89d3b 100755 --- a/spartan/releases/rough-rhino/create-spartan.sh +++ b/spartan/releases/create-spartan.sh @@ -1,7 +1,7 @@ #!/bin/bash # URL of the aztec-spartan.sh script -DEFAULT_URL="https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/zpedro/testnet_docker_compose/spartan/releases/rough-rhino/aztec-spartan.sh" +DEFAULT_URL="https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/master/spartan/releases/rough-rhino/aztec-spartan.sh" # Colors for output GREEN='\033[0;32m'