machinaos 0.0.86 → 0.0.87
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.
- package/cli/commands/start.py +7 -5
- package/cli/platform_.py +7 -1
- package/client/package.json +1 -1
- package/package.json +1 -1
package/cli/commands/start.py
CHANGED
|
@@ -24,7 +24,6 @@ from cli._common import build_backend_spec, error_block, free_all_ports, preflig
|
|
|
24
24
|
from cli.colors import console
|
|
25
25
|
from cli.platform_ import (
|
|
26
26
|
IS_WINDOWS,
|
|
27
|
-
IS_WSL,
|
|
28
27
|
platform_name,
|
|
29
28
|
server_dir,
|
|
30
29
|
server_venv,
|
|
@@ -122,10 +121,13 @@ def _read_version(root: Path) -> str:
|
|
|
122
121
|
|
|
123
122
|
|
|
124
123
|
def _build_specs(root: Path, cfg, *, temporal_running: bool) -> list[ServiceSpec]:
|
|
125
|
-
#
|
|
126
|
-
#
|
|
127
|
-
#
|
|
128
|
-
|
|
124
|
+
# Bind host: ``MACHINA_BIND_HOST`` overrides the auto-pick (escape
|
|
125
|
+
# hatch when the platform detection is wrong or the operator wants
|
|
126
|
+
# a specific interface). Default — native Windows stays private on
|
|
127
|
+
# 127.0.0.1; WSL + POSIX bind 0.0.0.0 so the service is reachable
|
|
128
|
+
# both via in-VM ``localhost`` AND via the WSL VM IP from the
|
|
129
|
+
# Windows host, regardless of WSL2's localhostForwarding state.
|
|
130
|
+
backend_host = os.environ.get("MACHINA_BIND_HOST") or ("127.0.0.1" if IS_WINDOWS else "0.0.0.0")
|
|
129
131
|
|
|
130
132
|
specs: list[ServiceSpec] = [
|
|
131
133
|
ServiceSpec(
|
package/cli/platform_.py
CHANGED
|
@@ -28,6 +28,7 @@ of the project agree on per-OS conventions.
|
|
|
28
28
|
from __future__ import annotations
|
|
29
29
|
|
|
30
30
|
import os
|
|
31
|
+
import platform
|
|
31
32
|
import sys
|
|
32
33
|
from pathlib import Path
|
|
33
34
|
|
|
@@ -35,7 +36,12 @@ from pathlib import Path
|
|
|
35
36
|
IS_WINDOWS = sys.platform == "win32"
|
|
36
37
|
IS_MACOS = sys.platform == "darwin"
|
|
37
38
|
IS_LINUX = sys.platform.startswith("linux")
|
|
38
|
-
|
|
39
|
+
# ``platform.release()`` returns the kernel version string. On WSL2 it
|
|
40
|
+
# always contains ``"microsoft"`` (e.g. ``5.15.167.4-microsoft-standard-WSL2``)
|
|
41
|
+
# regardless of whether ``WSL_DISTRO_NAME`` is exported into the current
|
|
42
|
+
# subprocess. Stdlib, kernel-level — survives daemonised / cron / systemd
|
|
43
|
+
# launches that strip WSL env vars.
|
|
44
|
+
IS_WSL = IS_LINUX and "microsoft" in platform.release().lower()
|
|
39
45
|
IS_GIT_BASH = IS_WINDOWS and bool(
|
|
40
46
|
os.environ.get("MSYSTEM") or "bash" in (os.environ.get("SHELL") or "")
|
|
41
47
|
)
|
package/client/package.json
CHANGED