-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'alert-2.0' into alert-2.0-status-update
- Loading branch information
Showing
40 changed files
with
4,063 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,5 @@ pcr-backup* | |
./Pipfile | ||
./Pipfile.lock | ||
./package.json | ||
./yarn.lock | ||
./yarn.lock | ||
*.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,5 +23,9 @@ dist-ssr | |
*.sln | ||
*.sw? | ||
|
||
*.env | ||
|
||
.terraform | ||
*.tfstate* | ||
*.tfstate | ||
*.tfstate.backup | ||
>>>>>>> alert-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + React + TS</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Penn Course Alert 2.0</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,76 @@ | ||
import * as React from "react" | ||
import * as React from 'react' | ||
|
||
import { cn } from "@/lib/utils" | ||
import { cn } from '@/lib/utils' | ||
|
||
const Card = React.forwardRef< | ||
HTMLDivElement, | ||
React.HTMLAttributes<HTMLDivElement> | ||
HTMLDivElement, | ||
React.HTMLAttributes<HTMLDivElement> | ||
>(({ className, ...props }, ref) => ( | ||
<div | ||
ref={ref} | ||
className={cn( | ||
"rounded-xl border bg-card text-card-foreground shadow", | ||
className | ||
)} | ||
{...props} | ||
/> | ||
<div | ||
ref={ref} | ||
className={cn( | ||
'rounded-xl border bg-card text-card-foreground shadow', | ||
className, | ||
)} | ||
{...props} | ||
/> | ||
)) | ||
Card.displayName = "Card" | ||
Card.displayName = 'Card' | ||
|
||
const CardHeader = React.forwardRef< | ||
HTMLDivElement, | ||
React.HTMLAttributes<HTMLDivElement> | ||
HTMLDivElement, | ||
React.HTMLAttributes<HTMLDivElement> | ||
>(({ className, ...props }, ref) => ( | ||
<div | ||
ref={ref} | ||
className={cn("flex flex-col space-y-1.5 p-6", className)} | ||
{...props} | ||
/> | ||
<div | ||
ref={ref} | ||
className={cn('flex flex-col space-y-1.5 p-6', className)} | ||
{...props} | ||
/> | ||
)) | ||
CardHeader.displayName = "CardHeader" | ||
CardHeader.displayName = 'CardHeader' | ||
|
||
const CardTitle = React.forwardRef< | ||
HTMLParagraphElement, | ||
React.HTMLAttributes<HTMLHeadingElement> | ||
HTMLParagraphElement, | ||
React.HTMLAttributes<HTMLHeadingElement> | ||
>(({ className, ...props }, ref) => ( | ||
<h3 | ||
ref={ref} | ||
className={cn("font-semibold leading-none tracking-tight", className)} | ||
{...props} | ||
/> | ||
<h3 | ||
ref={ref} | ||
className={cn('font-semibold leading-none tracking-tight', className)} | ||
{...props} | ||
/> | ||
)) | ||
CardTitle.displayName = "CardTitle" | ||
CardTitle.displayName = 'CardTitle' | ||
|
||
const CardDescription = React.forwardRef< | ||
HTMLParagraphElement, | ||
React.HTMLAttributes<HTMLParagraphElement> | ||
HTMLParagraphElement, | ||
React.HTMLAttributes<HTMLParagraphElement> | ||
>(({ className, ...props }, ref) => ( | ||
<p | ||
ref={ref} | ||
className={cn("text-sm text-muted-foreground", className)} | ||
{...props} | ||
/> | ||
<p | ||
ref={ref} | ||
className={cn('text-sm text-muted-foreground', className)} | ||
{...props} | ||
/> | ||
)) | ||
CardDescription.displayName = "CardDescription" | ||
CardDescription.displayName = 'CardDescription' | ||
|
||
const CardContent = React.forwardRef< | ||
HTMLDivElement, | ||
React.HTMLAttributes<HTMLDivElement> | ||
HTMLDivElement, | ||
React.HTMLAttributes<HTMLDivElement> | ||
>(({ className, ...props }, ref) => ( | ||
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} /> | ||
<div ref={ref} className={cn('p-6 pt-0', className)} {...props} /> | ||
)) | ||
CardContent.displayName = "CardContent" | ||
CardContent.displayName = 'CardContent' | ||
|
||
const CardFooter = React.forwardRef< | ||
HTMLDivElement, | ||
React.HTMLAttributes<HTMLDivElement> | ||
HTMLDivElement, | ||
React.HTMLAttributes<HTMLDivElement> | ||
>(({ className, ...props }, ref) => ( | ||
<div | ||
ref={ref} | ||
className={cn("flex items-center p-6 pt-0", className)} | ||
{...props} | ||
/> | ||
<div | ||
ref={ref} | ||
className={cn('flex items-center p-6 pt-0', className)} | ||
{...props} | ||
/> | ||
)) | ||
CardFooter.displayName = "CardFooter" | ||
CardFooter.displayName = 'CardFooter' | ||
|
||
export { Card, CardContent,CardDescription, CardFooter, CardHeader, CardTitle } | ||
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
resource "aws_acm_certificate" "website" { | ||
domain_name = "staging.penncoursealert.com" | ||
validation_method = "DNS" | ||
} | ||
|
||
resource "aws_route53_record" "website_cert" { | ||
for_each = { | ||
for dvo in aws_acm_certificate.website.domain_validation_options : dvo.domain_name => { | ||
name = dvo.resource_record_name | ||
record = dvo.resource_record_value | ||
type = dvo.resource_record_type | ||
} | ||
} | ||
|
||
allow_overwrite = true | ||
name = each.value.name | ||
records = [each.value.record] | ||
ttl = 60 | ||
type = each.value.type | ||
zone_id = data.aws_route53_zone.penncoursealert.id | ||
} | ||
|
||
resource "aws_acm_certificate_validation" "website" { | ||
certificate_arn = aws_acm_certificate.website.arn | ||
validation_record_fqdns = [for record in aws_route53_record.website_cert : record.fqdn] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
resource "aws_cloudfront_origin_access_control" "website" { | ||
name = "org_pennlabs_course_alert" | ||
description = "Origin Access Control for Penn Course Alert" | ||
origin_access_control_origin_type = "s3" | ||
signing_behavior = "always" | ||
signing_protocol = "sigv4" | ||
} | ||
|
||
resource "aws_cloudfront_cache_policy" "website" { | ||
name = "org_pennlabs_course_alert" | ||
default_ttl = 0 | ||
max_ttl = 0 | ||
min_ttl = 0 | ||
parameters_in_cache_key_and_forwarded_to_origin { | ||
cookies_config { | ||
cookie_behavior = "none" | ||
} | ||
headers_config { | ||
header_behavior = "none" | ||
} | ||
query_strings_config { | ||
query_string_behavior = "none" | ||
} | ||
} | ||
} | ||
|
||
resource "aws_cloudfront_distribution" "website" { | ||
origin { | ||
domain_name = aws_s3_bucket.website.bucket_regional_domain_name | ||
origin_access_control_id = aws_cloudfront_origin_access_control.website.id | ||
origin_id = "s3-${aws_s3_bucket.website.bucket}" | ||
} | ||
|
||
enabled = true | ||
|
||
comment = "Penn Course Alert" | ||
default_root_object = "index.html" | ||
|
||
custom_error_response { | ||
error_caching_min_ttl = 0 | ||
error_code = 404 | ||
response_code = 200 | ||
response_page_path = "/index.html" | ||
} | ||
|
||
aliases = ["staging.penncoursealert.com"] | ||
default_cache_behavior { | ||
allowed_methods = ["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"] | ||
cached_methods = ["GET", "HEAD"] | ||
target_origin_id = "s3-${aws_s3_bucket.website.bucket}" | ||
viewer_protocol_policy = "redirect-to-https" | ||
cache_policy_id = aws_cloudfront_cache_policy.website.id | ||
} | ||
price_class = "PriceClass_100" | ||
restrictions { | ||
geo_restriction { | ||
restriction_type = "none" | ||
} | ||
} | ||
tags = { | ||
Environment = "staging" | ||
} | ||
viewer_certificate { | ||
acm_certificate_arn = aws_acm_certificate.website.arn | ||
ssl_support_method = "sni-only" | ||
} | ||
} | ||
|
||
resource "aws_s3_bucket_policy" "website" { | ||
bucket = aws_s3_bucket.website.bucket | ||
policy = jsonencode({ | ||
Version = "2012-10-17" | ||
Statement = [ | ||
{ | ||
Effect = "Allow" | ||
Principal = { | ||
Service = "cloudfront.amazonaws.com" | ||
} | ||
Action = [ | ||
"s3:GetObject", | ||
"s3:ListBucket" | ||
] | ||
Resource = [ | ||
aws_s3_bucket.website.arn, | ||
"${aws_s3_bucket.website.arn}/*" | ||
] | ||
Condition = { | ||
StringEquals = { | ||
"AWS:SourceArn" : aws_cloudfront_distribution.website.arn | ||
} | ||
} | ||
} | ||
] | ||
}) | ||
} |
Oops, something went wrong.