~repos /website

#astro#js#html#css

git clone https://pyrossh.dev/repos/website.git

木 Personal website of pyrossh. Built with astrojs, shiki, vite.


a828af66 pyrossh

3 weeks ago
update alchemy and fix csp
.alchemy/prd/s3-distribution-prd.json CHANGED
@@ -46,6 +46,9 @@
46
46
  ],
47
47
  "Enabled": true,
48
48
  "IPV6Enabled": true,
49
+ "Aliases": [
50
+ "pyrossh.dev"
51
+ ],
49
52
  "DefaultRootObject": "index.html",
50
53
  "CustomErrorResponses": [
51
54
  {
@@ -197,13 +200,13 @@
197
200
  }
198
201
  },
199
202
  "ViewerCertificate": {
200
- "CloudFrontDefaultCertificate": true
203
+ "AcmCertificateArn": "arn:aws:acm:us-east-1:122129753516:certificate/d04cd0a5-623c-4d18-a9d1-f0d8df3e999d"
201
204
  },
202
205
  "Comment": "ProvisionedBy Alchemy - prd"
203
206
  }
204
207
  },
205
208
  "id": "E2IM0M1RNCBSHJ",
206
- "createdAt": 1763311895769,
209
+ "createdAt": 1763356393060,
207
210
  "DistributionConfig": {
208
211
  "Logging": {
209
212
  "IncludeCookies": false,
@@ -249,7 +252,8 @@
249
252
  "ViewerCertificate": {
250
253
  "SslSupportMethod": "vip",
251
254
  "MinimumProtocolVersion": "TLSv1",
252
- "CloudFrontDefaultCertificate": true
255
+ "CloudFrontDefaultCertificate": false,
256
+ "AcmCertificateArn": "arn:aws:acm:us-east-1:122129753516:certificate/d04cd0a5-623c-4d18-a9d1-f0d8df3e999d"
253
257
  },
254
258
  "PriceClass": "PriceClass_All",
255
259
  "DefaultCacheBehavior": {
@@ -365,7 +369,9 @@
365
369
  "Items": []
366
370
  },
367
371
  "Enabled": true,
368
- "Aliases": [],
372
+ "Aliases": [
373
+ "pyrossh.dev"
374
+ ],
369
375
  "IPV6Enabled": true,
370
376
  "WebACLId": "",
371
377
  "HttpVersion": "http1.1",
@@ -491,6 +497,9 @@
491
497
  ],
492
498
  "Enabled": true,
493
499
  "IPV6Enabled": true,
500
+ "Aliases": [
501
+ "pyrossh.dev"
502
+ ],
494
503
  "DefaultRootObject": "index.html",
495
504
  "CustomErrorResponses": [
496
505
  {
@@ -642,7 +651,7 @@
642
651
  }
643
652
  },
644
653
  "ViewerCertificate": {
645
- "CloudFrontDefaultCertificate": true
654
+ "AcmCertificateArn": "arn:aws:acm:us-east-1:122129753516:certificate/d04cd0a5-623c-4d18-a9d1-f0d8df3e999d"
646
655
  },
647
656
  "Comment": "ProvisionedBy Alchemy - prd"
648
657
  }
alchemy.run.ts CHANGED
@@ -1,19 +1,3 @@
1
- /**
2
- * Alchemy Infrastructure Configuration for pyrossh.dev
3
- *
4
- * Converted from Terraform (main.tf) to Alchemy
5
- *
6
- * This configuration sets up:
7
- * - Route53 hosted zone for pyrossh.dev
8
- * - S3 buckets for website and git repos
9
- * - CloudFront distribution with custom functions
10
- * - S3 bucket policies for CloudFront access
11
- * - Route53 A record pointing to CloudFront
12
- *
13
- * Note: ACM Certificate creation is commented out. You'll need to:
14
- * 1. Create the certificate manually in ACM (us-east-1 region)
15
- * 2. Uncomment and provide the certificate ARN in the ViewerCertificate config
16
- */
17
1
  import { $ } from "bun";
18
2
  import alchemy from "alchemy";
19
3
  import AWS from "alchemy/aws/control";
@@ -135,7 +119,7 @@ const s3Distribution = await AWS.CloudFront.Distribution(`s3-distribution-${app.
135
119
  ],
136
120
  Enabled: true,
137
121
  IPV6Enabled: true,
138
- // Aliases: [domainName],
122
+ Aliases: [domainName],
139
123
  DefaultRootObject: "index.html",
140
124
  CustomErrorResponses: [400, 403, 404, 405, 414, 416, 500, 501, 502, 503, 504].map(code => ({
141
125
  ErrorCode: code,
@@ -210,9 +194,14 @@ const s3Distribution = await AWS.CloudFront.Distribution(`s3-distribution-${app.
210
194
  RestrictionType: "none"
211
195
  }
212
196
  },
197
+ // resource "aws_acm_certificate" "domain_ssl_certificate" {
198
+ // domain_name = "pyrossh.dev"
199
+ // validation_method = "EMAIL"
200
+ // provider = aws.useast
201
+ // }
213
202
  ViewerCertificate: {
214
- CloudFrontDefaultCertificate: true,
203
+ // CloudFrontDefaultCertificate: true,
215
- // AcmCertificateArn: "arn:aws:acm:us-east-1:122129753516:certificate/d04cd0a5-623c-4d18-a9d1-f0d8df3e999d",
204
+ AcmCertificateArn: "arn:aws:acm:us-east-1:122129753516:certificate/d04cd0a5-623c-4d18-a9d1-f0d8df3e999d",
216
205
  // AcmCertificateArn: domainSslCertificate.CertificateArn,
217
206
  // SslSupportMethod: "sni-only"
218
207
  },
@@ -268,6 +257,16 @@ const reposBucketPolicy = await AWS.S3.BucketPolicy(`repos-bucket-policy-${app.s
268
257
  });
269
258
 
270
259
  // Route53 A Record
260
+ // console.log({
261
+ // HostedZoneId: hostedZone.Id,
262
+ // Name: domainName,
263
+ // Type: "A",
264
+ // AliasTarget: {
265
+ // DNSName: s3Distribution.DomainName,
266
+ // HostedZoneId: s3Distribution.DomainName, // CloudFront hosted zone ID
267
+ // EvaluateTargetHealth: false
268
+ // }
269
+ // })
271
270
  // const aRecordDomain = await AWS.Route53.RecordSet("a-record-domain", {
272
271
  // HostedZoneId: hostedZone.Id,
273
272
  // Name: domainName,
@@ -284,3 +283,4 @@ await $`rm -rf dist`
284
283
  await $`bun run build`
285
284
  await $`aws s3 sync --delete ./dist/ s3://${websiteBucket.BucketName}`
286
285
  await $`aws cloudfront create-invalidation --distribution-id ${s3Distribution.Id} --paths "/*" --no-cli-pager`
286
+ await $`rm -rf dist`
astro.config.mjs CHANGED
@@ -10,7 +10,7 @@ export default defineConfig({
10
10
  trailingSlash: 'never',
11
11
  output: 'static',
12
12
  integrations: [icon(), sitemap(), expressiveCode()],
13
- experimental: {
13
+ // experimental: { // Breaks some css for now
14
- // csp: true,
14
+ // csp: true,
15
- },
15
+ // },
16
16
  });
bun.lock CHANGED
@@ -7,7 +7,6 @@
7
7
  "@appzic/astro-reset-css": "^1.2.0",
8
8
  "@astrojs/rss": "^4.0.12",
9
9
  "@astrojs/sitemap": "^3.4.1",
10
- "@tauri-apps/plugin-log": "^2.7.1",
11
10
  "alchemy": "^0.77.5",
12
11
  "astro": "^5.9.0",
13
12
  "astro-color-scheme": "^1.1.5",
@@ -19,13 +18,13 @@
19
18
  "timeago.js": "^4.0.2",
20
19
  },
21
20
  "devDependencies": {
21
+ "@aws-sdk/client-s3": "^3.932.0",
22
22
  "@aws-sdk/client-sts": "^3.932.0",
23
23
  "@iconify-json/material-symbols": "^1.2.39",
24
24
  "@iconify-json/mdi": "^1.2.3",
25
25
  "@playwright/test": "^1.52.0",
26
26
  "@tauri-apps/cli": "^2.9.1",
27
- "@types/node": "^22.15.3",
27
+ "@types/bun": "^1.3.2",
28
- "client-s3": "aws-sdk/client-s3",
29
28
  },
30
29
  },
31
30
  },
@@ -492,8 +491,6 @@
492
491
 
493
492
  "@swc/helpers": ["@swc/helpers@0.5.17", "", { "dependencies": { "tslib": "^2.8.0" } }, "sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A=="],
494
493
 
495
- "@tauri-apps/api": ["@tauri-apps/api@2.9.0", "", {}, "sha512-qD5tMjh7utwBk9/5PrTA/aGr3i5QaJ/Mlt7p8NilQ45WgbifUNPyKWsA63iQ8YfQq6R8ajMapU+/Q8nMcPRLNw=="],
496
-
497
494
  "@tauri-apps/cli": ["@tauri-apps/cli@2.9.1", "", { "optionalDependencies": { "@tauri-apps/cli-darwin-arm64": "2.9.1", "@tauri-apps/cli-darwin-x64": "2.9.1", "@tauri-apps/cli-linux-arm-gnueabihf": "2.9.1", "@tauri-apps/cli-linux-arm64-gnu": "2.9.1", "@tauri-apps/cli-linux-arm64-musl": "2.9.1", "@tauri-apps/cli-linux-riscv64-gnu": "2.9.1", "@tauri-apps/cli-linux-x64-gnu": "2.9.1", "@tauri-apps/cli-linux-x64-musl": "2.9.1", "@tauri-apps/cli-win32-arm64-msvc": "2.9.1", "@tauri-apps/cli-win32-ia32-msvc": "2.9.1", "@tauri-apps/cli-win32-x64-msvc": "2.9.1" }, "bin": { "tauri": "tauri.js" } }, "sha512-kKi2/WWsNXKoMdatBl4xrT7e1Ce27JvsetBVfWuIb6D3ep/Y0WO5SIr70yarXOSWam8NyDur4ipzjZkg6m7VDg=="],
498
495
 
499
496
  "@tauri-apps/cli-darwin-arm64": ["@tauri-apps/cli-darwin-arm64@2.9.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-sdwhtsE/6njD0AjgfYEj1JyxZH4SBmCJSXpRm6Ph5fQeuZD6MyjzjdVOrrtFguyREVQ7xn0Ujkwvbo01ULthNg=="],
@@ -518,10 +515,10 @@
518
515
 
519
516
  "@tauri-apps/cli-win32-x64-msvc": ["@tauri-apps/cli-win32-x64-msvc@2.9.1", "", { "os": "win32", "cpu": "x64" }, "sha512-/JHlOzpUDhjBOO9w167bcYxfJbcMQv7ykS/Y07xjtcga8np0rzUzVGWYmLMH7orKcDMC7wjhheEW1x8cbGma/Q=="],
520
517
 
521
- "@tauri-apps/plugin-log": ["@tauri-apps/plugin-log@2.7.1", "", { "dependencies": { "@tauri-apps/api": "^2.8.0" } }, "sha512-jdb+o0wxQc8PjnLktgGpOs9Dh1YupaOGDXzO+Y8peA1UZ1ep3eXv4E1oiJ7nIQVN0XUFDDhnn3aBszl8ijhR+A=="],
522
-
523
518
  "@trysound/sax": ["@trysound/sax@0.2.0", "", {}, "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA=="],
524
519
 
520
+ "@types/bun": ["@types/bun@1.3.2", "", { "dependencies": { "bun-types": "1.3.2" } }, "sha512-t15P7k5UIgHKkxwnMNkJbWlh/617rkDGEdSsDbu+qNHTaz9SKf7aC8fiIlUdD5RPpH6GEkP0cK7WlvmrEBRtWg=="],
521
+
525
522
  "@types/debug": ["@types/debug@4.1.12", "", { "dependencies": { "@types/ms": "*" } }, "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ=="],
526
523
 
527
524
  "@types/estree": ["@types/estree@1.0.7", "", {}, "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ=="],
@@ -538,6 +535,8 @@
538
535
 
539
536
  "@types/node": ["@types/node@22.15.3", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-lX7HFZeHf4QG/J7tBZqrCAXwz9J5RD56Y6MpP0eJkka8p+K0RY/yBTW7CYFJ4VGCclxqOLKmiGP5juQc6MKgcw=="],
540
537
 
538
+ "@types/react": ["@types/react@19.2.5", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-keKxkZMqnDicuvFoJbzrhbtdLSPhj/rZThDlKWCDbgXmUg0rEUFtRssDXKYmtXluZlIqiC5VqkCgRwzuyLHKHw=="],
539
+
541
540
  "@types/sax": ["@types/sax@1.2.7", "", { "dependencies": { "@types/node": "*" } }, "sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A=="],
542
541
 
543
542
  "@types/tar": ["@types/tar@6.1.13", "", { "dependencies": { "@types/node": "*", "minipass": "^4.0.0" } }, "sha512-IznnlmU5f4WcGTh2ltRu/Ijpmk8wiWXfF0VA4s+HPjHZgvFggk1YaIkbo5krX/zUCzWF8N/l4+W/LNxnvAJ8nw=="],
@@ -614,6 +613,8 @@
614
613
 
615
614
  "buffer-crc32": ["buffer-crc32@0.2.13", "", {}, "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ=="],
616
615
 
616
+ "bun-types": ["bun-types@1.3.2", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-i/Gln4tbzKNuxP70OWhJRZz1MRfvqExowP7U6JKoI8cntFrtxg7RJK3jvz7wQW54UuvNC8tbKHHri5fy74FVqg=="],
617
+
617
618
  "bundle-name": ["bundle-name@4.1.0", "", { "dependencies": { "run-applescript": "^7.0.0" } }, "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q=="],
618
619
 
619
620
  "call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],
@@ -642,8 +643,6 @@
642
643
 
643
644
  "cli-boxes": ["cli-boxes@3.0.0", "", {}, "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g=="],
644
645
 
645
- "client-s3": ["client-s3@github:aws-sdk/client-s3#57b04dc", { "dependencies": { "@aws-sdk/client-s3": "^3.873.0" } }, "AWS-SDK-client-s3-57b04dc"],
646
-
647
646
  "clone": ["clone@2.1.2", "", {}, "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w=="],
648
647
 
649
648
  "clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="],
@@ -690,6 +689,8 @@
690
689
 
691
690
  "csso": ["csso@5.0.5", "", { "dependencies": { "css-tree": "~2.2.0" } }, "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ=="],
692
691
 
692
+ "csstype": ["csstype@3.2.2", "", {}, "sha512-D80T+tiqkd/8B0xNlbstWDG4x6aqVfO52+OlSUNIdkTvmNw0uQpJLeos2J/2XvpyidAFuTPmpad+tUxLndwj6g=="],
693
+
693
694
  "debug": ["debug@4.4.0", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA=="],
694
695
 
695
696
  "decode-named-character-reference": ["decode-named-character-reference@1.1.0", "", { "dependencies": { "character-entities": "^2.0.0" } }, "sha512-Wy+JTSbFThEOXQIR2L6mxJvEs+veIzpmqD7ynWxMXGpnk3smkHQOp6forLdHsKpAMW9iJpaBBIxz285t1n1C3w=="],
deploy.sh DELETED
@@ -1,5 +0,0 @@
1
- rm -rf dist
2
- bun run build
3
- aws s3 sync --delete ./dist/ s3://pyrossh-website
4
- cd infra && terraform validate && terraform plan && terraform apply -auto-approve
5
- aws cloudfront create-invalidation --distribution-id E2KFT51L97LWA1 --paths "/*" --no-cli-pager
infra/.terraform.lock.hcl DELETED
@@ -1,25 +0,0 @@
1
- # This file is maintained automatically by "terraform init".
2
- # Manual edits may be lost in future updates.
3
-
4
- provider "registry.terraform.io/hashicorp/aws" {
5
- version = "6.17.0"
6
- constraints = "6.17.0"
7
- hashes = [
8
- "h1:V7rm9KGpo/dNJG2u8XfiB9nZIsfYTbAyUE0C0eA5lTc=",
9
- "zh:157063d66cd4b5fc650f20f56127e19c9da5d135f4231f9ca0c19a1c0bf6e29d",
10
- "zh:2050dc03304b42204e6c58bbb1a2afd4feeac7db55d7c06be77c6b1e2ab46a0f",
11
- "zh:2a7f7751eef636ca064700cc4574b9b54a2596d9e2e86b91c45127410d9724c6",
12
- "zh:335fd7bb44bebfc4dd1db1c013947e1dde2518c6f2d846aac13b7314414ce461",
13
- "zh:545c248d2eb601a7b45a34313096cae0a5201ccf31e7fd99428357ef800051e0",
14
- "zh:57d19883a6367c245e885856a1c5395c4c743c20feff631ea4ec7b5e16826281",
15
- "zh:66d4f080b8c268d65e8c4758ed57234e5a19deff6073ffc3753b9a4cc177b54e",
16
- "zh:6ad50de35970f15e1ed41d39742290c1be80600b7df3a9fbb4c02f353b9586cf",
17
- "zh:7af42fa531e4dcb3ddb09f71ca988e90626abbf56a45981c2a6c01d0b364a51b",
18
- "zh:9a6a535a879314a9137ec9d3e858b7c490a962050845cf62620ba2bf4ae916a8",
19
- "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425",
20
- "zh:ca213e0262c8f686fcd40e3fc84d67b8eea1596de988c13d4a8ecd4522ede669",
21
- "zh:cc4132f682e9bf17c0649928ad92af4da07ffe7bccfe615d955225cdcf9e7f09",
22
- "zh:dfe6de43496d2e2b6dff131fef6ada1e15f1fbba3d47235c751564d22003d05e",
23
- "zh:e37d035fa02693a3d47fe636076cce50b6579b6adc0a36a7cf0456a2331c99ec",
24
- ]
25
- }
infra/main.tf DELETED
@@ -1,275 +0,0 @@
1
- terraform {
2
- required_providers {
3
- aws = {
4
- source = "hashicorp/aws"
5
- version = "= 6.17.0"
6
- }
7
- }
8
- }
9
-
10
- provider "aws" {
11
- region = "ap-south-1"
12
- default_tags {
13
- tags = {
14
- Environment = "Production"
15
- ProvisionedBy = "Terraform"
16
- }
17
- }
18
- }
19
-
20
- provider "aws" {
21
- alias = "useast"
22
- region = "us-east-1"
23
- default_tags {
24
- tags = {
25
- Environment = "Production"
26
- ProvisionedBy = "Terraform"
27
- }
28
- }
29
- }
30
-
31
- resource "aws_route53_zone" "main" {
32
- name = "pyrossh.dev"
33
- }
34
-
35
- resource "aws_s3_bucket" "website_bucket" {
36
- bucket = "pyrossh-website"
37
- }
38
-
39
- resource "aws_s3_bucket" "repos_bucket" {
40
- bucket = "pyrossh-repos"
41
- }
42
-
43
- resource "aws_s3_bucket_public_access_block" "website_bucket_public_access" {
44
- bucket = aws_s3_bucket.website_bucket.id
45
- block_public_acls = true
46
- block_public_policy = true
47
- ignore_public_acls = true
48
- restrict_public_buckets = true
49
- }
50
-
51
- resource "aws_s3_bucket_public_access_block" "repos_bucket_public_access" {
52
- bucket = aws_s3_bucket.repos_bucket.id
53
- block_public_acls = true
54
- block_public_policy = true
55
- ignore_public_acls = true
56
- restrict_public_buckets = true
57
- }
58
-
59
- resource "aws_cloudfront_origin_access_control" "s3_oac" {
60
- name = "s3-oac"
61
- origin_access_control_origin_type = "s3"
62
- signing_behavior = "always" // "no-override"
63
- signing_protocol = "sigv4"
64
- }
65
-
66
- data "aws_iam_policy_document" "cloudfront_website_bucket_access" {
67
- statement {
68
- principals {
69
- type = "Service"
70
- identifiers = ["cloudfront.amazonaws.com"]
71
- }
72
-
73
- actions = [
74
- "s3:GetObject"
75
- ]
76
-
77
- resources = [
78
- aws_s3_bucket.website_bucket.arn,
79
- "${aws_s3_bucket.website_bucket.arn}/*",
80
- ]
81
-
82
- condition {
83
- test = "StringEquals"
84
- variable = "AWS:SourceArn"
85
- values = [aws_cloudfront_distribution.s3_distribution.arn]
86
- }
87
- }
88
- }
89
-
90
- resource "aws_s3_bucket_policy" "website_bucket_access_policy" {
91
- bucket = aws_s3_bucket.website_bucket.id
92
- policy = data.aws_iam_policy_document.cloudfront_website_bucket_access.json
93
- }
94
-
95
- data "aws_iam_policy_document" "cloudfront_repos_bucket_access" {
96
- statement {
97
- principals {
98
- type = "Service"
99
- identifiers = ["cloudfront.amazonaws.com"]
100
- }
101
-
102
- actions = [
103
- "s3:GetObject"
104
- ]
105
-
106
- resources = [
107
- aws_s3_bucket.repos_bucket.arn,
108
- "${aws_s3_bucket.repos_bucket.arn}/*",
109
- ]
110
-
111
- condition {
112
- test = "StringEquals"
113
- variable = "AWS:SourceArn"
114
- values = [aws_cloudfront_distribution.s3_distribution.arn]
115
- }
116
- }
117
- }
118
-
119
- resource "aws_s3_bucket_policy" "repos_bucket_access_policy" {
120
- bucket = aws_s3_bucket.repos_bucket.id
121
- policy = data.aws_iam_policy_document.cloudfront_repos_bucket_access.json
122
- }
123
-
124
- resource "aws_acm_certificate" "domain_ssl_certificate" {
125
- domain_name = "pyrossh.dev"
126
- validation_method = "EMAIL"
127
- provider = aws.useast
128
- }
129
-
130
- resource "aws_cloudfront_function" "html_redirector" {
131
- name = "html_redirector"
132
- runtime = "cloudfront-js-2.0"
133
- publish = true
134
- code = <<CODE
135
- function handler(event) {
136
- const request = event.request;
137
- const uri = request.uri;
138
-
139
- if (uri.endsWith('/')) {
140
- request.uri += 'index.html';
141
- } else if (!uri.startsWith('/_astro')) {
142
- request.uri += '/index.html';
143
- }
144
- return request;
145
- }
146
- CODE
147
- }
148
-
149
- resource "aws_cloudfront_function" "git_redirector" {
150
- name = "git_redirector"
151
- runtime = "cloudfront-js-2.0"
152
- publish = true
153
- code = <<CODE
154
- function handler(event) {
155
- const request = event.request;
156
- const uri = request.uri;
157
- request.uri = "/" + request.uri.replace("/repos/", "");
158
- return request;
159
- }
160
- CODE
161
- }
162
-
163
- resource "aws_cloudfront_distribution" "s3_distribution" {
164
- origin {
165
- domain_name = aws_s3_bucket.website_bucket.bucket_regional_domain_name
166
- origin_id = aws_s3_bucket.website_bucket.bucket_regional_domain_name
167
- origin_access_control_id = aws_cloudfront_origin_access_control.s3_oac.id
168
- }
169
- origin {
170
- domain_name = aws_s3_bucket.repos_bucket.bucket_regional_domain_name
171
- origin_id = aws_s3_bucket.repos_bucket.bucket_regional_domain_name
172
- origin_access_control_id = aws_cloudfront_origin_access_control.s3_oac.id
173
- }
174
- enabled = true
175
- is_ipv6_enabled = true
176
- aliases = ["pyrossh.dev"]
177
- default_root_object = "index.html"
178
-
179
- dynamic "custom_error_response" {
180
- for_each = [400, 403, 404, 405, 414, 416, 500, 501, 502, 503, 504]
181
- content {
182
- error_code = custom_error_response.value
183
- response_code = custom_error_response.value
184
- response_page_path = custom_error_response.value < 500 ? "/404.html" : "/500.html"
185
- }
186
- }
187
-
188
- ordered_cache_behavior {
189
- path_pattern = "/repos/*.git/*"
190
- allowed_methods = ["GET", "HEAD"]
191
- cached_methods = ["GET", "HEAD"]
192
- target_origin_id = aws_s3_bucket.repos_bucket.bucket_regional_domain_name
193
-
194
- forwarded_values {
195
- query_string = false
196
- cookies {
197
- forward = "none"
198
- }
199
- }
200
-
201
- min_ttl = 0
202
- default_ttl = 86400
203
- max_ttl = 31536000
204
- compress = true
205
- viewer_protocol_policy = "redirect-to-https"
206
- function_association {
207
- event_type = "viewer-request"
208
- function_arn = aws_cloudfront_function.git_redirector.arn
209
- }
210
- }
211
-
212
- ordered_cache_behavior {
213
- path_pattern = "/*"
214
- allowed_methods = ["GET", "HEAD"]
215
- cached_methods = ["GET", "HEAD"]
216
- target_origin_id = aws_s3_bucket.website_bucket.bucket_regional_domain_name
217
- forwarded_values {
218
- query_string = true
219
- cookies {
220
- forward = "none"
221
- }
222
- }
223
- viewer_protocol_policy = "redirect-to-https"
224
- min_ttl = 0
225
- default_ttl = 3600
226
- max_ttl = 86400
227
- function_association {
228
- event_type = "viewer-request"
229
- function_arn = aws_cloudfront_function.html_redirector.arn
230
- }
231
- }
232
-
233
- default_cache_behavior {
234
- allowed_methods = ["GET", "HEAD"]
235
- cached_methods = ["GET", "HEAD"]
236
- target_origin_id = aws_s3_bucket.website_bucket.bucket_regional_domain_name
237
- forwarded_values {
238
- query_string = true
239
- cookies {
240
- forward = "none"
241
- }
242
- }
243
- viewer_protocol_policy = "redirect-to-https"
244
- min_ttl = 0
245
- default_ttl = 3600
246
- max_ttl = 86400
247
- function_association {
248
- event_type = "viewer-request"
249
- function_arn = aws_cloudfront_function.html_redirector.arn
250
- }
251
- }
252
-
253
- price_class = "PriceClass_All"
254
- restrictions {
255
- geo_restriction {
256
- restriction_type = "none"
257
- }
258
- }
259
- viewer_certificate {
260
- cloudfront_default_certificate = false
261
- acm_certificate_arn = aws_acm_certificate.domain_ssl_certificate.arn
262
- ssl_support_method = "sni-only"
263
- }
264
- }
265
-
266
- resource "aws_route53_record" "a_record_domain" {
267
- zone_id = aws_route53_zone.main.zone_id
268
- name = "pyrossh.dev"
269
- type = "A"
270
- alias {
271
- name = aws_cloudfront_distribution.s3_distribution.domain_name
272
- zone_id = aws_cloudfront_distribution.s3_distribution.hosted_zone_id
273
- evaluate_target_health = false #
274
- }
275
- }
package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
- "name": "tauri-app",
2
+ "name": "website",
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "version": "0.0.1",
6
+ "engines": {
7
+ "bun": "1.3.2"
8
+ },
6
9
  "scripts": {
7
10
  "tauri": "tauri",
8
11
  "dev": "astro dev",
@@ -18,7 +21,6 @@
18
21
  "@appzic/astro-reset-css": "^1.2.0",
19
22
  "@astrojs/rss": "^4.0.12",
20
23
  "@astrojs/sitemap": "^3.4.1",
21
- "@tauri-apps/plugin-log": "^2.7.1",
22
24
  "alchemy": "^0.77.5",
23
25
  "astro": "^5.9.0",
24
26
  "astro-color-scheme": "^1.1.5",
@@ -31,11 +33,11 @@
31
33
  },
32
34
  "devDependencies": {
33
35
  "@aws-sdk/client-sts": "^3.932.0",
34
- "client-s3": "aws-sdk/client-s3",
36
+ "@aws-sdk/client-s3": "^3.932.0",
35
37
  "@iconify-json/mdi": "^1.2.3",
36
38
  "@iconify-json/material-symbols": "^1.2.39",
37
39
  "@playwright/test": "^1.52.0",
38
40
  "@tauri-apps/cli": "^2.9.1",
39
- "@types/node": "^22.15.3"
41
+ "@types/bun": "^1.3.2"
40
42
  }
41
43
  }