|
@@ -129,16 +129,16 @@ class Configuration:
|
|
|
history_file: Path
|
|
history_file: Path
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
|
- def read(cls, hostname: str, login: str, config_dir: Path, data_path: Path):
|
|
|
|
|
|
|
+ def read(cls, hostname: str, login: str, config_dir: Path):
|
|
|
secret_sources_file = config_dir / f"secret_sources_{hostname}_{login}"
|
|
secret_sources_file = config_dir / f"secret_sources_{hostname}_{login}"
|
|
|
data_sources_file = config_dir / f"data_sources_{hostname}_{login}"
|
|
data_sources_file = config_dir / f"data_sources_{hostname}_{login}"
|
|
|
|
|
|
|
|
return cls(
|
|
return cls(
|
|
|
secret_sources=Secret.read_sources(secret_sources_file),
|
|
secret_sources=Secret.read_sources(secret_sources_file),
|
|
|
data_sources=read_data_sources(data_sources_file),
|
|
data_sources=read_data_sources(data_sources_file),
|
|
|
- borgmatic_d_path=data_path / "borgmatic.d",
|
|
|
|
|
- borgmatic_path=data_path / "borgmatic",
|
|
|
|
|
- history_file=data_path / ".bash_history",
|
|
|
|
|
|
|
+ borgmatic_d_path=config_dir / "borgmatic.d",
|
|
|
|
|
+ borgmatic_path=config_dir / "borgmatic",
|
|
|
|
|
+ history_file=config_dir / ".bash_history",
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
@@ -330,9 +330,7 @@ def main():
|
|
|
login = os.getlogin()
|
|
login = os.getlogin()
|
|
|
hostname = socket.gethostname()
|
|
hostname = socket.gethostname()
|
|
|
|
|
|
|
|
- config = Configuration.read(
|
|
|
|
|
- hostname, login, Path("."), data_path=Path.cwd() / "pc_backup" / "data"
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ config = Configuration.read(hostname, login, Path.cwd() / "pc_backup" / "config")
|
|
|
|
|
|
|
|
if not config.secret_sources:
|
|
if not config.secret_sources:
|
|
|
print("no secret required ?")
|
|
print("no secret required ?")
|