zscams 2.0.6__tar.gz → 2.0.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. {zscams-2.0.6 → zscams-2.0.7}/PKG-INFO +1 -1
  2. {zscams-2.0.6 → zscams-2.0.7}/pyproject.toml +1 -1
  3. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/configuration/config.j2 +2 -2
  4. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/core/prerequisites.py +4 -1
  5. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/services/reverse_ssh.py +3 -2
  6. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/services/ssh_forwarder.py +3 -2
  7. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/support/filesystem.py +8 -3
  8. {zscams-2.0.6 → zscams-2.0.7}/README.md +0 -0
  9. {zscams-2.0.6 → zscams-2.0.7}/zscams/__init__.py +0 -0
  10. {zscams-2.0.6 → zscams-2.0.7}/zscams/__main__.py +0 -0
  11. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/__init__.py +0 -0
  12. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/certificates/.gitkeep +0 -0
  13. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/config.yaml +0 -0
  14. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/configuration/freebsd_service.j2 +0 -0
  15. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/configuration/linux_service.j2 +0 -0
  16. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/keys/autoport.key +0 -0
  17. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/__init__.py +0 -0
  18. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/core/__init__.py +0 -0
  19. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/core/backend/bootstrap.py +0 -0
  20. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/core/backend/client.py +0 -0
  21. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/core/backend/exceptions.py +0 -0
  22. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/core/backend/update_machine_info.py +0 -0
  23. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/core/service_health_check.py +0 -0
  24. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/core/services.py +0 -0
  25. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/core/tunnel/__init__.py +0 -0
  26. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/core/tunnel/tls.py +0 -0
  27. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/core/tunnels.py +0 -0
  28. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/services/__init__.py +0 -0
  29. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/services/system_monitor.py +0 -0
  30. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/support/__init__.py +0 -0
  31. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/support/cli.py +0 -0
  32. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/support/configuration.py +0 -0
  33. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/support/logger.py +0 -0
  34. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/support/mac.py +0 -0
  35. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/support/network.py +0 -0
  36. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/support/openssl.py +0 -0
  37. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/support/os.py +0 -0
  38. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/support/ssh.py +0 -0
  39. {zscams-2.0.6 → zscams-2.0.7}/zscams/agent/src/support/yaml.py +0 -0
  40. {zscams-2.0.6 → zscams-2.0.7}/zscams/deps.py +0 -0
  41. {zscams-2.0.6 → zscams-2.0.7}/zscams/lib/.gitkeep +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zscams
3
- Version: 2.0.6
3
+ Version: 2.0.7
4
4
  Summary: Async TLS tunnel client with SNI routing, auto-reconnect, and health checks
5
5
  Author: OCD - Cairo Software Team
6
6
  Maintainer: OCD - Cairo Software Team
@@ -3,7 +3,7 @@ name = "zscams_agent"
3
3
 
4
4
  [tool.poetry]
5
5
  name = "zscams"
6
- version = "2.0.6"
6
+ version = "2.0.7"
7
7
  description = "Async TLS tunnel client with SNI routing, auto-reconnect, and health checks"
8
8
  authors = ["OCD - Cairo Software Team"]
9
9
  maintainers = ["OCD - Cairo Software Team"]
@@ -39,7 +39,7 @@ services:
39
39
  custom_port_name: "reverse_port"
40
40
  params:
41
41
  local_port: 4422
42
- private_key: zscams/agent/keys/autoport.key
42
+ private_key: keys/autoport.key
43
43
  remote_host: localhost
44
44
  reverse_port: "{reverse_port}"
45
45
  server_ssh_user: ssh_user
@@ -52,7 +52,7 @@ services:
52
52
  port: 22
53
53
  prerequisites:
54
54
  files:
55
- - zscams/agent/keys/autoport.key
55
+ - keys/autoport.key
56
56
  ports:
57
57
  - 22
58
58
  services: []
@@ -1,9 +1,12 @@
1
+ import os
1
2
  from zscams.agent.src.support.logger import get_logger
2
3
  from zscams.agent.src.support.filesystem import is_file_exists
3
4
  from zscams.agent.src.core import running_services
4
5
  from zscams.agent.src.support.network import is_port_open, is_service_running
6
+ from zscams.agent.src.support.configuration import CONFIG_PATH
5
7
 
6
8
  logger = get_logger("service_prerequisites")
9
+ config_dir = os.path.dirname(CONFIG_PATH)
7
10
 
8
11
 
9
12
  def check_prerequisites(prereqs: dict) -> bool:
@@ -18,7 +21,7 @@ def check_prerequisites(prereqs: dict) -> bool:
18
21
 
19
22
  # Check file prerequisites
20
23
  for path in prereqs.get("files", []):
21
- results.append(is_file_exists(path, logger))
24
+ results.append(is_file_exists(path, logger, config_dir))
22
25
 
23
26
  # Check port prerequisites
24
27
  for port in prereqs.get("ports", []):
@@ -4,6 +4,7 @@ import os
4
4
  import sys
5
5
  from zscams.agent.src.support.logger import get_logger
6
6
  from zscams.agent.src.support.filesystem import resolve_path
7
+ from zscams.agent.src.support.configuration import CONFIG_PATH
7
8
 
8
9
  logger = get_logger("autossh_service")
9
10
 
@@ -14,11 +15,11 @@ if not params_env:
14
15
  sys.exit(1)
15
16
 
16
17
  params = json.loads(params_env)
17
-
18
+ config_dir = os.path.dirname(CONFIG_PATH)
18
19
  LOCAL_PORT = params.get("local_port", 4422)
19
20
  SERVER_SSH_USER = params.get("server_ssh_user", "ssh_user")
20
21
  REVERSE_PORT = params.get("reverse_port", 2222)
21
- PRIVATE_KEY = resolve_path(params.get("private_key")) # Path to RSA key
22
+ PRIVATE_KEY = resolve_path(params.get("private_key"), config_dir) # Path to RSA key
22
23
  SSH_OPTIONS = params.get("ssh_options", [])
23
24
  CHECK_INTERVAL = 120 #
24
25
 
@@ -4,6 +4,7 @@ import os
4
4
  import sys
5
5
  from zscams.agent.src.support.logger import get_logger
6
6
  from zscams.agent.src.support.filesystem import resolve_path
7
+ from zscams.agent.src.support.configuration import CONFIG_PATH
7
8
 
8
9
  logger = get_logger("autossh_service")
9
10
 
@@ -14,13 +15,13 @@ if not params_env:
14
15
  sys.exit(1)
15
16
 
16
17
  params = json.loads(params_env)
17
-
18
+ config_dir = os.path.dirname(CONFIG_PATH)
18
19
  FORWARDER_PORT = params.get("forwarder_port", 4422)
19
20
  LOCAL_PORT = params.get("local_port", 4422)
20
21
  REMOTE_PORT = params.get("remote_port", 4422)
21
22
  REMOTE_HOST = params.get("remote_host", "localhost")
22
23
  SERVER_SSH_USER = params.get("server_ssh_user", "ssh_user")
23
- PRIVATE_KEY = resolve_path(params.get("private_key")) # Path to RSA key
24
+ PRIVATE_KEY = resolve_path(params.get("private_key"), config_dir) # Path to RSA key
24
25
  SSH_OPTIONS = params.get("ssh_options", [])
25
26
  CHECK_INTERVAL = 120 #
26
27
 
@@ -9,6 +9,7 @@ from zscams.agent.src.support.logger import get_logger
9
9
 
10
10
  logger = get_logger("FileSystem")
11
11
 
12
+
12
13
  def resolve_path(path: Optional[str], base_dir: Optional[str] = None) -> Optional[str]:
13
14
  """
14
15
  Resolve a file path relative to a base directory.
@@ -34,9 +35,12 @@ def ensure_dir(path: str):
34
35
  os.makedirs(path, exist_ok=True)
35
36
 
36
37
 
37
- def is_file_exists(path, logger):
38
+ def is_file_exists(path, logger, base_dir=None):
38
39
  """Check if file exists."""
39
- if os.path.exists(path):
40
+ absolute_path = resolve_path(path, base_dir)
41
+ if os.path.exists(path) or os.path.exists(
42
+ Path(absolute_path if absolute_path else __file__)
43
+ ):
40
44
  logger.debug(f"File exists: {path}")
41
45
  return True
42
46
 
@@ -50,7 +54,7 @@ def append_to_file(path: str | Path, content: str):
50
54
  path = Path(path)
51
55
 
52
56
  if not path.parent.exists():
53
- os.mkdir(path.parent,0o700)
57
+ os.mkdir(path.parent, 0o700)
54
58
 
55
59
  with open(path, "a", encoding="utf-8") as file:
56
60
  file.write(content)
@@ -58,6 +62,7 @@ def append_to_file(path: str | Path, content: str):
58
62
  logger.error(exception)
59
63
  raise exception
60
64
 
65
+
61
66
  def write_to_file(path: str | Path, content: str):
62
67
  with open(path, "w", encoding="utf-8") as f:
63
68
  f.write(content)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes