Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] feat: nginx-aws-signature lib submodule #124

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,24 @@ jobs:

- name: Install dependencies
run: sudo apt-get install -y wait-for-it

- name: Pull & update nginx-aws-signature submodules
run: |
git submodule update --init common/etc/nginx/include/awssig
git submodule absorbgitdirs
git -C common/etc/nginx/include/awssig config core.sparseCheckout true
echo 'core/*' >>.git/modules/common/etc/nginx/include/awssig/info/sparse-checkout
git submodule update --force --checkout common/etc/nginx/include/awssig

- name: Run tests - latest njs version
run: ./test.sh --latest-njs --type oss

- name: Run tests - stable njs version
run: ./test.sh --type oss

- name: Run tests - stable njs version - unprivileged process
run: ./test.sh --unprivileged --type oss

- name: Run tests - latest njs version - unprivileged process
run: ./test.sh --latest-njs --unprivileged --type oss

Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "common/etc/nginx/include/awssig"]
path = common/etc/nginx/include/awssig
url = https://github.com/nginxinc/nginx-aws-signature.git
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ and run the gateway.
```
common/ contains files used by both NGINX OSS and Plus configurations
etc/nginx/include/
s3gateway.js common library to integrate the s3 storage from NGINX OSS and Plus
etc/nginx/include/awssig/core required `git submodule` command by executing `submodule.sh`
awscredentials.js common library to read and write credentials
awssig2.js common library to build AWS signature 2
awssig4.js common library to build AWS signature 4 and get a session token
s3gateway.js common library to integrate the s3 storage from NGINX OSS and Plus
utils.js common library to be reused by all of NJS codebases
deployments/ contains files used for deployment technologies such as
CloudFormation
Expand Down
6 changes: 3 additions & 3 deletions common/docker-entrypoint.d/00-check-for-required-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ required=("S3_BUCKET_NAME" "S3_SERVER" "S3_SERVER_PORT" "S3_SERVER_PROTO"
if [[ -v AWS_CONTAINER_CREDENTIALS_RELATIVE_URI ]]; then
echo "Running inside an ECS task, using container credentials"

elif [[ -v S3_SESSION_TOKEN ]]; then
elif [[ -v AWS_SESSION_TOKEN ]]; then
echo "S3 Session token specified - not using IMDS for credentials"

# b) Using Instance Metadata Service (IMDS) credentials, if IMDS is present at http://169.254.169.254.
Expand All @@ -52,7 +52,7 @@ elif [[ -v AWS_WEB_IDENTITY_TOKEN_FILE ]]; then
# If none of the options above is used, require static credentials.
# See https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html.
else
required+=("S3_ACCESS_KEY_ID" "S3_SECRET_KEY")
required+=("AWS_ACCESS_KEY_ID" "AWS_SECRET_ACCESS_KEY")
fi

for name in ${required[@]}; do
Expand Down Expand Up @@ -101,7 +101,7 @@ if [ $failed -gt 0 ]; then
fi

echo "S3 Backend Environment"
echo "Access Key ID: ${S3_ACCESS_KEY_ID}"
echo "Access Key ID: ${AWS_ACCESS_KEY_ID}"
echo "Origin: ${S3_SERVER_PROTO}://${S3_BUCKET_NAME}.${S3_SERVER}:${S3_SERVER_PORT}"
echo "Region: ${S3_REGION}"
echo "Addressing Style: ${S3_STYLE}"
Expand Down
178 changes: 0 additions & 178 deletions common/etc/nginx/include/awscredentials.js

This file was deleted.

1 change: 1 addition & 0 deletions common/etc/nginx/include/awssig
Submodule awssig added at 63b182
46 changes: 0 additions & 46 deletions common/etc/nginx/include/awssig2.js

This file was deleted.

Loading