zscams 2.0.4__tar.gz → 2.0.6__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.4 → zscams-2.0.6}/PKG-INFO +1 -4
  2. {zscams-2.0.4 → zscams-2.0.6}/pyproject.toml +2 -4
  3. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/config.yaml +1 -1
  4. zscams-2.0.6/zscams/agent/configuration/freebsd_service.j2 +20 -0
  5. zscams-2.0.4/zscams/agent/configuration/service.j2 → zscams-2.0.6/zscams/agent/configuration/linux_service.j2 +1 -0
  6. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/core/backend/bootstrap.py +4 -3
  7. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/services/reverse_ssh.py +2 -1
  8. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/services/ssh_forwarder.py +2 -1
  9. {zscams-2.0.4 → zscams-2.0.6}/zscams/deps.py +13 -1
  10. {zscams-2.0.4 → zscams-2.0.6}/README.md +0 -0
  11. {zscams-2.0.4 → zscams-2.0.6}/zscams/__init__.py +0 -0
  12. {zscams-2.0.4 → zscams-2.0.6}/zscams/__main__.py +0 -0
  13. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/__init__.py +0 -0
  14. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/certificates/.gitkeep +0 -0
  15. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/configuration/config.j2 +0 -0
  16. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/keys/autoport.key +0 -0
  17. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/__init__.py +0 -0
  18. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/core/__init__.py +0 -0
  19. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/core/backend/client.py +0 -0
  20. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/core/backend/exceptions.py +0 -0
  21. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/core/backend/update_machine_info.py +0 -0
  22. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/core/prerequisites.py +0 -0
  23. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/core/service_health_check.py +0 -0
  24. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/core/services.py +0 -0
  25. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/core/tunnel/__init__.py +0 -0
  26. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/core/tunnel/tls.py +0 -0
  27. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/core/tunnels.py +0 -0
  28. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/services/__init__.py +0 -0
  29. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/services/system_monitor.py +0 -0
  30. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/support/__init__.py +0 -0
  31. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/support/cli.py +0 -0
  32. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/support/configuration.py +0 -0
  33. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/support/filesystem.py +0 -0
  34. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/support/logger.py +0 -0
  35. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/support/mac.py +0 -0
  36. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/support/network.py +0 -0
  37. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/support/openssl.py +0 -0
  38. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/support/os.py +0 -0
  39. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/support/ssh.py +0 -0
  40. {zscams-2.0.4 → zscams-2.0.6}/zscams/agent/src/support/yaml.py +0 -0
  41. {zscams-2.0.4 → zscams-2.0.6}/zscams/lib/.gitkeep +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zscams
3
- Version: 2.0.4
3
+ Version: 2.0.6
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
@@ -11,10 +11,7 @@ Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
13
  Classifier: Programming Language :: Python :: 3.13
14
- Requires-Dist: PyYAML ; sys_platform != "freebsd"
15
- Requires-Dist: cryptography ; sys_platform != "freebsd"
16
14
  Requires-Dist: getmac
17
- Requires-Dist: psutil ; sys_platform != "freebsd"
18
15
  Requires-Dist: requests
19
16
  Description-Content-Type: text/markdown
20
17
 
@@ -3,7 +3,7 @@ name = "zscams_agent"
3
3
 
4
4
  [tool.poetry]
5
5
  name = "zscams"
6
- version = "2.0.4"
6
+ version = "2.0.6"
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"]
@@ -14,9 +14,7 @@ packages = [ { include = "zscams"}]
14
14
  python = ">=3.9"
15
15
  requests = "*"
16
16
  getmac = "*"
17
- PyYAML = { version = "*", markers = "sys_platform != 'freebsd'" }
18
- cryptography = { version = "*", markers = "sys_platform != 'freebsd'" }
19
- psutil = { version = "*", markers = "sys_platform != 'freebsd'" }
17
+
20
18
 
21
19
  [tool.poetry.scripts]
22
20
  zscams = "zscams.__main__:main"
@@ -39,7 +39,7 @@ services:
39
39
  name: Reverse SSH
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: 10000
45
45
  server_ssh_user: ssh_user
@@ -0,0 +1,20 @@
1
+ #!/bin/sh
2
+
3
+ # PROVIDE: zscams
4
+ # REQUIRE: NETWORKING
5
+ # KEYWORD: shutdown
6
+
7
+ . /etc/rc.subr
8
+
9
+ name="zscams"
10
+ rcvar="zscams_enable"
11
+
12
+ # Execution command and arguments
13
+ command="{ python_exec }"
14
+ command_args="-m zscams"
15
+
16
+ # User to run the process
17
+ zscams_user="{user_to_run_as}"
18
+
19
+ load_rc_config $name
20
+ run_rc_command "$1"
@@ -5,6 +5,7 @@ After=network.target
5
5
  [Service]
6
6
  ExecStart={python_exec} -m zscams
7
7
  Restart=always
8
+ RestartSec=5
8
9
  User={user_to_run_as}
9
10
  Environment="PYTHONPATH={pythonpath}"
10
11
 
@@ -6,7 +6,7 @@ from typing import cast
6
6
  from zscams.agent.src.core.backend.client import backend_client
7
7
  from zscams.agent.src.support.configuration import reinitialize
8
8
  from zscams.agent.src.support.logger import get_logger
9
- from zscams.agent.src.support.os import create_system_user, install_service
9
+ from zscams.agent.src.support.os import create_system_user, install_service, is_freebsd
10
10
  from zscams.agent.src.support.ssh import add_to_authorized_keys
11
11
  from zscams.agent.src.support.cli import prompt
12
12
 
@@ -67,10 +67,11 @@ def install_zscams_systemd_service(user_to_run_as: str):
67
67
  import zscams
68
68
 
69
69
  BASE_DIR = Path(zscams.__file__).resolve().parent
70
- template_path = f"{BASE_DIR}/agent/configuration/service.j2"
70
+ filename = "linux_service.j2" if is_freebsd() else "freebsd_service.j2"
71
+ template_path = f"{BASE_DIR}/agent/configuration/{filename}.j2"
71
72
  with open(template_path) as f:
72
73
  template = f.read()
73
74
 
74
75
  rendered_config = template.format(**data)
75
76
 
76
- install_service("zscams.service", rendered_config)
77
+ install_service("zscams" if is_freebsd() else "zscams.service", rendered_config)
@@ -3,6 +3,7 @@ import json
3
3
  import os
4
4
  import sys
5
5
  from zscams.agent.src.support.logger import get_logger
6
+ from zscams.agent.src.support.filesystem import resolve_path
6
7
 
7
8
  logger = get_logger("autossh_service")
8
9
 
@@ -17,7 +18,7 @@ params = json.loads(params_env)
17
18
  LOCAL_PORT = params.get("local_port", 4422)
18
19
  SERVER_SSH_USER = params.get("server_ssh_user", "ssh_user")
19
20
  REVERSE_PORT = params.get("reverse_port", 2222)
20
- PRIVATE_KEY = params.get("private_key") # Path to RSA key
21
+ PRIVATE_KEY = resolve_path(params.get("private_key")) # Path to RSA key
21
22
  SSH_OPTIONS = params.get("ssh_options", [])
22
23
  CHECK_INTERVAL = 120 #
23
24
 
@@ -3,6 +3,7 @@ import json
3
3
  import os
4
4
  import sys
5
5
  from zscams.agent.src.support.logger import get_logger
6
+ from zscams.agent.src.support.filesystem import resolve_path
6
7
 
7
8
  logger = get_logger("autossh_service")
8
9
 
@@ -19,7 +20,7 @@ LOCAL_PORT = params.get("local_port", 4422)
19
20
  REMOTE_PORT = params.get("remote_port", 4422)
20
21
  REMOTE_HOST = params.get("remote_host", "localhost")
21
22
  SERVER_SSH_USER = params.get("server_ssh_user", "ssh_user")
22
- PRIVATE_KEY = params.get("private_key") # Path to RSA key
23
+ PRIVATE_KEY = resolve_path(params.get("private_key")) # Path to RSA key
23
24
  SSH_OPTIONS = params.get("ssh_options", [])
24
25
  CHECK_INTERVAL = 120 #
25
26
 
@@ -15,6 +15,18 @@ def ensure_native_deps():
15
15
  platform.system().lower() != "freebsd"
16
16
  and platform.system().lower() != "zscaleros"
17
17
  ):
18
+ # --- Linux/Standard Path ---
19
+ # On Linux, we just use pip to install the missing pieces
20
+ # We use 'PyYAML' instead of 'yaml' for pip
21
+ deps_map = ["cryptography", "pyyaml", "psutil"]
22
+ # Identify which modules are actually missing
23
+ missing_mods = [mod for mod in deps_map if not is_installed(mod)]
24
+ if not missing_mods:
25
+ return # Everything is already installed
26
+ print(f"--> Installing via pip: {missing_mods}")
27
+ subprocess.run(
28
+ [sys.executable, "-m", "pip", "install"] + missing_mods, check=True
29
+ )
18
30
  return
19
31
 
20
32
  # 1. Define what we need and how FreeBSD names them
@@ -81,6 +93,6 @@ def ensure_native_deps():
81
93
  print("--> Please restart your command to apply changes.")
82
94
  sys.exit(0)
83
95
  except subprocess.CalledProcessError:
84
- print("--> Error: Failed to install packages. Check your internet connection.")
96
+ print(f"--> Error: Failed to install packages. Check your internet connection.")
85
97
  print(f"--> Manual command: sudo pkg install {' '.join(targets)}")
86
98
  sys.exit(1)
File without changes
File without changes
File without changes
File without changes
File without changes