diff --git a/srcpkgs/deployer/files/python/deployer/config.py b/srcpkgs/deployer/files/python/deployer/config.py index 33386a9..6b75754 100644 --- a/srcpkgs/deployer/files/python/deployer/config.py +++ b/srcpkgs/deployer/files/python/deployer/config.py @@ -18,12 +18,12 @@ class ConfigError(ValueError): @dataclass class Server: - host: str = "192.168.88.60" - user: str = "das" + host: str = "localhost" + user: str = "user" port: int = 22 - app_root: str = "/home/das/app" - configs_root: str = "/home/das/app/configs" - state_dir: str = "/home/das/app_deploy" + app_root: str = "/home/user/app" + configs_root: str = "/home/user/app/configs" + state_dir: str = "/home/user/app_deploy" keep: int = 5 local_roots: list[str] = field(default_factory=lambda: ["~/Dev/Projects"]) # Development-only files: not synced for python/docker/files apps (an app can sync them via its own rules) @@ -53,7 +53,7 @@ class App: # python-* unit: str = "" entry: str = "main.py" - user: str = "das" + user: str = "user" description: str = "" env_file: str = "" syslog_id: str = "" diff --git a/srcpkgs/deployer/files/python/deployer/detect.py b/srcpkgs/deployer/files/python/deployer/detect.py index 301dfa1..e5b220f 100644 --- a/srcpkgs/deployer/files/python/deployer/detect.py +++ b/srcpkgs/deployer/files/python/deployer/detect.py @@ -149,7 +149,7 @@ def import_server(cfg: Config, log=print) -> list[Imported]: if f[0] == "P" and len(f) == 9: _, d, unit, desc, user, sid, envf, entry, links = f app = App(name=d, kind="python-update", src="", dest=f"python/{d}", unit=unit, entry=entry or "main.py", - user=user or "das", description=desc, syslog_id="" if sid == unit else sid, env_file=envf, + user=user or "user", description=desc, syslog_id="" if sid == unit else sid, env_file=envf, configs=[x for x in links.split(",") if x]) local = match_local(projects, [d, sid], unit) elif f[0] == "D" and len(f) == 2: diff --git a/srcpkgs/deployer/files/tests/test_core.py b/srcpkgs/deployer/files/tests/test_core.py index fa37b0a..e2d15b2 100644 --- a/srcpkgs/deployer/files/tests/test_core.py +++ b/srcpkgs/deployer/files/tests/test_core.py @@ -36,7 +36,7 @@ dest = "~/scripts" """)) assert [a.name for a in cfg.apps] == ["a", "b"] assert cfg.dest_path(cfg.app("a")) == "/srv/app/python/a" - assert cfg.dest_path(cfg.app("b")) == "/home/das/scripts" + assert cfg.dest_path(cfg.app("b")) == "/home/user/scripts" assert cfg.app("a").src_path == Path.home() / "x" @@ -80,7 +80,7 @@ def test_rsync_cmd_options(): cmd = remote.rsync_cmd(s, "src/", "/d/", filters=["- x"], delete=True, dry_run=True, extra=["--chmod=F640"]) assert cmd[0] == "rsync" and "-n" in cmd and "--delete" in cmd and "-c" in cmd assert cmd.index("--chmod=F640") < cmd.index("--filter=- x") - assert cmd[-2:] == ["src/", "das@192.168.88.60:/d/"] + assert cmd[-2:] == ["src/", "user@localhost:/d/"] def test_parse_itemize(): @@ -164,14 +164,14 @@ def test_python_config_layout(tmp_path): (tmp_path / "configs").mkdir() cfg = config.Config(tmp_path / "x.toml", config.Server(), []) plan = type("P", (), {})() - plan.cfg, plan.dest = cfg, "/home/das/app/python/App" + plan.cfg, plan.dest = cfg, "/home/user/app/python/App" plan.app = config.App(name="App", kind="python-update", src=str(tmp_path), dest="python/App", unit="u", configs=["configs"]) k = get("python-update") - assert k.config_items(plan) == [("configs", "/home/das/app/configs/python/App")] + assert k.config_items(plan) == [("configs", "/home/user/app/configs/python/App")] plan.app.configs = [".env", "secrets.yaml"] - assert k.config_items(plan) == [(".env", "/home/das/app/configs/python/App/app.env"), - ("secrets.yaml", "/home/das/app/configs/python/App/secrets.yaml")] - plan.dest = "/home/das/app/docker/stack" + assert k.config_items(plan) == [(".env", "/home/user/app/configs/python/App/app.env"), + ("secrets.yaml", "/home/user/app/configs/python/App/secrets.yaml")] + plan.dest = "/home/user/app/docker/stack" plan.app = config.App(name="stack", kind="docker", src=str(tmp_path), dest="docker/stack") - assert get("docker").config_items(plan) == [(".env", "/home/das/app/configs/docker/stack.env")] + assert get("docker").config_items(plan) == [(".env", "/home/user/app/configs/docker/stack.env")] diff --git a/srcpkgs/publisher/files/python/publisher/config.py b/srcpkgs/publisher/files/python/publisher/config.py index b521dbb..13ad926 100644 --- a/srcpkgs/publisher/files/python/publisher/config.py +++ b/srcpkgs/publisher/files/python/publisher/config.py @@ -19,14 +19,14 @@ class ConfigError(ValueError): @dataclass class Server: - host: str = "192.168.88.60" - user: str = "das" + host: str = "localhost" + user: str = "user" port: int = 22 # Package storage of apps.jsp: only download.jsp serves it - apps_dir: str = "/home/das/app/docker/tomcat/data/webapps/ttt/WEB-INF/apps" + apps_dir: str = "/home/user/app/apps" # Requested on the server after an upload; the file name is appended (URL-encoded) check_url: str = "http://localhost:8010/download.jsp?f=" - state_dir: str = "/home/das/app_deploy" + state_dir: str = "/home/user/app_deploy" keep: int = 3 # versions of each package type per app; 0 = keep all local_roots: list[str] = field(default_factory=lambda: ["~/Dev/Projects"]) diff --git a/srcpkgs/publisher/files/share/publish.toml.example b/srcpkgs/publisher/files/share/publish.toml.example index c0070e6..7eb0db0 100644 --- a/srcpkgs/publisher/files/share/publish.toml.example +++ b/srcpkgs/publisher/files/share/publish.toml.example @@ -13,7 +13,7 @@ [server] host = "server.example.com" user = "user" -apps_dir = "/home/user/app/docker/tomcat/data/webapps/ttt/WEB-INF/apps" +apps_dir = "/home/user/app/apps" check_url = "http://localhost:8010/download.jsp?f=" state_dir = "/home/user/app_deploy" keep = 3