Skip to content

Commit

Permalink
Merge pull request #4168 from AllskyTeam/4165-the-username-and-passwo…
Browse files Browse the repository at this point in the history
…rd-should-not-appear-in-installlog

4165 the username and password should not appear in installlog
  • Loading branch information
EricClaeys authored Jan 4, 2025
2 parents cc1783d + fad558b commit 3d64597
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2121,11 +2121,11 @@ convert_ftp_sh()
doV "NEW" "X" "useremotewebsite" "boolean" "${NEW_FILE}"

doV "" "IMG_UPLOAD_ORIGINAL_NAME" "remotewebsiteimageuploadoriginalname" "boolean" "${NEW_FILE}"
doV "" "REMOTE_HOST" "REMOTEWEBSITE_HOST" "text" "${ALLSKY_ENV}"
doV "" "REMOTE_HOST" "REMOTEWEBSITE_HOST" "text" "${ALLSKY_ENV}" "hide"
doV "" "REMOTE_PORT" "REMOTEWEBSITE_PORT" "text" "${ALLSKY_ENV}"

doV "" "REMOTE_USER" "REMOTEWEBSITE_USER" "text" "${ALLSKY_ENV}"
doV "" "REMOTE_PASSWORD" "REMOTEWEBSITE_PASSWORD" "text" "${ALLSKY_ENV}"
doV "" "REMOTE_USER" "REMOTEWEBSITE_USER" "text" "${ALLSKY_ENV}" "hide"
doV "" "REMOTE_PASSWORD" "REMOTEWEBSITE_PASSWORD" "text" "${ALLSKY_ENV}" "hide"
doV "" "LFTP_COMMANDS" "REMOTEWEBSITE_LFTP_COMMANDS" "text" "${ALLSKY_ENV}"
doV "" "SSH_KEY_FILE" "REMOTEWEBSITE_SSH_KEY_FILE" "text" "${ALLSKY_ENV}"

Expand Down
13 changes: 8 additions & 5 deletions scripts/installUpgradeFunctions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1127,14 +1127,15 @@ function get_website_checksums()
# Update the specified file with the specified new value.
# ${V_} must be a legal shell variable name.
# Use V_ and VAL_ in case the caller uses V or VAL
doV()
function doV()
{
local oldV="${1}" # Optional name of old variable; if "" then use ${V_}.
local V_="${2}" # name of the variable that holds the new value
local VAL_="${!V_}" # value of the variable
local jV="${3}" # new json variable name
local oldV="${1}" # Optional name of old variable; if "" then use ${V_}.
local V_="${2}" # name of the variable that holds the new value
local VAL_="${!V_}" # value of the variable
local jV="${3}" # new json variable name
local TYPE="${4}"
local FILE="${5}"
local HIDE="${6:-show}" # "hide" to hide value in log file

[[ -z ${oldV} ]] && oldV="${V_}"

Expand All @@ -1158,8 +1159,10 @@ doV()
fi
MSG="${SPACE}${oldV}${jV} = ${VAL_}"
[[ -n ${oldV} ]] && MSG+=", TYPE=${TYPE}"
[[ ${HIDE} == "hide" ]] && MSG="${MSG/${VAL_}/<HIDDEN>}"
display_msg --logonly info "${MSG}"
else
[[ ${HIDE} == "hide" ]] && ERR="${ERR/${VAL_}/<HIDDEN>}"
# update_json_file() returns error message.
display_msg --log warning "${ERR}"
fi
Expand Down

0 comments on commit 3d64597

Please sign in to comment.