runspec-linux 0.7.0__tar.gz → 0.8.0__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.
Potentially problematic release.
This version of runspec-linux might be problematic. Click here for more details.
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/CHANGELOG.md +10 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/PKG-INFO +2 -2
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/pyproject.toml +2 -2
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/containers.py +8 -3
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/runspec.toml +63 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/.gitignore +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/__init__.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/_escalation.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/commands.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/files.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/fs/__init__.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/fs/_dispatch.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/fs/_worker.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/fs/cli.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/investigate.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/logs.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/nc_command.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/network.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/packages.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/perf.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/power.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/security.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/services.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/sudoers.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/system_info.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/venvs.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/runspec_linux/webops.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/tests/__init__.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/tests/test_escalation.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/tests/test_fs.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/tests/test_nc_send.py +0 -0
- {runspec_linux-0.7.0 → runspec_linux-0.8.0}/tests/test_webops.py +0 -0
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# runspec-linux Changelog
|
|
2
2
|
|
|
3
|
+
## [0.8.0] — 2026-08-07
|
|
4
|
+
|
|
5
|
+
The Docker runnables can now run as another user. `list-containers`,
|
|
6
|
+
`container-logs`, and `restart-container` gain the mutually-exclusive
|
|
7
|
+
`--run-as <user>` / `--sudo` pair (+ `--become-method sudo|su`) — the same
|
|
8
|
+
`exclusive`-group escalation the service/log runnables use — so they work where
|
|
9
|
+
the Docker socket needs root or `docker`-group membership (`--sudo` runs docker
|
|
10
|
+
as root). Requires `runspec-linux-core >= 0.5.0`.
|
|
11
|
+
|
|
12
|
+
|
|
3
13
|
## [0.7.0] — 2026-08-01
|
|
4
14
|
|
|
5
15
|
Enhancements for corporate application support, devops, and performance work.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: runspec-linux
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
4
|
Summary: Linux system admin runnables for runspec
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Requires-Dist: runspec-fs-core>=0.2.0
|
|
7
|
-
Requires-Dist: runspec-linux-core>=0.
|
|
7
|
+
Requires-Dist: runspec-linux-core>=0.5.0
|
|
8
8
|
Requires-Dist: runspec-webops-core>=0.1.0
|
|
9
9
|
Requires-Dist: runspec>=0.44.0
|
|
10
10
|
Provides-Extra: dev
|
|
@@ -4,12 +4,12 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "runspec-linux"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.8.0"
|
|
8
8
|
requires-python = ">=3.10"
|
|
9
9
|
description = "Linux system admin runnables for runspec"
|
|
10
10
|
dependencies = [
|
|
11
11
|
"runspec>=0.44.0",
|
|
12
|
-
"runspec-linux-core>=0.
|
|
12
|
+
"runspec-linux-core>=0.5.0",
|
|
13
13
|
"runspec-webops-core>=0.1.0",
|
|
14
14
|
"runspec-fs-core>=0.2.0",
|
|
15
15
|
]
|
|
@@ -5,12 +5,15 @@ import runspec as rs
|
|
|
5
5
|
from runspec_linux_core import container_logs, list_containers, restart_container
|
|
6
6
|
from runspec_linux_core.errors import CommandError
|
|
7
7
|
|
|
8
|
+
from runspec_linux._escalation import resolve_escalation
|
|
9
|
+
|
|
8
10
|
|
|
9
11
|
def main_list_containers() -> None:
|
|
10
12
|
spec = rs.parse("list-containers")
|
|
11
13
|
include_all = spec.all.value
|
|
14
|
+
run_as, method = resolve_escalation(spec)
|
|
12
15
|
try:
|
|
13
|
-
print(json.dumps(list_containers(include_all)))
|
|
16
|
+
print(json.dumps(list_containers(include_all, run_as=run_as, become_method=method)))
|
|
14
17
|
except Exception as e:
|
|
15
18
|
# Includes ToolNotFoundError (docker absent) and CommandError (docker ps failed).
|
|
16
19
|
print(json.dumps({"error": str(e)}))
|
|
@@ -21,8 +24,9 @@ def main_container_logs() -> None:
|
|
|
21
24
|
spec = rs.parse("container-logs")
|
|
22
25
|
container = spec.container.value
|
|
23
26
|
lines = spec.lines.value
|
|
27
|
+
run_as, method = resolve_escalation(spec)
|
|
24
28
|
try:
|
|
25
|
-
print(json.dumps(container_logs(container, lines)))
|
|
29
|
+
print(json.dumps(container_logs(container, lines, run_as=run_as, become_method=method)))
|
|
26
30
|
except Exception as e:
|
|
27
31
|
print(json.dumps({"error": str(e)}))
|
|
28
32
|
sys.exit(1)
|
|
@@ -31,8 +35,9 @@ def main_container_logs() -> None:
|
|
|
31
35
|
def main_restart_container() -> None:
|
|
32
36
|
spec = rs.parse("restart-container")
|
|
33
37
|
container = spec.container.value
|
|
38
|
+
run_as, method = resolve_escalation(spec)
|
|
34
39
|
try:
|
|
35
|
-
print(json.dumps(restart_container(container)))
|
|
40
|
+
print(json.dumps(restart_container(container, run_as=run_as, become_method=method)))
|
|
36
41
|
except CommandError as e:
|
|
37
42
|
print(json.dumps({"container": container, "restarted": False, "error": str(e)}))
|
|
38
43
|
sys.exit(1)
|
|
@@ -355,6 +355,27 @@ short = "-a"
|
|
|
355
355
|
description = "Include stopped containers"
|
|
356
356
|
default = false
|
|
357
357
|
|
|
358
|
+
# Escalation: the Docker daemon socket is usually root/docker-group owned.
|
|
359
|
+
[list-containers.args.run-as]
|
|
360
|
+
type = "str"
|
|
361
|
+
description = "Run docker as this specific OS user (via sudo -n -u / su). Mutually exclusive with --sudo."
|
|
362
|
+
required = false
|
|
363
|
+
|
|
364
|
+
[list-containers.args.sudo]
|
|
365
|
+
type = "flag"
|
|
366
|
+
description = "Run docker as root (via sudo). Mutually exclusive with --run-as."
|
|
367
|
+
default = false
|
|
368
|
+
|
|
369
|
+
[list-containers.args.become-method]
|
|
370
|
+
type = "choice"
|
|
371
|
+
options = ["sudo", "su"]
|
|
372
|
+
description = "How to escalate for --run-as/--sudo: sudo (passwordless, -n) or su."
|
|
373
|
+
default = "sudo"
|
|
374
|
+
|
|
375
|
+
[list-containers.groups.escalation]
|
|
376
|
+
exclusive = true
|
|
377
|
+
args = ["run-as", "sudo"]
|
|
378
|
+
|
|
358
379
|
[container-logs]
|
|
359
380
|
serve = ["local"]
|
|
360
381
|
description = "Fetch recent log output from a Docker container"
|
|
@@ -372,6 +393,27 @@ short = "-n"
|
|
|
372
393
|
description = "Number of lines to return"
|
|
373
394
|
default = 50
|
|
374
395
|
|
|
396
|
+
# Escalation: the Docker daemon socket is usually root/docker-group owned.
|
|
397
|
+
[container-logs.args.run-as]
|
|
398
|
+
type = "str"
|
|
399
|
+
description = "Run docker as this specific OS user (via sudo -n -u / su). Mutually exclusive with --sudo."
|
|
400
|
+
required = false
|
|
401
|
+
|
|
402
|
+
[container-logs.args.sudo]
|
|
403
|
+
type = "flag"
|
|
404
|
+
description = "Run docker as root (via sudo). Mutually exclusive with --run-as."
|
|
405
|
+
default = false
|
|
406
|
+
|
|
407
|
+
[container-logs.args.become-method]
|
|
408
|
+
type = "choice"
|
|
409
|
+
options = ["sudo", "su"]
|
|
410
|
+
description = "How to escalate for --run-as/--sudo: sudo (passwordless, -n) or su."
|
|
411
|
+
default = "sudo"
|
|
412
|
+
|
|
413
|
+
[container-logs.groups.escalation]
|
|
414
|
+
exclusive = true
|
|
415
|
+
args = ["run-as", "sudo"]
|
|
416
|
+
|
|
375
417
|
[restart-container]
|
|
376
418
|
serve = ["local"]
|
|
377
419
|
description = "Restart a Docker container"
|
|
@@ -383,6 +425,27 @@ type = "str"
|
|
|
383
425
|
short = "-c"
|
|
384
426
|
description = "Container name or ID"
|
|
385
427
|
|
|
428
|
+
# Escalation: the Docker daemon socket is usually root/docker-group owned.
|
|
429
|
+
[restart-container.args.run-as]
|
|
430
|
+
type = "str"
|
|
431
|
+
description = "Run docker as this specific OS user (via sudo -n -u / su). Mutually exclusive with --sudo."
|
|
432
|
+
required = false
|
|
433
|
+
|
|
434
|
+
[restart-container.args.sudo]
|
|
435
|
+
type = "flag"
|
|
436
|
+
description = "Run docker as root (via sudo). Mutually exclusive with --run-as."
|
|
437
|
+
default = false
|
|
438
|
+
|
|
439
|
+
[restart-container.args.become-method]
|
|
440
|
+
type = "choice"
|
|
441
|
+
options = ["sudo", "su"]
|
|
442
|
+
description = "How to escalate for --run-as/--sudo: sudo (passwordless, -n) or su."
|
|
443
|
+
default = "sudo"
|
|
444
|
+
|
|
445
|
+
[restart-container.groups.escalation]
|
|
446
|
+
exclusive = true
|
|
447
|
+
args = ["run-as", "sudo"]
|
|
448
|
+
|
|
386
449
|
# ── Packages ──────────────────────────────────────────────────────────────────
|
|
387
450
|
|
|
388
451
|
[list-packages]
|
|
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
|