Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Correctly set file ownership on startup #98

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
15 changes: 2 additions & 13 deletions 0.X/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,9 @@ fi

# If we are running Vault, make sure it executes as the proper user.
if [ "$1" = 'vault' ]; then
# If the config dir is bind mounted then chown it
if [ "$(stat -c %u /vault/config)" != "$(id -u vault)" ]; then
chown -R vault:vault /vault/config || echo "Could not chown /vault/config (may not have appropriate permissions)"
fi

# If the logs dir is bind mounted then chown it
if [ "$(stat -c %u /vault/logs)" != "$(id -u vault)" ]; then
chown -R vault:vault /vault/logs
fi

# If the file dir is bind mounted then chown it
if [ "$(stat -c %u /vault/file)" != "$(id -u vault)" ]; then
chown -R vault:vault /vault/file
fi
# Ensure all of our permissions are set properly
chown -R vault:vault /vault || echo "Could not chown /vault (may not have appropriate permissions)"

if [ -z "$SKIP_SETCAP" ]; then
# Allow mlock to avoid swapping Vault memory to disk
Expand Down