mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
log/appv2: don't dump all settings in log metadata
This commit is contained in:
parent
e7d5d3942e
commit
a9ac55e4a5
1 changed files with 9 additions and 0 deletions
|
@ -16,6 +16,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
import copy
|
||||
import os
|
||||
import re
|
||||
import yaml
|
||||
|
@ -594,6 +595,14 @@ class OperationLogger:
|
|||
Write or rewrite the metadata file with all metadata known
|
||||
"""
|
||||
|
||||
metadata = copy.copy(self.metadata)
|
||||
|
||||
# Remove lower-case keys ... this is because with the new v2 app packaging,
|
||||
# all settings are included in the env but we probably don't want to dump all of these
|
||||
# which may contain various secret/private data ...
|
||||
if "env" in metadata:
|
||||
metadata["env"] = {k: v for k, v in metadata["env"].items() if k == k.upper()}
|
||||
|
||||
dump = yaml.safe_dump(self.metadata, default_flow_style=False)
|
||||
for data in self.data_to_redact:
|
||||
# N.B. : we need quotes here, otherwise yaml isn't happy about loading the yml later
|
||||
|
|
Loading…
Add table
Reference in a new issue