Skip to content

Conversation

@thresheek
Copy link
Member

This makes sure all keys are exported to a keyring archive, as opposed to only the first key.

Same as in nginx/docker-nginx@0b49b8b

This makes sure all keys are exported to a keyring archive, as opposed
to only the first key.
Copilot AI review requested due to automatic review settings July 15, 2025 01:09
@thresheek thresheek requested a review from a team as a code owner July 15, 2025 01:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the GPG export step to pass each key ID as a separate argument, ensuring all specified keys are included in the archive.

  • Removed quotes around $NGINX_GPGKEYS in the gpg1 --export command to allow shell splitting of multiple key IDs.
  • Applied the change consistently in stable, mainline, and templated Dockerfiles.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
stable/debian/Dockerfile Drop quotes around $NGINX_GPGKEYS so multiple keys are exported
mainline/debian/Dockerfile Same change for the mainline Debian build
Dockerfile-debian.template Same change in the shared template
Comments suppressed due to low confidence (2)

stable/debian/Dockerfile:41

  • Add a CI test or validation step to confirm that multiple GPG keys are correctly exported into the archive after this change.
    gpg1 --export $NGINX_GPGKEYS > "$NGINX_GPGKEY_PATH" ; \

Dockerfile-debian.template:36

  • [nitpick] This export block is duplicated across stable, mainline, and template files. Consider extracting it into a shared script or build snippet to reduce repetition and ease future updates.
    gpg1 --export $NGINX_GPGKEYS > "$NGINX_GPGKEY_PATH" ; \

test -z "$found" && echo >&2 "error: failed to fetch GPG key $NGINX_GPGKEY" && exit 1; \
done; \
gpg1 --export "$NGINX_GPGKEYS" > "$NGINX_GPGKEY_PATH" ; \
gpg1 --export $NGINX_GPGKEYS > "$NGINX_GPGKEY_PATH" ; \
Copy link

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unquoted variable expansions can trigger pathname expansion (globbing). Consider disabling globbing (e.g., set -o noglob) or iterating explicitly over each key to pass them safely.

Suggested change
gpg1 --export $NGINX_GPGKEYS > "$NGINX_GPGKEY_PATH" ; \
gpg1 --export "$NGINX_GPGKEYS" > "$NGINX_GPGKEY_PATH" ; \

Copilot uses AI. Check for mistakes.
@alessfg alessfg added the bug Something isn't working label Jul 15, 2025
@alessfg alessfg changed the title Pass GPG key ids as separate arguments when exporting. fix: Pass GPG key ids as separate arguments when exporting. Jul 15, 2025
@alessfg
Copy link
Member

alessfg commented Jul 15, 2025

Tests are failing due to the way the build pipeline works. As long as the first build succeeds the remainder builds will work once the pipeline is merged into main.

@alessfg alessfg merged commit c994936 into main Jul 15, 2025
15 of 19 checks passed
@alessfg alessfg deleted the dev/gpg-keys branch July 15, 2025 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants