akashcli 4.6.0__tar.gz → 4.6.2__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 (32) hide show
  1. {akashcli-4.6.0 → akashcli-4.6.2}/PKG-INFO +1 -1
  2. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/relay.py +38 -9
  3. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli.egg-info/PKG-INFO +1 -1
  4. {akashcli-4.6.0 → akashcli-4.6.2}/pyproject.toml +1 -1
  5. {akashcli-4.6.0 → akashcli-4.6.2}/README.md +0 -0
  6. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/__init__.py +0 -0
  7. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/_net.py +0 -0
  8. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/auth.py +0 -0
  9. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/cli.py +0 -0
  10. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/client.py +0 -0
  11. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/config.py +0 -0
  12. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/crypto.py +0 -0
  13. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/env_manager.py +0 -0
  14. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/exceptions.py +0 -0
  15. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/exec.py +0 -0
  16. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/integrity.py +0 -0
  17. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/logger.py +0 -0
  18. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/models.py +0 -0
  19. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/p2p.py +0 -0
  20. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/packages.py +0 -0
  21. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/restore.py +0 -0
  22. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/snapshot_crypto.py +0 -0
  23. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/storage.py +0 -0
  24. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/terminal.py +0 -0
  25. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/uploader.py +0 -0
  26. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/utils.py +0 -0
  27. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli.egg-info/SOURCES.txt +0 -0
  28. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli.egg-info/dependency_links.txt +0 -0
  29. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli.egg-info/entry_points.txt +0 -0
  30. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli.egg-info/requires.txt +0 -0
  31. {akashcli-4.6.0 → akashcli-4.6.2}/akashcli.egg-info/top_level.txt +0 -0
  32. {akashcli-4.6.0 → akashcli-4.6.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: akashcli
3
- Version: 4.6.0
3
+ Version: 4.6.2
4
4
  Summary: Akash CLI — secure remote shell relay, file vault, and device management
5
5
  License: MIT
6
6
  Keywords: akash,cli,relay,remote-shell,vault
@@ -210,29 +210,52 @@ def _handle_pty(ws, frame: dict) -> None:
210
210
  pass
211
211
 
212
212
  def _child_setup():
213
- """Run inside the child process before exec — creates a new session
214
- and attaches the slave PTY as the controlling terminal so bash gets
215
- full job control (no 'cannot set terminal process group' errors)."""
216
- os.setsid()
213
+ """Run inside the child process before exec.
214
+ start_new_session=True already called setsid(); claim the slave PTY
215
+ as controlling terminal so bash gets full job control when possible."""
217
216
  try:
218
217
  fcntl.ioctl(0, termios.TIOCSCTTY, 0)
219
218
  except Exception:
220
219
  pass
221
220
 
222
221
  import subprocess as _sp
222
+ import tempfile as _tmp
223
+
223
224
  shell = command or os.environ.get("SHELL", "/bin/bash")
224
225
 
225
- # Run the shell directly so it gets a proper controlling terminal.
226
+ # On Android non-root, TIOCSCTTY is blocked by SELinux so bash prints:
227
+ # "cannot set terminal process group … no job control"
228
+ # Fix: launch bash with --rcfile pointing to a temp file that sources
229
+ # ~/.bashrc then runs `set +m` (disable job-control monitoring).
230
+ # This silences the warning while keeping the shell fully interactive.
231
+ _env = {**os.environ,
232
+ "TERM": "xterm-256color",
233
+ "COLUMNS": str(cols), "LINES": str(rows)}
234
+ _bash_env_file = None
235
+ _shell_args = [shell]
236
+ if "bash" in shell.lower():
237
+ try:
238
+ _fd, _bash_env_file = _tmp.mkstemp(prefix=".akash_rc_", suffix=".sh")
239
+ # Source ~/.bashrc if it exists, then disable job-control monitoring
240
+ _rc = (
241
+ b'[ -f ~/.bashrc ] && . ~/.bashrc\n'
242
+ b'set +m\n'
243
+ )
244
+ os.write(_fd, _rc)
245
+ os.close(_fd)
246
+ _shell_args = [shell, "--rcfile", _bash_env_file]
247
+ except Exception:
248
+ _bash_env_file = None
249
+
226
250
  try:
227
251
  proc = _sp.Popen(
228
- [shell],
252
+ _shell_args,
229
253
  stdin=slave_fd, stdout=slave_fd, stderr=slave_fd,
230
254
  close_fds=True,
255
+ start_new_session=True,
231
256
  preexec_fn=_child_setup,
232
257
  cwd=os.path.expanduser("~"),
233
- env={**os.environ,
234
- "TERM": "xterm-256color",
235
- "COLUMNS": str(cols), "LINES": str(rows)},
258
+ env=_env,
236
259
  )
237
260
  except Exception as e:
238
261
  try:
@@ -324,6 +347,12 @@ def _handle_pty(ws, frame: dict) -> None:
324
347
  os.close(master_fd)
325
348
  except Exception:
326
349
  pass
350
+ # Clean up the BASH_ENV temp file if we created one
351
+ if _bash_env_file:
352
+ try:
353
+ os.unlink(_bash_env_file)
354
+ except Exception:
355
+ pass
327
356
  try:
328
357
  ws.send(json.dumps({"type": "exit", "code": proc.returncode or 0}))
329
358
  except Exception:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: akashcli
3
- Version: 4.6.0
3
+ Version: 4.6.2
4
4
  Summary: Akash CLI — secure remote shell relay, file vault, and device management
5
5
  License: MIT
6
6
  Keywords: akash,cli,relay,remote-shell,vault
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "akashcli"
3
- version = "4.6.0"
3
+ version = "4.6.2"
4
4
  description = "Akash CLI — secure remote shell relay, file vault, and device management"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.9"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes