zscams 2.0.11__tar.gz → 2.0.12__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 (40) hide show
  1. {zscams-2.0.11 → zscams-2.0.12}/PKG-INFO +1 -1
  2. {zscams-2.0.11 → zscams-2.0.12}/pyproject.toml +1 -1
  3. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/support/configuration.py +17 -8
  4. {zscams-2.0.11 → zscams-2.0.12}/README.md +0 -0
  5. {zscams-2.0.11 → zscams-2.0.12}/zscams/__init__.py +0 -0
  6. {zscams-2.0.11 → zscams-2.0.12}/zscams/__main__.py +0 -0
  7. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/__init__.py +0 -0
  8. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/certificates/.gitkeep +0 -0
  9. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/configuration/config.j2 +0 -0
  10. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/configuration/freebsd_service.j2 +0 -0
  11. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/configuration/linux_service.j2 +0 -0
  12. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/keys/autoport.key +0 -0
  13. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/__init__.py +0 -0
  14. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/core/__init__.py +0 -0
  15. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/core/backend/bootstrap.py +0 -0
  16. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/core/backend/client.py +0 -0
  17. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/core/backend/exceptions.py +0 -0
  18. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/core/backend/unbootstrap.py +0 -0
  19. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/core/backend/update_machine_info.py +0 -0
  20. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/core/prerequisites.py +0 -0
  21. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/core/service_health_check.py +0 -0
  22. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/core/services.py +0 -0
  23. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/core/tunnel/__init__.py +0 -0
  24. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/core/tunnel/tls.py +0 -0
  25. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/core/tunnels.py +0 -0
  26. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/services/__init__.py +0 -0
  27. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/services/reverse_ssh.py +0 -0
  28. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/services/ssh_forwarder.py +0 -0
  29. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/services/system_monitor.py +0 -0
  30. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/support/__init__.py +0 -0
  31. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/support/cli.py +0 -0
  32. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/support/filesystem.py +0 -0
  33. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/support/logger.py +0 -0
  34. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/support/mac.py +0 -0
  35. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/support/network.py +0 -0
  36. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/support/openssl.py +0 -0
  37. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/support/os.py +0 -0
  38. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/support/ssh.py +0 -0
  39. {zscams-2.0.11 → zscams-2.0.12}/zscams/agent/src/support/yaml.py +0 -0
  40. {zscams-2.0.11 → zscams-2.0.12}/zscams/deps.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zscams
3
- Version: 2.0.11
3
+ Version: 2.0.12
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.11"
6
+ version = "2.0.12"
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"]
@@ -3,8 +3,9 @@ Configuration loader module
3
3
  """
4
4
 
5
5
  import os
6
+ import sys
6
7
  from pathlib import Path
7
- from typing import Optional, Type, TypedDict, cast
8
+ from typing import Optional, Type, TypeVar, TypedDict, cast
8
9
  import yaml
9
10
 
10
11
  import zscams
@@ -13,6 +14,8 @@ from zscams.agent.src.support.yaml import YamlIndentedListsDumper, resolve_place
13
14
  ROOT_PATH = Path(zscams.__file__).resolve().parent.joinpath("agent")
14
15
  CONFIG_PATH = os.path.join(ROOT_PATH.absolute(), "config.yaml")
15
16
 
17
+ GetReturnT = TypeVar("T")
18
+
16
19
 
17
20
  class MissingConfiguration(BaseException):
18
21
  """Error when the requisted key is not found"""
@@ -33,8 +36,14 @@ class Configuration:
33
36
  return cls.__instance
34
37
 
35
38
  def __load_config(self):
36
- with open(CONFIG_PATH, "r", encoding="utf-8") as f:
37
- self.__config = yaml.safe_load(f)
39
+ try:
40
+ with open(CONFIG_PATH, "r", encoding="utf-8") as f:
41
+ self.__config = yaml.safe_load(f)
42
+ except FileNotFoundError:
43
+ print(
44
+ f"Can't find configurations file. Make sure you have it by running `cp '{ROOT_PATH.joinpath('configuration/config.j2')}' '{CONFIG_PATH}'`",
45
+ )
46
+ sys.exit(1)
38
47
 
39
48
  def override_config(self, new_config: dict):
40
49
  """
@@ -56,13 +65,13 @@ class Configuration:
56
65
  def to_dict(self):
57
66
  return self.__config
58
67
 
59
- def get[T](
68
+ def get(
60
69
  self,
61
70
  key: str,
62
- default: Optional[T] = None,
71
+ default: Optional[GetReturnT] = None,
63
72
  must_resolve=False,
64
- valtyp: Type[T] = str,
65
- ) -> T:
73
+ valtyp: Type[GetReturnT] = str,
74
+ ) -> GetReturnT:
66
75
  """
67
76
  Returns the configuration value.
68
77
 
@@ -90,7 +99,7 @@ class Configuration:
90
99
  val = None
91
100
  break
92
101
 
93
- return cast(T, val)
102
+ return cast(GetReturnT, val)
94
103
 
95
104
  def has(self, key: str):
96
105
  try:
File without changes
File without changes
File without changes
File without changes