External Secrets setup

Setup the external secrets helm charts
Convert hard coded secrets to external secrets
Add BitWarden CLI for serving external secrets
This commit is contained in:
Greg Hellings
2025-05-26 17:10:01 -05:00
parent 3110cff93c
commit ce5f604636
23 changed files with 320 additions and 24 deletions
+1
View File
@@ -14,6 +14,7 @@ in
hms = c ./hms { };
inject-darwin = c ./inject-darwin.nix { };
inject = c ./inject.nix { };
img-bitwarden = c ./img-bitwarden.nix { };
qemu-hook = c ./qemu-hook.nix { };
setup-ssh = c ./setup-ssh { };
upgrade-pg-cluster = c ./upgrade-pg-cluster.nix { };
+44
View File
@@ -0,0 +1,44 @@
{
bitwarden-cli,
cacert,
dockerTools,
lib,
writeShellApplication,
...
}:
dockerTools.buildLayeredImage {
name = "img-bitwarden";
tag = "latest";
contents = [
dockerTools.binSh
dockerTools.caCertificates
];
config = {
Cmd = [
(lib.getExe (writeShellApplication {
name = "bitwarden-cli-entrypoint.sh";
runtimeInputs = [ bitwarden-cli ];
text = ''
set -ex
# Uncomment if you need to hit a custom host
#bw config server ''${BW_HOST}
echo "Using apikey to log in"
bw login --apikey --raw
BW_SESSION="$(bw unlock --passwordenv BW_PASSWORD --raw)"
export BW_SESSION
echo 'Running "bw serve" on port 8087'
bw serve --hostname all --port 8087
'';
}))
];
Env = [
"CURL_CA_BUNDLE=${cacert}/etc/ssl/certs/ca-bundle.crt"
];
ExposedPorts = {
"8087/tcp" = { };
};
};
}