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.
- {akashcli-4.6.0 → akashcli-4.6.2}/PKG-INFO +1 -1
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/relay.py +38 -9
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli.egg-info/PKG-INFO +1 -1
- {akashcli-4.6.0 → akashcli-4.6.2}/pyproject.toml +1 -1
- {akashcli-4.6.0 → akashcli-4.6.2}/README.md +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/__init__.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/_net.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/auth.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/cli.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/client.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/config.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/crypto.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/env_manager.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/exceptions.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/exec.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/integrity.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/logger.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/models.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/p2p.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/packages.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/restore.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/snapshot_crypto.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/storage.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/terminal.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/uploader.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli/utils.py +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli.egg-info/SOURCES.txt +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli.egg-info/dependency_links.txt +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli.egg-info/entry_points.txt +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli.egg-info/requires.txt +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/akashcli.egg-info/top_level.txt +0 -0
- {akashcli-4.6.0 → akashcli-4.6.2}/setup.cfg +0 -0
|
@@ -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
|
|
214
|
-
|
|
215
|
-
|
|
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
|
-
#
|
|
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
|
-
|
|
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=
|
|
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:
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|