Fix desktop password salt (#4762)

* Update deploy.yaml.tmpl

* Update configmap.yaml.tmpl

* fix init.sh

* Update init.sh
This commit is contained in:
yy
2024-05-29 15:01:02 +08:00
committed by GitHub
parent dd1cfc9221
commit 4d02f76617
+2 -2
View File
@@ -135,7 +135,7 @@ function gen_cockroachdbUri() {
}
function gen_saltKey() {
password_salt=$(kubectl get configmap desktop-frontend-config -n sealos -o jsonpath='{.data.config\.yaml}' | grep "salt:" | awk '{print $2}' 2>/dev/null || true)
password_salt=$(kubectl get configmap desktop-frontend-config -n sealos -o jsonpath='{.data.config\.yaml}' | grep "salt:" | awk '{print $2}' 2>/dev/null | tr -d '"' || true)
if [[ -z "$password_salt" ]]; then
saltKey=$(tr -dc 'a-z0-9' </dev/urandom | head -c64)
else
@@ -144,7 +144,7 @@ function gen_saltKey() {
}
function gen_regionUID(){
uid=$(kubectl get configmap desktop-frontend-config -n sealos -o jsonpath='{.data.config\.yaml}' | grep "regionUID:" | awk '{print $2}' 2>/dev/null || true)
uid=$(kubectl get configmap desktop-frontend-config -n sealos -o jsonpath='{.data.config\.yaml}' | grep "regionUID:" | awk '{print $2}' 2>/dev/null | tr -d '"' || true)
if [[ -z "$uid" ]]; then
localRegionUID=$(uuidgen)
else