forked from mtusi2026/mtusi2026lab7
ops: configure PKI and scoped OpenBao identities
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
umask 077
|
||||
|
||||
case "${SERVICE:-}" in
|
||||
api|worker) ;;
|
||||
*) echo "SERVICE must be api or worker" >&2; exit 2 ;;
|
||||
esac
|
||||
|
||||
source_dir="/source/$SERVICE"
|
||||
target_dir="/identities/$SERVICE"
|
||||
mkdir -p "$target_dir"
|
||||
for file in role-id secret-id secret-id-accessor; do
|
||||
cp "$source_dir/$file" "$target_dir/$file.next"
|
||||
chown 10001:10001 "$target_dir/$file.next"
|
||||
chmod 0600 "$target_dir/$file.next"
|
||||
mv "$target_dir/$file.next" "$target_dir/$file"
|
||||
done
|
||||
chown 10001:10001 "$target_dir"
|
||||
chmod 0700 "$target_dir"
|
||||
Reference in New Issue
Block a user