Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
47a75c9
working prototype with alb and api gateway
thisismana Dec 7, 2020
519ddd0
bumped sharp
thisismana Dec 9, 2020
5b0c94e
added etag, test invoke
thisismana Jan 8, 2021
ca4349e
updated terraform
thisismana Jan 11, 2021
97dce13
migrated from zip to docker deployment
thisismana Jan 14, 2021
f74ce69
github pr and deploy workflows
thisismana Jan 14, 2021
6af0440
deleted files not needed for our use cases
thisismana Jan 14, 2021
db1d79d
fixed tests
thisismana Jan 15, 2021
1789540
documentation
thisismana Jan 15, 2021
16acfa1
implemented http/410 gone for expired content
thisismana Jan 15, 2021
ede30d5
arg not supported on GH
thisismana Jan 15, 2021
bb9007c
reworked object expiry
thisismana Jan 18, 2021
4c43af0
fixed deployment-off-by-one issue by adding a waiter
thisismana Jan 18, 2021
002d30d
fixed expiry
thisismana Jan 18, 2021
794728a
expiry in seconds, not milliseconds
thisismana Jan 18, 2021
c669d1b
use deployment module (#1)
moritzzimmer Jan 21, 2021
2be18fb
feature / JSON logging (#10)
vmk1vmk Feb 11, 2021
76b0cbf
bumped gh action runs-on to latest ubuntu,
thisismana Feb 11, 2021
2ca8d9e
fixed docker build
thisismana Feb 11, 2021
43596e0
feature - log format (#13)
vmk1vmk Feb 16, 2021
319db14
fixed docker build
thisismana Feb 16, 2021
c01605b
Copy everything in Dockerfile with exception of files matching the .d…
vmk1vmk Feb 16, 2021
477bcce
use latest module version
moritzzimmer Feb 18, 2021
3975357
logging adaptions
thisismana Feb 18, 2021
2fc931c
move path to top level when logging
thisismana Feb 18, 2021
8dc31c4
more field excludes for logging
thisismana Feb 18, 2021
a5c3af1
test CloudWatch Lambda Insights
moritzzimmer Mar 15, 2021
7729b83
apply fixed deployment module
moritzzimmer Apr 1, 2021
c2f1dda
Lambda Insights extension
moritzzimmer Apr 14, 2021
0b276b7
new file system layout (#28)
thisismana Apr 19, 2021
2aae43b
V2 (#31)
thisismana May 6, 2021
5b81b39
updated image host
thisismana Oct 13, 2021
53cbdde
migrated back to zip deployment.
thisismana Oct 29, 2021
49b0ef6
added check for out-of-bounds
thisismana Oct 29, 2021
1501965
re-enabled logging
thisismana Nov 2, 2021
4855fc0
allow gif
thisismana Nov 15, 2021
f05cc6a
chore: use arm64 architecture
moritzzimmer Nov 24, 2021
f3a3605
chore: use arm64 insights layer
moritzzimmer Nov 26, 2021
e6393ed
migrated to oidc
thisismana Dec 9, 2021
caa5dc1
log level adaptions
thisismana Dec 9, 2021
d518178
fixed test
thisismana Dec 10, 2021
9119a11
chore: removed unused docker_tag var
moritzzimmer Dec 22, 2021
8548a2a
Update README.md
moritzzimmer Dec 22, 2021
21c7f9b
fix: run un x86_64 arch
moritzzimmer Dec 22, 2021
17695bb
tweaked logging even a bit more
thisismana Dec 22, 2021
412e63b
Respect custom status code in metadata (#92)
saefty Jan 3, 2022
daee23a
allow newbiz to write images into our bucket (#98)
thisismana Feb 1, 2022
287efe5
allow `GET` and `HEAD` @ ApiGW
thisismana Apr 29, 2022
1f7fb9b
refactor: use new log streaming lambda
moritzzimmer Apr 29, 2022
894e8c3
fixed regex to allow `\d+x\d+` in path (#131)
thisismana May 4, 2022
349a1b9
shorter cache times for 4xx (#135)
thisismana May 12, 2022
1eea5c4
hotfix for image requests without filename
thisismana Jun 3, 2022
d5166ac
replace `__WIDTH__` placeholder with default of `1800` pixels
thisismana Jun 10, 2022
5e35a26
feat: add user-agent to logs (#142)
moritzzimmer Jun 13, 2022
832dce6
convert `code` to string to not mess up the automated mapping
thisismana Jul 13, 2022
7f8b2a3
feat: First attempt to allow avif (BUZZ-2717) (#157)
TimSusa Aug 11, 2022
8a6bd2b
preparations for lambda-URLs
thisismana Aug 11, 2022
127e86f
fixing avif edge cases
thisismana Aug 11, 2022
4645a6a
- terraform function url
thisismana Aug 12, 2022
e751c41
added `immutable` to all `http/200` responses `Cache-Control` directive
thisismana Aug 12, 2022
fcc90b8
removed api gw
thisismana Aug 30, 2022
f6414a6
properly log `path` for events v1 && v2
thisismana Sep 14, 2022
4bd75fb
Improve `roundCrop` feature (#172)
thisismana Oct 11, 2022
05575b2
updated usage
thisismana Oct 11, 2022
29dbb65
chore: pre-commit for static terraform checks (#195)
moritzzimmer Dec 22, 2022
3367964
chore(lambda): updated terraform module to latest
moritzzimmer Jan 2, 2023
e896b8e
chore: disabled lambda insights (#219)
moritzzimmer Feb 20, 2023
8d61ca7
bugfix: handle zero cropping (#223)
thisismana Feb 28, 2023
fc4709d
feat: use new OpenSearch logging extension (#220)
thisismana Mar 14, 2023
0085c2c
chore: fixed logging permissions
thisismana Mar 15, 2023
8636998
feat: ignore `/authors/` prefix
thisismana Jul 14, 2023
c9a5881
chore: migrate from OAI to OAC
thisismana Jul 14, 2023
8d3d873
fix: added missing iam permissions for detecting http/404
thisismana Jul 31, 2023
85edd24
bugfix: char encoding (newsletter) and guard for non-matching regex
thisismana Jul 31, 2023
1bb46ac
fixed test
thisismana Jul 31, 2023
c612b87
added aws sdk to package
thisismana Jul 31, 2023
6506f5e
revert to node 14
thisismana Jul 31, 2023
365f19f
Revert "revert to node 14"
thisismana Jul 31, 2023
f109c47
thumb hash — initial check in (#234)
thisismana Aug 9, 2023
d708750
fixed Makefile/upload task
thisismana Aug 9, 2023
7b12b2a
fixed Makefile/upload task
thisismana Aug 9, 2023
fbc299a
fixed Makefile/upload task
thisismana Aug 9, 2023
6c41342
fixed Makefile/upload task
thisismana Aug 9, 2023
51713b6
feat: tweak image output settings
thisismana Aug 9, 2023
e5583dd
chore: bumped thumbs stack (#272)
moritzzimmer Sep 27, 2023
12ef7a8
chore: bump all the things (#279)
thisismana Oct 5, 2023
29f1375
[skip ci] enable bucket versioning
saefty Nov 24, 2023
fa12fd4
[skip ci] expire object delete markers
saefty Nov 24, 2023
83b0185
[Buzz 4210] migrate to typescript and update readme (#328)
Kev-Hoffmann Dec 13, 2023
d1dc32b
bugfix: remove body from logs
thisismana Dec 13, 2023
ac1c82b
cleanup/typings (#329)
thisismana Dec 18, 2023
0c22998
chore: bumped Lambda module (#340)
moritzzimmer Feb 1, 2024
d008f56
fix(gh): fixed deployment
moritzzimmer Feb 1, 2024
e3035bc
chore: deleted unused tf lock file
moritzzimmer Feb 1, 2024
dd52954
feat: modified robots.txt
thisismana Feb 29, 2024
d72261a
feat: modified robots.txt
thisismana Feb 29, 2024
fdf557e
feat: added `Vary: Accept` to all `http/200` responses (#408)
thisismana Jun 25, 2024
fd8cb72
feat(logging): log `accept` and `request_id` (#409)
thisismana Jun 26, 2024
52019c9
debugging headers
thisismana Jun 26, 2024
3e9a1fa
enable aws backup for master images
saefty Jul 12, 2024
a28473f
Image handler v2 (#411)
thisismana Jul 15, 2024
a008020
hotfix: stroeer seo image url de-suggering
thisismana Jul 15, 2024
61672d9
feat(thumbhash): rewrote thumbhash with native nodejs/ts implementati…
thisismana Jul 15, 2024
3553ca9
updated readme for stroeer specific features
thisismana Jul 15, 2024
97f367a
hotfix: handle next-data `/__WIDTH__x0/` image template requests
thisismana Jul 16, 2024
f310cde
fix: thumbhash portrait images
thisismana Aug 6, 2024
849eb60
bugfix: proper handling crop out of bounds
thisismana Sep 6, 2024
ec40716
BUZZ-5367 adding cache control for errors
Sep 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated terraform
  • Loading branch information
thisismana committed Jan 11, 2021
commit ca4349eb9f6cbe2dd220110c5b733622106aeb5e
49 changes: 0 additions & 49 deletions source/image-handler/terraform/alb.tf

This file was deleted.

10 changes: 5 additions & 5 deletions source/image-handler/terraform/api_gateway.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
resource "aws_apigatewayv2_api" "this" {
name = "image handler"
protocol_type = "HTTP"
tags = local.default_tags

cors_configuration {
allow_credentials = false
Expand All @@ -10,14 +11,12 @@ resource "aws_apigatewayv2_api" "this" {
expose_headers = ["*"]
max_age = 3600
}

}

resource "aws_apigatewayv2_route" "this" {
api_id = aws_apigatewayv2_api.this.id
route_key = "GET /{proxy+}"
target = "integrations/${aws_apigatewayv2_integration.this.id}"

}

resource "aws_apigatewayv2_integration" "this" {
Expand Down Expand Up @@ -60,9 +59,10 @@ resource "aws_apigatewayv2_stage" "prod" {
deployed_at = timestamp()
}
route_settings {
route_key = aws_apigatewayv2_route.this.route_key
throttling_burst_limit = 5000
throttling_rate_limit = 10000
detailed_metrics_enabled = true
route_key = aws_apigatewayv2_route.this.route_key
throttling_burst_limit = 5000
throttling_rate_limit = 10000
}
}

Expand Down
3 changes: 3 additions & 0 deletions source/image-handler/terraform/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ data "aws_lambda_function" "log_streaming" {
}
data "aws_sns_topic" "notifications" {
name = "codestar-notifications"
}
data "aws_route53_zone" "external" {
name = "stroeer.engineering"
}
11 changes: 1 addition & 10 deletions source/image-handler/terraform/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,4 @@ resource "aws_iam_policy" "rekognition" {
resource "aws_iam_role_policy_attachment" "rekognition" {
role = module.lambda.role_name
policy_arn = aws_iam_policy.rekognition.arn
}

resource "aws_lambda_permission" "with_alb" {
statement_id = "AllowExecutionFromAlb"
action = "lambda:InvokeFunction"
function_name = aws_lambda_alias.live.arn
principal = "elasticloadbalancing.amazonaws.com"
source_arn = aws_alb_target_group.this.arn
}

}
24 changes: 5 additions & 19 deletions source/image-handler/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ locals {
map-migrated = "d-server-00fvusu7ux3q9a"
service = local.function_name
source = "https://github.com/thisismana/${local.function_name}"
App = "Images"
}

}
Expand All @@ -22,16 +23,17 @@ resource "aws_s3_bucket" "this" {
enabled = true
}
}

resource "aws_s3_bucket_object" "function" {
bucket = aws_s3_bucket.this.id
etag = filemd5(local.artifact)
key = local.s3_key
source = local.artifact
tags = local.default_tags

// lifecycle {
// ignore_changes = [etag, version_id]
// }
lifecycle {
ignore_changes = [etag, version_id]
}
}
resource "aws_lambda_alias" "live" {
description = "Alias for the active Lambda version"
Expand Down Expand Up @@ -71,27 +73,11 @@ module "lambda" {
tracing_config_mode = "Active"
environment = {
variables = {

# this sets the default output to webp, which
AUTO_WEBP = "Yes"

CORS_ENABLED = "Yes"
CORS_ORIGIN = "*"
SOURCE_BUCKETS = aws_s3_bucket.images.bucket

// ENABLE_DEFAULT_FALLBACK_IMAGE = "No"
// DEFAULT_FALLBACK_IMAGE_BUCKET = aws_s3_bucket.images.bucket
// DEFAULT_FALLBACK_IMAGE_KEY = "default.svg"
}
// CORS_ORIGIN = props.corsOriginParameter.valueAsString,
// REWRITE_MATCH_PATTERN= '',
// REWRITE_SUBSTITUTION= '',
// ENABLE_SIGNATURE= props.enableSignatureParameter.valueAsString,
// SECRETS_MANAGER= props.secretsManagerParameter.valueAsString,
// SECRET_KEY= props.secretsManagerKeyParameter.valueAsString,
// ENABLE_DEFAULT_FALLBACK_IMAGE= props.enableDefaultFallbackImageParameter.valueAsString,
// DEFAULT_FALLBACK_IMAGE_BUCKET= props.fallbackImageS3BucketParameter.valueAsString,
// DEFAULT_FALLBACK_IMAGE_KEY= props.fallbackImageS3KeyParameter.valueAsString
}
}
module "deployment" {
Expand Down