From 7003f25566658d1e6ac433cac04b8ea010bb628b Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 9 Jan 2025 14:52:44 -0500 Subject: [PATCH 1/6] feat: added back Gemfile --- .gitignore | 4 +- Gemfile | 33 ++++++++++ Gemfile.lock | 169 +++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 4 +- Taskfile.yml | 5 ++ 5 files changed, 211 insertions(+), 4 deletions(-) create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 Taskfile.yml diff --git a/.gitignore b/.gitignore index b86de43..bdd179a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,4 @@ _site .jekyll-cache vendor .vscode -.DS_Store -Gemfile -Gemfile.lock \ No newline at end of file +.DS_Store \ No newline at end of file diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..2c345b8 --- /dev/null +++ b/Gemfile @@ -0,0 +1,33 @@ +source "https://rubygems.org" +# Hello! This is where you manage which Jekyll version is used to run. +# When you want to use a different version, change it below, save the +# file and run `bundle install`. Run Jekyll with `bundle exec`, like so: +# +# bundle exec jekyll serve +# +# This will help ensure the proper Jekyll version is running. +# Happy Jekylling! +gem "jekyll", "~> 4.3.4" +# This is the default theme for new Jekyll sites. You may change this to anything you like. +gem "minima", "~> 2.5" +# If you want to use GitHub Pages, remove the "gem "jekyll"" above and +# uncomment the line below. To upgrade, run `bundle update github-pages`. +# gem "github-pages", group: :jekyll_plugins +# If you have any plugins, put them here! +group :jekyll_plugins do + gem "jekyll-feed", "~> 0.12" +end + +# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem +# and associated library. +platforms :mingw, :x64_mingw, :mswin, :jruby do + gem "tzinfo", ">= 1", "< 3" + gem "tzinfo-data" +end + +# Performance-booster for watching directories on Windows +gem "wdm", "~> 0.1", :platforms => [:mingw, :x64_mingw, :mswin] + +# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem +# do not have a Java counterpart. +gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby] diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..cd09ea8 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,169 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + bigdecimal (3.1.9) + colorator (1.1.0) + concurrent-ruby (1.3.4) + em-websocket (0.5.3) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0) + eventmachine (1.2.7) + ffi (1.17.1) + ffi (1.17.1-aarch64-linux-gnu) + ffi (1.17.1-aarch64-linux-musl) + ffi (1.17.1-arm-linux-gnu) + ffi (1.17.1-arm-linux-musl) + ffi (1.17.1-arm64-darwin) + ffi (1.17.1-x86-linux-gnu) + ffi (1.17.1-x86-linux-musl) + ffi (1.17.1-x86_64-darwin) + ffi (1.17.1-x86_64-linux-gnu) + ffi (1.17.1-x86_64-linux-musl) + forwardable-extended (2.6.0) + google-protobuf (4.29.3) + bigdecimal + rake (>= 13) + google-protobuf (4.29.3-aarch64-linux) + bigdecimal + rake (>= 13) + google-protobuf (4.29.3-arm64-darwin) + bigdecimal + rake (>= 13) + google-protobuf (4.29.3-x86-linux) + bigdecimal + rake (>= 13) + google-protobuf (4.29.3-x86_64-darwin) + bigdecimal + rake (>= 13) + google-protobuf (4.29.3-x86_64-linux) + bigdecimal + rake (>= 13) + http_parser.rb (0.8.0) + i18n (1.14.6) + concurrent-ruby (~> 1.0) + jekyll (4.3.4) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (~> 1.0) + jekyll-sass-converter (>= 2.0, < 4.0) + jekyll-watch (~> 2.0) + kramdown (~> 2.3, >= 2.3.1) + kramdown-parser-gfm (~> 1.0) + liquid (~> 4.0) + mercenary (>= 0.3.6, < 0.5) + pathutil (~> 0.9) + rouge (>= 3.0, < 5.0) + safe_yaml (~> 1.0) + terminal-table (>= 1.8, < 4.0) + webrick (~> 1.7) + jekyll-feed (0.17.0) + jekyll (>= 3.7, < 5.0) + jekyll-sass-converter (3.0.0) + sass-embedded (~> 1.54) + jekyll-seo-tag (2.8.0) + jekyll (>= 3.8, < 5.0) + jekyll-watch (2.2.1) + listen (~> 3.0) + kramdown (2.5.1) + rexml (>= 3.3.9) + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.4) + listen (3.9.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + mercenary (0.4.0) + minima (2.5.2) + jekyll (>= 3.5, < 5.0) + jekyll-feed (~> 0.9) + jekyll-seo-tag (~> 2.1) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + public_suffix (6.0.1) + rake (13.2.1) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + rexml (3.4.0) + rouge (4.5.1) + safe_yaml (1.0.5) + sass-embedded (1.83.1) + google-protobuf (~> 4.29) + rake (>= 13) + sass-embedded (1.83.1-aarch64-linux-android) + google-protobuf (~> 4.29) + sass-embedded (1.83.1-aarch64-linux-gnu) + google-protobuf (~> 4.29) + sass-embedded (1.83.1-aarch64-linux-musl) + google-protobuf (~> 4.29) + sass-embedded (1.83.1-aarch64-mingw-ucrt) + google-protobuf (~> 4.29) + sass-embedded (1.83.1-arm-linux-androideabi) + google-protobuf (~> 4.29) + sass-embedded (1.83.1-arm-linux-gnueabihf) + google-protobuf (~> 4.29) + sass-embedded (1.83.1-arm-linux-musleabihf) + google-protobuf (~> 4.29) + sass-embedded (1.83.1-arm64-darwin) + google-protobuf (~> 4.29) + sass-embedded (1.83.1-riscv64-linux-android) + google-protobuf (~> 4.29) + sass-embedded (1.83.1-riscv64-linux-gnu) + google-protobuf (~> 4.29) + sass-embedded (1.83.1-riscv64-linux-musl) + google-protobuf (~> 4.29) + sass-embedded (1.83.1-x86_64-cygwin) + google-protobuf (~> 4.29) + sass-embedded (1.83.1-x86_64-darwin) + google-protobuf (~> 4.29) + sass-embedded (1.83.1-x86_64-linux-android) + google-protobuf (~> 4.29) + sass-embedded (1.83.1-x86_64-linux-gnu) + google-protobuf (~> 4.29) + sass-embedded (1.83.1-x86_64-linux-musl) + google-protobuf (~> 4.29) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + unicode-display_width (2.6.0) + webrick (1.9.1) + +PLATFORMS + aarch64-linux + aarch64-linux-android + aarch64-linux-gnu + aarch64-linux-musl + aarch64-mingw-ucrt + arm-linux-androideabi + arm-linux-gnu + arm-linux-gnueabihf + arm-linux-musl + arm-linux-musleabihf + arm64-darwin + riscv64-linux-android + riscv64-linux-gnu + riscv64-linux-musl + ruby + x86-linux + x86-linux-gnu + x86-linux-musl + x86_64-cygwin + x86_64-darwin + x86_64-linux + x86_64-linux-android + x86_64-linux-gnu + x86_64-linux-musl + +DEPENDENCIES + http_parser.rb (~> 0.6.0) + jekyll (~> 4.3.4) + jekyll-feed (~> 0.12) + minima (~> 2.5) + tzinfo (>= 1, < 3) + tzinfo-data + wdm (~> 0.1) + +BUNDLED WITH + 2.6.2 diff --git a/README.md b/README.md index 48c084f..61a48da 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # 🖼️ Max Hutz's Digital Portfolio -### Hey! + +Hey! + I'm Max Hutz, and this is my personal website. It details who I am, what I've done, and were I'm headed in the field of software engineering. (And it looks cool too!) diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 0000000..79a5883 --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,5 @@ +version: 3 +silent: true + +tasks: + action: act -W .gitea/workflows --container-architecture linux/amd64 \ No newline at end of file From 3fb68011886acc404efc4caa8ca62c8bb64b670a Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 9 Jan 2025 15:15:26 -0500 Subject: [PATCH 2/6] feat: portfolio terraform --- terraform/main.tf | 59 ++++++++++++++++++++++++++++++++++++++++++ terraform/outputs.tf | 16 ++++++++++++ terraform/variables.tf | 9 +++++++ 3 files changed, 84 insertions(+) create mode 100644 terraform/main.tf create mode 100644 terraform/outputs.tf create mode 100644 terraform/variables.tf diff --git a/terraform/main.tf b/terraform/main.tf new file mode 100644 index 0000000..afe9e3e --- /dev/null +++ b/terraform/main.tf @@ -0,0 +1,59 @@ +# Create the S3 bucket. + +resource "aws_s3_bucket" "portfolio_bucket" { + bucket = var.bucket_name + + tags = { + Name = "Portfolio Bucket" + Environment = "Production" + } +} + +resource "aws_s3_bucket_public_access_block" "portfolio_bucket_access" { + bucket = aws_s3_bucket.portfolio_bucket.id + + block_public_acls = false + block_public_policy = false +} + +resource "aws_s3_bucket_versioning" "portfolio_bucket_access_versioning" { + bucket = aws_s3_bucket.portfolio_bucket.id + + versioning_configuration { + status = "Disabled" + } +} + +#------------------------------------------------------------------------------# + +# Give a user access. + +data "aws_iam_policy_document" "portfolio_bucket_policy_doc" { + statement { + effect = "Allow" + actions = ["s3:*", "s3-object-lambda:*"] + resources = [ + "${aws_s3_bucket.portfolio_bucket.arn}/*", + "${aws_s3_bucket.portfolio_bucket.arn}" + ] + } +} + +resource "aws_iam_policy" "portfolio_bucket_policy" { + name = "${var.role_name}Policy" + description = "The policy that manages the Portfolio Bucket." + policy = data.aws_iam_policy_document.portfolio_bucket_policy_doc.json +} + +resource "aws_iam_user" "portfolio_bucket_user" { + name = "${var.role_name}User" +} + +resource "aws_iam_user_policy_attachment" "portfolio_bucket_attachment" { + user = aws_iam_user.portfolio_bucket_user.name + policy_arn = aws_iam_policy.portfolio_bucket_policy.arn +} + +resource "aws_iam_access_key" "portfolio_bucket_key" { + user = aws_iam_user.portfolio_bucket_user.name +} diff --git a/terraform/outputs.tf b/terraform/outputs.tf new file mode 100644 index 0000000..24304a3 --- /dev/null +++ b/terraform/outputs.tf @@ -0,0 +1,16 @@ +output "access_region" { + value = aws_s3_bucket.portfolio_bucket.region + description = "This is the region of the bucket." +} + +output "access_id" { + value = aws_iam_access_key.portfolio_bucket_key.id + description = "This is the access ID to modify the bucket." + sensitive = true +} + +output "access_secret" { + value = aws_iam_access_key.portfolio_bucket_key.secret + description = "This is the access secret to modify the bucket." + sensitive = true +} diff --git a/terraform/variables.tf b/terraform/variables.tf new file mode 100644 index 0000000..7a33d76 --- /dev/null +++ b/terraform/variables.tf @@ -0,0 +1,9 @@ +variable "bucket_name" { + type = string + description = "The name of the bucket to create." +} + +variable "role_name" { + type = string + description = "The base name for the role to modify the bucket." +} \ No newline at end of file From 08b1b8f6416f126e53439cdb1d266d46aa8d01f9 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 9 Jan 2025 15:20:49 -0500 Subject: [PATCH 3/6] feat: init tf --- .gitignore | 44 ++++++++++++++++++++++++++++++++++- Taskfile.yml | 10 ++++++++ terraform/.terraform.lock.hcl | 24 +++++++++++++++++++ 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 terraform/.terraform.lock.hcl diff --git a/.gitignore b/.gitignore index bdd179a..47f378b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,46 @@ _site .jekyll-cache vendor .vscode -.DS_Store \ No newline at end of file +.DS_Store +secrets +secret.tfvars + +# ---> Terraform +# Local .terraform directories +.terraform + +# .tfstate files +*.tfstate +*.tfstate.* + +# Crash log files +crash.log +crash.*.log + +# Exclude all .tfvars files, which are likely to contain sensitive data, such as +# password, private keys, and other secrets. These should not be part of version +# control as they are data points which are potentially sensitive and subject +# to change depending on the environment. +*.tfvars +*.tfvars.json + +# Ignore override files as they are usually used to override resources locally and so +# are not checked in +override.tf +override.tf.json +*_override.tf +*_override.tf.json + +# Include override files you do wish to add to version control using negated pattern +# !example_override.tf + +# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan +# example: *tfplan* + +# Ignore CLI configuration files +*.terraformrc +terraform.rc + +# ---------------------------------------------------------------------------- # + +# Custom ignores. \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml index 79a5883..984cb1f 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,5 +1,15 @@ version: 3 + +env: { TF: terraform -chdir=terraform } silent: true tasks: + tf/init: $TF init -backend-config=../secrets/backend.json + tf/plan: $TF plan + tf/destroy: $TF destroy + tf/format: $TF fmt -recursive + tf/apply: + - $TF apply + - $TF output -json > secrets/terraform.json + action: act -W .gitea/workflows --container-architecture linux/amd64 \ No newline at end of file diff --git a/terraform/.terraform.lock.hcl b/terraform/.terraform.lock.hcl new file mode 100644 index 0000000..7eed625 --- /dev/null +++ b/terraform/.terraform.lock.hcl @@ -0,0 +1,24 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/aws" { + version = "5.83.0" + hashes = [ + "h1:uh/57vwauk96J9HjqvjmWV9sLXbX0YXbYnqUBWooiwQ=", + "zh:03a1d4cb151efd9279a3348ecb5e26fe99eb5d217b254e544c7f768a03020d0e", + "zh:07637e75abd0809454d9b51b4499059e6fd3eb58d4723c99bc71d21595a9b897", + "zh:415868ead3d9b9527418c68468972dd0c9614e69240133d8b1d77641259eb396", + "zh:52f343f08881fc88fcbd731cdf480c02edd6eb335934107bbcfb0d97c2a575df", + "zh:60d19aed16142fce6fd95087d9de8d8f59681db98588f9384112045ce533f3ce", + "zh:62775ba5933b41d00df59fe7ae02027d328ccedc06ff5363ff8d2f48633c4012", + "zh:95c7a13b5ef625a672f0ac94d1a20858f60bf09a6517b180f031b707f37d862d", + "zh:9adf0d9f349e692b9f51375713c316d28d217f72d2b86deb49e48c3834a41539", + "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", + "zh:b605deb6d3eff97218b6b16b153038ac8e7bd0b8506ae469f2368281dca46cab", + "zh:b8542b3672bca0c6ed522b8f65d92ef5720786301abc7d7dae07f07296398b4c", + "zh:d975790f409234f9791633adba3ffcfbb2526bc04aed1f379fc8f90370366907", + "zh:e621bd43f3a46f122ec450828d590ee2f34c0be5603120876ddfc218861b1802", + "zh:e87e2989e99aa21bbfdb603e1325afe11af126684c64821eca8d014f8b762ca5", + "zh:f7f6f149d6e1e9d4b979b23b248df14bfe3c497052ec41a6dd40d19bcd9cde9a", + ] +} From 60f194ac7d8ff693694239a871d9d33997b41a22 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 9 Jan 2025 15:29:09 -0500 Subject: [PATCH 4/6] fix: no backend here --- .gitignore | 5 ++++- Taskfile.yml | 4 ++-- terraform/.terraform.lock.hcl | 24 ------------------------ 3 files changed, 6 insertions(+), 27 deletions(-) delete mode 100644 terraform/.terraform.lock.hcl diff --git a/.gitignore b/.gitignore index 47f378b..01d4e3c 100644 --- a/.gitignore +++ b/.gitignore @@ -45,4 +45,7 @@ terraform.rc # ---------------------------------------------------------------------------- # -# Custom ignores. \ No newline at end of file +# Custom ignores. + +*.tfvars +*.tfbackend \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml index 984cb1f..52478ec 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -4,12 +4,12 @@ env: { TF: terraform -chdir=terraform } silent: true tasks: - tf/init: $TF init -backend-config=../secrets/backend.json + tf/init: $TF init -backend-config=s3.tfbackend tf/plan: $TF plan tf/destroy: $TF destroy tf/format: $TF fmt -recursive tf/apply: - $TF apply - - $TF output -json > secrets/terraform.json + - $TF output -json > terraform.secrets action: act -W .gitea/workflows --container-architecture linux/amd64 \ No newline at end of file diff --git a/terraform/.terraform.lock.hcl b/terraform/.terraform.lock.hcl deleted file mode 100644 index 7eed625..0000000 --- a/terraform/.terraform.lock.hcl +++ /dev/null @@ -1,24 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/aws" { - version = "5.83.0" - hashes = [ - "h1:uh/57vwauk96J9HjqvjmWV9sLXbX0YXbYnqUBWooiwQ=", - "zh:03a1d4cb151efd9279a3348ecb5e26fe99eb5d217b254e544c7f768a03020d0e", - "zh:07637e75abd0809454d9b51b4499059e6fd3eb58d4723c99bc71d21595a9b897", - "zh:415868ead3d9b9527418c68468972dd0c9614e69240133d8b1d77641259eb396", - "zh:52f343f08881fc88fcbd731cdf480c02edd6eb335934107bbcfb0d97c2a575df", - "zh:60d19aed16142fce6fd95087d9de8d8f59681db98588f9384112045ce533f3ce", - "zh:62775ba5933b41d00df59fe7ae02027d328ccedc06ff5363ff8d2f48633c4012", - "zh:95c7a13b5ef625a672f0ac94d1a20858f60bf09a6517b180f031b707f37d862d", - "zh:9adf0d9f349e692b9f51375713c316d28d217f72d2b86deb49e48c3834a41539", - "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", - "zh:b605deb6d3eff97218b6b16b153038ac8e7bd0b8506ae469f2368281dca46cab", - "zh:b8542b3672bca0c6ed522b8f65d92ef5720786301abc7d7dae07f07296398b4c", - "zh:d975790f409234f9791633adba3ffcfbb2526bc04aed1f379fc8f90370366907", - "zh:e621bd43f3a46f122ec450828d590ee2f34c0be5603120876ddfc218861b1802", - "zh:e87e2989e99aa21bbfdb603e1325afe11af126684c64821eca8d014f8b762ca5", - "zh:f7f6f149d6e1e9d4b979b23b248df14bfe3c497052ec41a6dd40d19bcd9cde9a", - ] -} From 5fad958cec6b613b40313b7f07d82f21c7b78901 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 9 Jan 2025 15:33:42 -0500 Subject: [PATCH 5/6] fix: ignore certain files for jekyll --- Taskfile.yml | 3 ++- _config.yml | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 _config.yml diff --git a/Taskfile.yml b/Taskfile.yml index 52478ec..1dd0618 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -12,4 +12,5 @@ tasks: - $TF apply - $TF output -json > terraform.secrets - action: act -W .gitea/workflows --container-architecture linux/amd64 \ No newline at end of file + action: act -W .gitea/workflows --container-architecture linux/amd64 + dev: bundle exec jekyll serve \ No newline at end of file diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..6287410 --- /dev/null +++ b/_config.yml @@ -0,0 +1,5 @@ +exclude: + - "*.yml" + - "*.md" + - "LICENSE" + - "terraform/*" \ No newline at end of file From 924b22f2ca304c4c34e7a4e3e9cc2613ba4844a3 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 9 Jan 2025 15:34:10 -0500 Subject: [PATCH 6/6] fix: ignore Gitea Actions for now --- .gitea/workflows/prepare.yml | 39 ------------------------------------ 1 file changed, 39 deletions(-) delete mode 100644 .gitea/workflows/prepare.yml diff --git a/.gitea/workflows/prepare.yml b/.gitea/workflows/prepare.yml deleted file mode 100644 index cd4bdfb..0000000 --- a/.gitea/workflows/prepare.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Prepare changes for deployment. - -on: - push: - branches: - - 'main' - -jobs: - prepare: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - with: - token: ${{ secrets.SECRET }} - - - uses: actions/setup-node@v3 - with: - node-version: '16' - - - name: Install dependencies. - run: npm i -g terser csso-cli - - - name: "Copying changes over to build." - run: git checkout -b build - - - name: Minify files. - run: | - find . -name "*.js" -type f -exec terser {} -c -o {} \; - find . -name "*.css" -type f -exec csso {} -o {} \; - - - name: "Commiting changes." - run: | - git config user.name github-actions - git config user.email noreply@github.com - git commit -am "Preparing changes for deployment." - - - name: "Pushing changes." - run: git push -uf origin build