-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9d1e1fb
Showing
12 changed files
with
654 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Lint and upload | ||
|
||
on: | ||
push: | ||
branches: ["**"] | ||
pull_request: | ||
|
||
jobs: | ||
lint-templates: | ||
uses: ./.github/workflows/lint-template.yml | ||
upload-template: | ||
if: github.ref == 'refs/heads/master' | ||
permissions: | ||
contents: read | ||
id-token: write | ||
needs: [lint-templates] | ||
uses: ./.github/workflows/upload-template.yml | ||
with: | ||
tag: latest | ||
secrets: inherit |
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,19 @@ | ||
name: Lint templates | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build-and-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dev dependencies | ||
run: pip install cfn-lint | ||
- name: Lint templates | ||
run: cfn-lint template.yml |
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,49 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+*' | ||
|
||
jobs: | ||
lint-template: | ||
uses: ./.github/workflows/lint-template.yml | ||
upload-template: | ||
permissions: | ||
contents: read | ||
id-token: write | ||
needs: [lint-template] | ||
uses: ./.github/workflows/upload-template.yml | ||
with: | ||
tag: ${{ github.ref_name }} | ||
secrets: inherit | ||
release: | ||
needs: [lint-template, upload-template] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Prepare notes | ||
id: prepare-notes | ||
run: | | ||
# Extract changelog entries between this and previous version headers | ||
escaped_version=$(echo ${GITHUB_REF_NAME#v} | sed -e 's/[]\/$*.^[]/\\&/g') | ||
awk "BEGIN{inrelease=0} /## \[${escaped_version}\]/{inrelease=1;next} /## \[[0-9]+\.[0-9]+\.[0-9]+.*\]/{inrelease=0;exit} {if (inrelease) print}" CHANGELOG.md \ | ||
> RELEASE_NOTES.txt | ||
echo "" >> RELEASE_NOTES.txt | ||
echo "[![](assets/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home#/stacks/new?stackName=imgproxy&templateURL=https://imgproxy-cf.s3.amazonaws.com/sam/${{ github.ref_name }}/template.yml)" >> RELEASE_NOTES.txt | ||
# Write prerelease="true" env if tag name has any suffix after vMAJOR.MINOR.PATCH | ||
if [[ ${GITHUB_REF_NAME} =~ ^v[0-9]+\.[0-9]+\.[0-9]+.+ ]]; then | ||
echo 'prerelease="true"' >> $GITHUB_OUTPUT | ||
else | ||
echo 'prerelease="false"' >> $GITHUB_OUTPUT | ||
fi | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
body_path: RELEASE_NOTES.txt | ||
prerelease: ${{ fromJSON(steps.prepare-notes.outputs.prerelease) }} |
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 @@ | ||
name: Upload Templates to S3 | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
tag: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
upload: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
audience: sts.amazonaws.com | ||
aws-region: us-east-1 | ||
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | ||
- name: Upload template | ||
run: aws s3 cp template.yml s3://imgproxy-cf/sam/${{ inputs.tag }}/template.yml |
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 @@ | ||
tmp/ |
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,5 @@ | ||
# Changelog | ||
|
||
## [0.1.0] - 2024-02-07 | ||
### Added | ||
- AWS SAM / CloudFormation template for deploying imgproxy to AWS Lambda |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Sergei Aleksandrovich | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,53 @@ | ||
<p align="center"> | ||
<a href="https://imgproxy.net"> | ||
<picture> | ||
<source media="(prefers-color-scheme: dark)" srcset="assets/logo-dark.svg?sanitize=true"> | ||
<source media="(prefers-color-scheme: light)" srcset="assets/logo-light.svg?sanitize=true"> | ||
<img alt="imgproxy logo" src="assets/logo-light.svg?sanitize=true"> | ||
</picture> | ||
</a> | ||
</p> | ||
|
||
<h4 align="center"> | ||
<a href="https://imgproxy.net">Website</a> | | ||
<a href="https://imgproxy.net/blog/">Blog</a> | | ||
<a href="https://docs.imgproxy.net">Documentation</a> | | ||
<a href="https://imgproxy.net/#pro">imgproxy Pro</a> | | ||
<a href="https://hub.docker.com/r/darthsim/imgproxy/">Docker</a> | | ||
<a href="https://twitter.com/imgproxy_net">Twitter</a> | | ||
<a href="https://discord.gg/5GgpXgtC9u">Discord</a> | ||
</h4> | ||
|
||
<p align="center"> | ||
<a href="https://github.com/imgproxy/imgproxy-aws-sam/actions"><img alt="GH Lint" src="https://img.shields.io/github/actions/workflow/status/imgproxy/imgproxy-aws-sam/lint-and-upload.yml?branch=master&label=Lint&style=for-the-badge" /></a> | ||
</p> | ||
|
||
--- | ||
|
||
[imgproxy](https://imgproxy.net) is a fast and secure standalone server for resizing and converting remote images. The main principles of imgproxy are simplicity, speed, and security. | ||
|
||
This repository contains an [AWS Serverless Application Model (SAM)](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html) template compatible with [AWS CloudFormation](https://aws.amazon.com/cloudformation/) that allows you to deploy imgproxy to AWS Lambda. | ||
|
||
## Using the template | ||
|
||
We uploaded the template to our S3 bucket so you can use by a click of a button. The links below will take you to the AWS CloudFormation console with the template pre-filled. You just need to provide the required parameters and click **Create stack**. | ||
|
||
[![](assets/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home#/stacks/new?stackName=imgproxy&templateURL=https://imgproxy-cf.s3.amazonaws.com/sam/latest/template.yml) | ||
|
||
> [!NOTE] | ||
> The link in the README points to the template from the `master` branch. If you want to use a specific version, you can find the links in the [releases](https://github.com/imgproxy/imgproxy-aws-sam/releases) section. | ||
> [!WARNING] | ||
> Official Docker images of imgproxy prior to version `3.22.0` do not contain [AWS Lambda adapter](https://github.com/awslabs/aws-lambda-web-adapter). | ||
> | ||
> If you want to use the template with an older version of imgproxy, you need to build a custom Docker image with the adapter. Take note that this template assumes that the AWS Lambda adapter is configed to work in the `rsponse_stream` mode. | ||
## License | ||
|
||
imgproxy-aws-sam is licensed under the MIT license. | ||
|
||
See [LICENSE](https://github.com/imgproxy/imgproxy-aws-sam/blob/master/LICENSE) for the full license text. | ||
|
||
## Security Contact | ||
|
||
To report a security vulnerability, please contact us at [email protected]. We will coordinate the fix and disclosure. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.