fetch secrets by uuid instead of listing all

This commit is contained in:
2026-03-20 15:51:43 -04:00
parent b19e194c0b
commit 2bcf67dcc4
4 changed files with 15 additions and 9 deletions
+4 -3
View File
@@ -57,11 +57,12 @@ if [ -f "docker/$APP/.env.keys" ] && [ -f /etc/bws-token ]; then
env_content=""
while IFS= read -r line || [ -n "$line" ]; do
[ -z "$line" ] && continue
[[ "$line" = \#* ]] && continue
var_name="${line%%=*}"
secret_key="${line#*=}"
value=$(bws secret list | jq -r --arg key "$secret_key" '.[] | select(.key == $key) | .value')
secret_id="${line#*=}"
value=$(bws secret get "$secret_id" | jq -r .value)
if [ -z "$value" ]; then
echo "ERROR: Secret '$secret_key' not found in bws."
echo "ERROR: Secret '$secret_id' not found in bws."
echo " Check that the secret exists and the machine account has access."
exit 1
fi