SPRING 中YAML文件密碼不以明文保存
Update: for production environment, to avoid exposing the password in the command line, since you can query the processes with ps
, previous commands with history
, etc etc. You could:
- Create a script like this:
touch setEnv.sh
- Edit
setEnv.sh
to export theJASYPT_ENCRYPTOR_PASSWORD
variable#!/bin/bash
export JASYPT_ENCRYPTOR_PASSWORD=supersecretz
- Execute the file with
. setEnv.sh
- Run the app in background with
mvn spring-boot:run &
- Delete the file
setEnv.sh
- Unset the previous environment variable with:
unset JASYPT_ENCRYPTOR_PASSWORD
https://stackoverflow.com/questions/37404703/spring-boot-how-to-hide-passwords-in-properties-file
posted on 2020-10-20 14:59 paulwong 閱讀(471) 評論(0) 編輯 收藏 所屬分類: JASYPT