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

feat: Make secrets base directory configurable #4592

Merged
merged 1 commit into from
Jul 12, 2023
Merged
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
2 changes: 1 addition & 1 deletion cmd/security-secretstore-setup/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN make cmd/security-file-token-provider/security-file-token-provider \

FROM alpine:3.17

RUN apk add --update --no-cache ca-certificates dumb-init su-exec
RUN apk add --update --no-cache ca-certificates dumb-init su-exec yq

LABEL license='SPDX-License-Identifier: Apache-2.0' \
copyright='Copyright (c) 2019: Dell Technologies, Inc.; Copyright (C) 2023 Intel Corporation'
Expand Down
11 changes: 8 additions & 3 deletions cmd/security-secretstore-setup/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@

set -e

# env settings are populated from env files of docker-compose
# EDGEX_SECRETS_ROOT should default to /tmp/edgex/secrets
# unless changed in configuration.yaml or overridden by environment variable
EDGEX_SECRETS_ROOT=`yq -r .TokenFileProvider.OutputDir /res-file-token-provider/configuration.yaml`
if [ ! -z "${TOKENFILEPROVIDER_OUTPUTDIR}" ]; then
EDGEX_SECRETS_ROOT="${TOKENFILEPROVIDER_OUTPUTDIR}"
fi

# create token dir, and assign perms
mkdir -p /vault/config/assets
Expand All @@ -36,8 +41,8 @@ fi

# /tmp/edgex/secrets need to be shared with all other services that need secrets and
# thus change the ownership to EDGEX_USER:EDGEX_GROUP
echo "$(date) Changing ownership of secrets to ${EDGEX_USER}:${EDGEX_GROUP}"
chown -Rh ${EDGEX_USER}:${EDGEX_GROUP} /tmp/edgex/secrets
echo "$(date) Changing ownership of ${EDGEX_SECRETS_ROOT} to ${EDGEX_USER}:${EDGEX_GROUP}"
chown -Rh ${EDGEX_USER}:${EDGEX_GROUP} "${EDGEX_SECRETS_ROOT}"

# Signal tokens ready port for other services waiting on
exec su-exec ${EDGEX_USER} /edgex-init/security-bootstrapper --configDir=/edgex-init/res listenTcp \
Expand Down