Compare commits
4 Commits
27186662f9
...
87a1c70fea
| Author | SHA1 | Date |
|---|---|---|
|
|
87a1c70fea | |
|
|
f475472c0e | |
|
|
a8806e2fb6 | |
|
|
e6c2e10e00 |
|
|
@ -49,6 +49,11 @@ repos:
|
||||||
|
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
|
- id: plaintext-k8s-secrets
|
||||||
|
name: plaintext-k8s-secrets
|
||||||
|
entry: scripts/check-plaintext-k8s-secrets
|
||||||
|
language: system
|
||||||
|
pass_filenames: false
|
||||||
- id: gitleaks
|
- id: gitleaks
|
||||||
name: gitleaks
|
name: gitleaks
|
||||||
entry: gitleaks detect --no-git
|
entry: gitleaks detect --no-git
|
||||||
|
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
apiVersion: ENC[AES256_GCM,data:Yag=,iv:vqFJR6yOsNQHXJSNib4yelF2fA2p02D2D9cqZdhpazU=,tag:kgsdAt27XrwNiBhF+mRO0Q==,type:str]
|
|
||||||
kind: ENC[AES256_GCM,data:5gfCabh1,iv:BPbKVXGSzBPm6Fgu8phM8uTSr5DXsgczvQao3PkKRPw=,tag:20rvKuy35gtmQwgv/fps/Q==,type:str]
|
|
||||||
metadata:
|
|
||||||
name: ENC[AES256_GCM,data:RPF1mtKvt1Sqc4iOkw5Ycc0=,iv:mDbD92TC6UBh1z46ksdJ4I9Jei+5/5X10JNO2QrHtNQ=,tag:KopPXKpPLBSybFQsh57z5g==,type:str]
|
|
||||||
namespace: ENC[AES256_GCM,data:ea1IpNtFz197,iv:0yHrff3WsdDQj5GUa16K5tU21azewtxukhMwsf5LwLM=,tag:W6gTVZxOuKSAiPPXgW316A==,type:str]
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: ENC[AES256_GCM,data:O+/ijkGgw1hw,iv:Etypigj616Rbc7YStfht053v6dPZ9YsnICCLwNkZen0=,tag:hpL4nXur/wUe4E97cDOtLw==,type:str]
|
|
||||||
app.kubernetes.io/managed-by: ENC[AES256_GCM,data:CJGYXyN/Sw==,iv:SmW0UnTfVR6D0WLKqM35lhUofchUdwwzW8kNPcVSGsE=,tag:ZKOB0CC3zDVr6VGcbTqxGg==,type:str]
|
|
||||||
type: ENC[AES256_GCM,data:DuH+mGxG,iv:R5jqHbX98jVyfdCYSKBc5kergajoAlmGSJbvFlbQPNM=,tag:S1UzRwKfeO5PvwzPBuegjw==,type:str]
|
|
||||||
stringData:
|
|
||||||
AUTHENTIK_SECRET_KEY: ENC[AES256_GCM,data:2wpU7o9Ru1W+b9fn8h0zl5qO+ZlN4pE8hQYG9+Lm5/0zJ/cRo3E2gqx5it0JO6PbXC6FMt4SCB8xsNvlt/cpCA==,iv:5+7phN47HHC4evzCqRcFspEXDXIKmhP+rhyxFThf2RI=,tag:ZUPug/ercX/jZ6ZcztaMOA==,type:str]
|
|
||||||
AUTHENTIK_POSTGRESQL__PASSWORD: ENC[AES256_GCM,data:XdEtScp97ssuSnpZPZWHcksNl7bZ7WVJENTN8QvYSNMc2MIulzvLi0ABNvzkUKISVkSV8EXViXlPYi0fMzb9DA==,iv:TkDDcXOGsT7mBCW0Z0OnPFOaO6rTqXY1wT94ROjygyc=,tag:kdCNBwiD+lnMb4dxGWYlBQ==,type:str]
|
|
||||||
AUTHENTIK_BOOTSTRAP_TOKEN: ENC[AES256_GCM,data:M8EZ91EAgAYykF1cb9XuarHpKpmIMPmOpP0+UpNr3azc1CA2WqMo5S1qt4QSUiIwsKYxK5Fli4TWY1eEecblGg==,iv:6SY/jTrEymA28dRD2EvWkc4z9XnDcpNSbgaHBdlQcAo=,tag:cneLOueorY3/5XQaHQh22w==,type:str]
|
|
||||||
AUTHENTIK_BOOTSTRAP_EMAIL: ENC[AES256_GCM,data:mLVtohfCIop8eBUeH1Po6P2t9WFty5+p8w==,iv:yO31kOEmaThMScASEB7UZdLxlQjSwRGP7Uk6APrmWiE=,tag:+Afanr2ZCBD1hUtadaGitw==,type:str]
|
|
||||||
postgres-password: ENC[AES256_GCM,data:9PWqpB3DbQQRnTRRrPM9/kDytVCq0Lw8949GC+0ENL3hHO9XRF+dwFlj8+Wpe7PFgzCYrr+qMUrDS39LZZT+TA==,iv:Xi0JcnedBJ7HOBj9rSX2h20TypLu1kkUu1uOvt/+EPU=,tag:QTK8TauJlQsMhPUzO6C1Vg==,type:str]
|
|
||||||
postgresql-password: ENC[AES256_GCM,data:d2rj6IrtG4/SB5xDZUUWm/3xTpM6avZHNXoQfMX1ggkf0FbdJNZ7cn3U/G7SZH9snXLDzqFaLHGKM+e4rvRcLw==,iv:lxRT8qLIFqyFR21kKcWKmkcY2+nqjLStojdKojgmHoQ=,tag:cmLwWDMQAKc4k6BfzhAZxw==,type:str]
|
|
||||||
sops:
|
|
||||||
age:
|
|
||||||
- enc: |
|
|
||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBoSXBXa1FKMHRHUzlyVmlM
|
|
||||||
dE1HMFRiQ1g0YkFXVGwvNlVLdXB2dXRvSFF3ClZ4TFpKVjc5MURleE9aeVJETlAy
|
|
||||||
ZkpIU0p3NzA5c29mRlpPdmFtUnkxYVkKLS0tIHlBdi9BbzFjUVNUTk1FSDk4dzVw
|
|
||||||
M2VFMlR1V2xFUWZCbVdJckdjOVozRkkKIhlnwCy0uQ35vUTyGII8qqr9gTRXopaF
|
|
||||||
h6CX3dPnuxbWu2GK51kQoiswQtZjEag28tvS1TB5UO5AA5mVbVP6ug==
|
|
||||||
-----END AGE ENCRYPTED FILE-----
|
|
||||||
recipient: age1ywayyaqwksdzedhf3w8xlsf89lnzw89c5yxtwjp42pnc5cds4dds5j6yxm
|
|
||||||
encrypted_regex: .*
|
|
||||||
lastmodified: "2026-09-28T23:41:58Z"
|
|
||||||
mac: ENC[AES256_GCM,data:RHDT1E1Q25WB6tAnZhcwhEKeyTd7FAiekTrO/2vBUc3eQd+DoTSuLDf9NCNjgWA1nDheZeDV36Jx4ormQHV+4fFxdSKAuD/35qQx/MbUUsyVDGmD8/9HxSCABqiEiWVQ2V4Xmryvh62a9uoncrCk6MWWXSw0+DcojnnRdusjs44=,iv:TJmasvWGeVmDiPdyht8pGoAPPUeXhIu6aihOwnreMkI=,tag:G9xHNNgzjTM4FgAjhzL4Eg==,type:str]
|
|
||||||
version: 3.13.3
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
*.secret.yaml
|
||||||
|
*.secret.yml
|
||||||
4
jeannie
4
jeannie
|
|
@ -107,6 +107,7 @@ Observability And GitOps
|
||||||
sso-grafana {plan|apply} Enable Grafana SSO through Dex.
|
sso-grafana {plan|apply} Enable Grafana SSO through Dex.
|
||||||
sso-gitea {plan|apply} Enable Gitea SSO through Dex.
|
sso-gitea {plan|apply} Enable Gitea SSO through Dex.
|
||||||
dex-secret {ensure|file} Generate/check SOPS-encrypted Dex bootstrap secrets.
|
dex-secret {ensure|file} Generate/check SOPS-encrypted Dex bootstrap secrets.
|
||||||
|
gitea-runner-secret {migrate|apply|file} Convert/apply the Gitea runner SOPS secret.
|
||||||
gitops-status Print focused Argo CD health and sync status.
|
gitops-status Print focused Argo CD health and sync status.
|
||||||
platform Deploy platform stack only.
|
platform Deploy platform stack only.
|
||||||
edge Deploy/check the OCI edge stack only.
|
edge Deploy/check the OCI edge stack only.
|
||||||
|
|
@ -338,6 +339,9 @@ case "${1:-}" in
|
||||||
dex-secret)
|
dex-secret)
|
||||||
dex_secret "${2:-ensure}"
|
dex_secret "${2:-ensure}"
|
||||||
;;
|
;;
|
||||||
|
gitea-runner-secret)
|
||||||
|
gitea_runner_secret "${2:-apply}"
|
||||||
|
;;
|
||||||
workers)
|
workers)
|
||||||
workers_manage "$@"
|
workers_manage "$@"
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
|
|
@ -6498,6 +6498,7 @@ apps() {
|
||||||
wait_for_namespaced_resource n8n deployment n8n n8n "${app_resource_wait_seconds}"
|
wait_for_namespaced_resource n8n deployment n8n n8n "${app_resource_wait_seconds}"
|
||||||
wait_for_deployment_ready n8n n8n n8n "${app_ready_wait_seconds}"
|
wait_for_deployment_ready n8n n8n n8n "${app_ready_wait_seconds}"
|
||||||
|
|
||||||
|
apply_gitea_runner_secret_file
|
||||||
refresh_argocd_application gitea-runner
|
refresh_argocd_application gitea-runner
|
||||||
if [[ "${LAB_CLUSTER_PROFILE:-debian}" == "pimox" ]] && ! truthy "${LAB_APPS_WAIT_GITEA_RUNNER_ON_PIMOX:-false}"; then
|
if [[ "${LAB_CLUSTER_PROFILE:-debian}" == "pimox" ]] && ! truthy "${LAB_APPS_WAIT_GITEA_RUNNER_ON_PIMOX:-false}"; then
|
||||||
echo "Skipping Gitea Kubernetes runner readiness on Pimox; the current runner manifest needs a Docker socket and is tracked as a follow-up."
|
echo "Skipping Gitea Kubernetes runner readiness on Pimox; the current runner manifest needs a Docker socket and is tracked as a follow-up."
|
||||||
|
|
|
||||||
|
|
@ -358,3 +358,108 @@ dex_secret() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gitea_runner_plain_secret_file() {
|
||||||
|
printf '%s\n' "${HOMELAB_GITEA_RUNNER_PLAIN_SECRET_FILE:-${REPO_ROOT}/apps/gitea-runner/secrets.yaml}"
|
||||||
|
}
|
||||||
|
|
||||||
|
gitea_runner_sops_secret_file() {
|
||||||
|
printf '%s\n' "${HOMELAB_GITEA_RUNNER_SECRET_FILE:-${REPO_ROOT}/apps/gitea-runner/secrets.secret.yaml}"
|
||||||
|
}
|
||||||
|
|
||||||
|
migrate_gitea_runner_secret_file() {
|
||||||
|
local plain_file
|
||||||
|
local secret_file
|
||||||
|
local secret_dir
|
||||||
|
local tmp_file
|
||||||
|
|
||||||
|
require_debian_server "gitea-runner-secret"
|
||||||
|
ensure_sops_age_tools
|
||||||
|
|
||||||
|
plain_file="$(gitea_runner_plain_secret_file)"
|
||||||
|
secret_file="$(gitea_runner_sops_secret_file)"
|
||||||
|
secret_dir="$(dirname "${secret_file}")"
|
||||||
|
|
||||||
|
if [[ -s "${secret_file}" ]]; then
|
||||||
|
SOPS_AGE_KEY_FILE="$(sops_age_key_file)" sops -d "${secret_file}" >/dev/null
|
||||||
|
echo "SOPS-encrypted Gitea runner secret already exists: ${secret_file}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -s "${plain_file}" ]]; then
|
||||||
|
echo "Missing plaintext source secret ${plain_file}; cannot create ${secret_file}." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "${secret_dir}"
|
||||||
|
tmp_file="$(mktemp)"
|
||||||
|
chmod 600 "${tmp_file}"
|
||||||
|
cp "${plain_file}" "${tmp_file}"
|
||||||
|
|
||||||
|
SOPS_AGE_KEY_FILE="$(sops_age_key_file)" sops \
|
||||||
|
--encrypt \
|
||||||
|
--input-type yaml \
|
||||||
|
--output-type yaml \
|
||||||
|
--filename-override "${secret_file}" \
|
||||||
|
"${tmp_file}" >"${secret_file}"
|
||||||
|
|
||||||
|
rm -f "${tmp_file}"
|
||||||
|
chmod 600 "${secret_file}"
|
||||||
|
rm -f "${plain_file}"
|
||||||
|
|
||||||
|
echo "Created SOPS-encrypted Gitea runner secret at ${secret_file}."
|
||||||
|
echo "Removed plaintext Gitea runner secret ${plain_file}."
|
||||||
|
echo "Commit ${secret_file} and the ${plain_file} deletion after validating the deployment."
|
||||||
|
}
|
||||||
|
|
||||||
|
apply_gitea_runner_secret_file() {
|
||||||
|
local plain_file
|
||||||
|
local secret_file
|
||||||
|
local key_file
|
||||||
|
|
||||||
|
require_debian_server "gitea-runner-secret"
|
||||||
|
|
||||||
|
plain_file="$(gitea_runner_plain_secret_file)"
|
||||||
|
secret_file="$(gitea_runner_sops_secret_file)"
|
||||||
|
key_file="$(sops_age_key_file)"
|
||||||
|
|
||||||
|
if [[ ! -s "${secret_file}" ]]; then
|
||||||
|
if [[ -s "${plain_file}" ]]; then
|
||||||
|
echo "Missing ${secret_file}; run ./jeannie gitea-runner-secret migrate on the Debian pipeline host." >&2
|
||||||
|
else
|
||||||
|
echo "Missing ${secret_file}; run ./jeannie gitea-runner-secret migrate after restoring the source values." >&2
|
||||||
|
fi
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ensure_sops_age_tools
|
||||||
|
|
||||||
|
echo "Applying SOPS-managed Gitea runner secret from ${secret_file}..."
|
||||||
|
if [[ -s "${key_file}" ]]; then
|
||||||
|
SOPS_AGE_KEY_FILE="${key_file}" sops -d "${secret_file}" | kubectl --kubeconfig "${KUBECONFIG_PATH}" apply -f -
|
||||||
|
else
|
||||||
|
sops -d "${secret_file}" | kubectl --kubeconfig "${KUBECONFIG_PATH}" apply -f -
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
gitea_runner_secret() {
|
||||||
|
local action="${1:-apply}"
|
||||||
|
|
||||||
|
require_debian_server "gitea-runner-secret"
|
||||||
|
|
||||||
|
case "${action}" in
|
||||||
|
migrate)
|
||||||
|
migrate_gitea_runner_secret_file
|
||||||
|
;;
|
||||||
|
apply)
|
||||||
|
apply_gitea_runner_secret_file
|
||||||
|
;;
|
||||||
|
file)
|
||||||
|
gitea_runner_sops_secret_file
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: ./jeannie gitea-runner-secret {migrate|apply|file}" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
|
|
||||||
|
is_encrypted_secret_path() {
|
||||||
|
case "$1" in
|
||||||
|
*.secret.yaml | *.secret.yml | *.enc.yaml | *.enc.yml)
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
looks_like_kubernetes_secret() {
|
||||||
|
awk '
|
||||||
|
/^[[:space:]]*kind:[[:space:]]*Secret[[:space:]]*$/ { found = 1 }
|
||||||
|
END { exit(found ? 0 : 1) }
|
||||||
|
' "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
local file
|
||||||
|
local failures=0
|
||||||
|
local -a staged_files=()
|
||||||
|
|
||||||
|
while IFS= read -r file; do
|
||||||
|
[[ -n "${file}" ]] || continue
|
||||||
|
staged_files+=("${file}")
|
||||||
|
done < <(
|
||||||
|
git -C "${REPO_ROOT}" diff --cached --name-only --diff-filter=ACMR -- \
|
||||||
|
'*.yaml' '*.yml'
|
||||||
|
)
|
||||||
|
|
||||||
|
for file in "${staged_files[@]}"; do
|
||||||
|
[[ -f "${REPO_ROOT}/${file}" ]] || continue
|
||||||
|
is_encrypted_secret_path "${file}" && continue
|
||||||
|
if looks_like_kubernetes_secret "${REPO_ROOT}/${file}"; then
|
||||||
|
echo "${file}: plaintext Kubernetes Secret manifests must be SOPS encrypted as *.secret.yaml or *.enc.yaml." >&2
|
||||||
|
failures=$((failures + 1))
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if ((failures > 0)); then
|
||||||
|
echo "Plaintext Kubernetes Secret guard failed for ${failures} staged file(s)." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
|
|
@ -34,7 +34,7 @@ HOST_METADATA = {
|
||||||
"heimdall": ("Heimdall", "Homelab service dashboard", "#7c3aed", "Heimdall"),
|
"heimdall": ("Heimdall", "Homelab service dashboard", "#7c3aed", "Heimdall"),
|
||||||
"homepage": ("Homepage", "Generated homelab operations dashboard", "#0284c7", "Homepage"),
|
"homepage": ("Homepage", "Generated homelab operations dashboard", "#0284c7", "Homepage"),
|
||||||
"jellyfin": ("Jellyfin", "Media streaming server", "#7c3aed", "Jellyfin"),
|
"jellyfin": ("Jellyfin", "Media streaming server", "#7c3aed", "Jellyfin"),
|
||||||
"auth": ("Authentik", "Homelab identity provider and SSO control plane", "#fd4b2d", "Authentik"),
|
"auth": ("Dex", "Homelab OpenID Connect SSO provider", "#2563eb", "Dex"),
|
||||||
"matrix": ("Matrix", "Matrix Synapse homeserver", "#0f172a", "Matrix"),
|
"matrix": ("Matrix", "Matrix Synapse homeserver", "#0f172a", "Matrix"),
|
||||||
"element": ("Element", "Matrix web client", "#0ea5e9", "Element"),
|
"element": ("Element", "Matrix web client", "#0ea5e9", "Element"),
|
||||||
"grafana": ("Grafana", "Monitoring dashboards", "#f97316", "Grafana"),
|
"grafana": ("Grafana", "Monitoring dashboards", "#f97316", "Grafana"),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue