﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-paulwong-随笔分类-JASYPT</title><link>http://www.blogjava.net/paulwong/category/55366.html</link><description /><language>zh-cn</language><lastBuildDate>Sun, 16 Jan 2022 11:40:56 GMT</lastBuildDate><pubDate>Sun, 16 Jan 2022 11:40:56 GMT</pubDate><ttl>60</ttl><item><title>SPRING 中YAML文件密码不以明文保存</title><link>http://www.blogjava.net/paulwong/archive/2020/10/20/435697.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Tue, 20 Oct 2020 06:59:00 GMT</pubDate><guid>http://www.blogjava.net/paulwong/archive/2020/10/20/435697.html</guid><wfw:comment>http://www.blogjava.net/paulwong/comments/435697.html</wfw:comment><comments>http://www.blogjava.net/paulwong/archive/2020/10/20/435697.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/paulwong/comments/commentRss/435697.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/paulwong/services/trackbacks/435697.html</trackback:ping><description><![CDATA[<p style="margin-top: 0px; margin-right: 0px; margin-bottom: var(--s-prose-spacing); margin-left: 0px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; box-sizing: inherit; clear: both; color: #242729; background-color: #ffffff;">Update: for production environment, to avoid exposing the password in the command line, since you can query the processes with&nbsp;<code style="margin: 0px; padding: 2px 4px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; background-color: var(--black-075); white-space: pre-wrap; color: var(--black-800); border-radius: 3px;">ps</code>, previous commands with&nbsp;<code style="margin: 0px; padding: 2px 4px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; background-color: var(--black-075); white-space: pre-wrap; color: var(--black-800); border-radius: 3px;">history</code>, etc etc. You could:</p><ul style="margin: 0px 0px 0px 30px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; list-style-position: initial; list-style-image: initial; box-sizing: inherit; color: #242729; background-color: #ffffff;"><li style="margin-top: 0px; margin-right: 0px; margin-bottom: var(--s-prose-spacing-condensed); margin-left: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; box-sizing: inherit; overflow-wrap: break-word;">Create a script like this:&nbsp;<code style="margin: 0px; padding: 2px 4px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; background-color: var(--black-075); white-space: pre-wrap; color: var(--black-800); border-radius: 3px;">touch setEnv.sh</code></li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: var(--s-prose-spacing-condensed); margin-left: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; box-sizing: inherit; overflow-wrap: break-word;">Edit&nbsp;<code style="margin: 0px; padding: 2px 4px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; background-color: var(--black-075); white-space: pre-wrap; color: var(--black-800); border-radius: 3px;">setEnv.sh</code>&nbsp;to export the&nbsp;<code style="margin: 0px; padding: 2px 4px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; background-color: var(--black-075); white-space: pre-wrap; color: var(--black-800); border-radius: 3px;">JASYPT_ENCRYPTOR_PASSWORD</code>&nbsp;variable<blockquote style="margin-top: var(--s-prose-spacing-condensed); margin-bottom: 0px; padding: 0.8em 0.8em 0.8em 1em; border-width: 0px; border-style: initial; border-color: initial; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; quotes: none; box-sizing: inherit; position: relative; color: var(--black-600);"><p style="margin-top: 0px; margin-right: 0px; margin-bottom: var(--s-prose-spacing-condensed); margin-left: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; box-sizing: inherit; clear: both;">#!/bin/bash</p><p style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; box-sizing: inherit; clear: both;">export JASYPT_ENCRYPTOR_PASSWORD=supersecretz</p></blockquote></li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: var(--s-prose-spacing-condensed); margin-left: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; box-sizing: inherit; overflow-wrap: break-word;">Execute the file with&nbsp;<code style="margin: 0px; padding: 2px 4px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; background-color: var(--black-075); white-space: pre-wrap; color: var(--black-800); border-radius: 3px;">. setEnv.sh</code></li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: var(--s-prose-spacing-condensed); margin-left: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; box-sizing: inherit; overflow-wrap: break-word;">Run the app in background with&nbsp;<code style="margin: 0px; padding: 2px 4px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; background-color: var(--black-075); white-space: pre-wrap; color: var(--black-800); border-radius: 3px;">mvn spring-boot:run &amp;</code></li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: var(--s-prose-spacing-condensed); margin-left: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; box-sizing: inherit; overflow-wrap: break-word;">Delete the file&nbsp;<code style="margin: 0px; padding: 2px 4px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; background-color: var(--black-075); white-space: pre-wrap; color: var(--black-800); border-radius: 3px;">setEnv.sh</code></li><li style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; box-sizing: inherit; overflow-wrap: break-word;">Unset the previous environment variable with:&nbsp;<code style="margin: 0px; padding: 2px 4px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; background-color: var(--black-075); white-space: pre-wrap; color: var(--black-800); border-radius: 3px;">unset JASYPT_ENCRYPTOR_PASSWORD</code></li></ul><br /><a href="https://stackoverflow.com/questions/37404703/spring-boot-how-to-hide-passwords-in-properties-file" target="_blank">https://stackoverflow.com/questions/37404703/spring-boot-how-to-hide-passwords-in-properties-file</a><br /><br /><img src ="http://www.blogjava.net/paulwong/aggbug/435697.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/paulwong/" target="_blank">paulwong</a> 2020-10-20 14:59 <a href="http://www.blogjava.net/paulwong/archive/2020/10/20/435697.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>