Skip to content

Commit

Permalink
Fix desktop password salt (#4762)
Browse files Browse the repository at this point in the history
* Update deploy.yaml.tmpl

* Update configmap.yaml.tmpl

* fix init.sh

* Update init.sh
  • Loading branch information
lingdie authored May 29, 2024
1 parent dd1cfc9 commit 4d02f76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deploy/cloud/scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4d02f76

Please sign in to comment.