|
@@ -6,7 +6,8 @@ from pathlib import Path, PurePosixPath
|
|
|
is_windows = os.name == "nt"
|
|
is_windows = os.name == "nt"
|
|
|
|
|
|
|
|
|
|
|
|
|
-def read_data_sources(file: Path) -> list[Path]:
|
|
|
|
|
|
|
+def read_data_sources(hostname: str, login: str) -> list[Path]:
|
|
|
|
|
+ file = Path(f"./data_sources_{hostname}_{login}")
|
|
|
with open(file) as f:
|
|
with open(file) as f:
|
|
|
paths = f.readlines()
|
|
paths = f.readlines()
|
|
|
return [Path(p_str.strip()).expanduser() for p_str in paths]
|
|
return [Path(p_str.strip()).expanduser() for p_str in paths]
|
|
@@ -20,8 +21,9 @@ def to_source_path(path: Path):
|
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
def main():
|
|
|
- data_sources = read_data_sources(Path("./data_sources"))
|
|
|
|
|
|
|
+ login = os.getlogin()
|
|
|
hostname = socket.gethostname()
|
|
hostname = socket.gethostname()
|
|
|
|
|
+ data_sources = read_data_sources(hostname, login)
|
|
|
container_name = "borgmatic"
|
|
container_name = "borgmatic"
|
|
|
ssh_auth_sock = os.getenv("SSH_AUTH_SOCK")
|
|
ssh_auth_sock = os.getenv("SSH_AUTH_SOCK")
|
|
|
config_d_path = Path.cwd() / "data" / "borgmatic.d"
|
|
config_d_path = Path.cwd() / "data" / "borgmatic.d"
|
|
@@ -62,7 +64,7 @@ def main():
|
|
|
"-e",
|
|
"-e",
|
|
|
"SSH_KEY_NAME",
|
|
"SSH_KEY_NAME",
|
|
|
"-e",
|
|
"-e",
|
|
|
- f"HOST_LOGIN={os.getlogin()}",
|
|
|
|
|
|
|
+ f"HOST_LOGIN={login}",
|
|
|
"--security-opt=label=disable"
|
|
"--security-opt=label=disable"
|
|
|
] + volume_args + [image_name]
|
|
] + volume_args + [image_name]
|
|
|
print(args)
|
|
print(args)
|