mirror of
https://github.com/khuedoan/homelab.git
synced 2024-12-22 21:34:48 +07:00
refactor: update Kanidm password reset script to reset any account
https://github.com/khuedoan/homelab/issues/130
This commit is contained in:
parent
bd0d7b556d
commit
f3e3fa22ec
@ -1,5 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
account="${1}"
|
||||
|
||||
echo "WARNING: Kanidm admin can do anything in the cluster, only use it for just enough initial setup or in emergencies." >&2
|
||||
export KUBECONFIG=./metal/kubeconfig.yaml
|
||||
kubectl exec -it -n kanidm statefulset/kanidm -- kanidmd recover-account admin
|
||||
kubectl exec -it -n kanidm statefulset/kanidm -- kanidmd recover-account "${account}"
|
@ -4,6 +4,7 @@ username="${1}"
|
||||
fullname="${2}"
|
||||
mail="${3}"
|
||||
|
||||
export KUBECONFIG=./metal/kubeconfig.yaml
|
||||
host="$(kubectl get ingress --namespace kanidm kanidm --output jsonpath='{.spec.rules[0].host}')"
|
||||
|
||||
kanidm person create "${username}" "${fullname}" --url "https://${host}" --name idm_admin
|
||||
|
Loading…
Reference in New Issue
Block a user