techknowlogick 72dc8a220c add invalidateCloudfront.js
This lambda function receives PUT events from S3 and then will send an invalidation to the cloudfront for those files and the directory listing they will have.

It uses an IAM role attached to the lambda, and calls the CloudFront Invalidation API function to clear certain files from the cache.

Caveat: For new folders, it may miss certain parent directories. Ex. if release 99 is made, then gitea/99/file.exe will be uploaded and cf will only clear gitea/99/file.exe and gitea/99/ but gitea/ will also need to be cleared because 99 is a new folder. Right now that could be done manually with each tag as I'm not sure each file upload needs that, as that's at least 30 clears of that dir for each tag.

Signed-off-by: techknowlogick <>
2023-02-07 04:42:02 +08:00
fileListing.js add fileListing.js 2023-02-07 04:36:36 +08:00
invalidateCloudfront.js add invalidateCloudfront.js 2023-02-07 04:42:02 +08:00