Do not leak passwords in logs
This commit is contained in:
parent
38c59b2436
commit
1978ee5946
|
@ -37,12 +37,14 @@ class MariadbContainer(Container):
|
||||||
f"--host={creds['host']}",
|
f"--host={creds['host']}",
|
||||||
f"--port={creds['port']}",
|
f"--port={creds['port']}",
|
||||||
f"--user={creds['username']}",
|
f"--user={creds['username']}",
|
||||||
f"--password={creds['password']}",
|
|
||||||
"--all-databases",
|
"--all-databases",
|
||||||
]
|
]
|
||||||
|
|
||||||
def backup(self):
|
def backup(self):
|
||||||
config = Config()
|
config = Config()
|
||||||
|
creds = self.get_credentials()
|
||||||
|
|
||||||
|
with utils.environment('MYSQL_PWD', creds['password']):
|
||||||
return restic.backup_from_stdin(
|
return restic.backup_from_stdin(
|
||||||
config.repository,
|
config.repository,
|
||||||
f'/databases/{self.service_name}/all_databases.sql',
|
f'/databases/{self.service_name}/all_databases.sql',
|
||||||
|
@ -80,12 +82,14 @@ class MysqlContainer(Container):
|
||||||
f"--host={creds['host']}",
|
f"--host={creds['host']}",
|
||||||
f"--port={creds['port']}",
|
f"--port={creds['port']}",
|
||||||
f"--user={creds['username']}",
|
f"--user={creds['username']}",
|
||||||
f"--password={creds['password']}",
|
|
||||||
"--all-databases",
|
"--all-databases",
|
||||||
]
|
]
|
||||||
|
|
||||||
def backup(self):
|
def backup(self):
|
||||||
config = Config()
|
config = Config()
|
||||||
|
creds = self.get_credentials()
|
||||||
|
|
||||||
|
with utils.environment('MYSQL_PWD', creds['password']):
|
||||||
return restic.backup_from_stdin(
|
return restic.backup_from_stdin(
|
||||||
config.repository,
|
config.repository,
|
||||||
f'/databases/{self.service_name}/all_databases.sql',
|
f'/databases/{self.service_name}/all_databases.sql',
|
||||||
|
|
Loading…
Reference in New Issue