mirror of
https://github.com/ZettaIO/restic-compose-backup.git
synced 2025-12-13 17:34:57 +00:00
fix: use seperate backup user for database backups
This commit is contained in:
committed by
Silthus
parent
b50ebd1cf8
commit
2a3aa294c2
@@ -11,6 +11,9 @@ EXCLUDE_BIND_MOUNTS=false
|
||||
RESTIC_REPOSITORY=/restic_data
|
||||
RESTIC_PASSWORD=password
|
||||
|
||||
BACKUP_MYSQL_USER=root
|
||||
BACKUP_MYSQL_PASSWORD=my-secret-pw
|
||||
|
||||
RESTIC_KEEP_DAILY=7
|
||||
RESTIC_KEEP_WEEKLY=4
|
||||
RESTIC_KEEP_MONTHLY=12
|
||||
|
||||
@@ -16,8 +16,8 @@ class MariadbContainer(Container):
|
||||
"""dict: get credentials for the service"""
|
||||
return {
|
||||
'host': self.hostname,
|
||||
'username': self.get_config_env('MYSQL_USER'),
|
||||
'password': self.get_config_env('MYSQL_PASSWORD'),
|
||||
'username': self.get_config_env('BACKUP_MYSQL_USER'),
|
||||
'password': self.get_config_env('BACKUP_MYSQL_PASSWORD'),
|
||||
'port': "3306",
|
||||
}
|
||||
|
||||
@@ -90,8 +90,8 @@ class MysqlContainer(Container):
|
||||
"""dict: get credentials for the service"""
|
||||
return {
|
||||
'host': self.hostname,
|
||||
'username': self.get_config_env('MYSQL_USER'),
|
||||
'password': self.get_config_env('MYSQL_PASSWORD'),
|
||||
'username': self.get_config_env('BACKUP_MYSQL_USER'),
|
||||
'password': self.get_config_env('BACKUP_MYSQL_PASSWORD'),
|
||||
'port': "3306",
|
||||
}
|
||||
|
||||
@@ -165,10 +165,10 @@ class PostgresContainer(Container):
|
||||
"""dict: get credentials for the service"""
|
||||
return {
|
||||
'host': self.hostname,
|
||||
'username': self.get_config_env('POSTGRES_USER'),
|
||||
'password': self.get_config_env('POSTGRES_PASSWORD'),
|
||||
'username': self.get_config_env('BACKUP_POSTGRES_USER'),
|
||||
'password': self.get_config_env('BACKUP_POSTGRES_PASSWORD'),
|
||||
'port': "5432",
|
||||
'database': self.get_config_env('POSTGRES_DB'),
|
||||
'database': self.get_config_env('BACKUP_POSTGRES_DB'),
|
||||
}
|
||||
|
||||
def ping(self) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user