Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

fix(9router): proxy over internal Docker network

Rahman82934581fefd
diff --git a/docs/9ROUTER-INTEGRATION.md b/docs/9ROUTER-INTEGRATION.md
index 0fa2411b..90fa13b9 100644
--- a/docs/9ROUTER-INTEGRATION.md
+++ b/docs/9ROUTER-INTEGRATION.md
@@ -28,6 +28,7 @@ restart: unless-stopped
host bind: 127.0.0.1:20128 -> container 20128 (0.0.0.0 only with NINE_ROUTER_EXPOSE_PUBLIC=1)
state: ~/.9router -> /app/data
DATA_DIR: /app/data
+proxy network: joins `NINE_ROUTER_PROXY_NETWORK` (default `dokploy-network`) when that network exists, while keeping the host port loopback-only
health: GET http://127.0.0.1:20128/api/health
health/version display: GET http://127.0.0.1:20128/api/health and /api/version
update identity: running RepoDigest == security/managed-app-artifacts.env
@@ -78,8 +79,7 @@ widened session cookie is actually issued. When this route exists, MSO prefers i
public-IP fallback and renders the dashboard in-shell. A failing domain must still not make the
running 9Router runtime appear unavailable.
-An older standalone hostname such as `9-router.example.com` may continue proxying directly
-to port 20128. MSO does not need to delete or replace it when enabling managed-app support.
+An older standalone hostname such as `9-router.example.com` should proxy over the shared internal Docker network to `http://9router:20128` when Traefik runs in Docker. Do not target the host bridge IP while the host publish remains loopback-only. MSO does not need to delete or replace it when enabling managed-app support.
## CLI view
diff --git a/lib/managed-apps/catalog.test.ts b/lib/managed-apps/catalog.test.ts
index 1f5f8e23..6fd73e4a 100644
--- a/lib/managed-apps/catalog.test.ts
+++ b/lib/managed-apps/catalog.test.ts
@@ -29,6 +29,8 @@ describe("managed app catalog", () => {
it("keeps 9Router loopback-only unless public exposure is explicitly enabled", () => {
const source = readFileSync(new URL("../../scripts/managed-app-9router", import.meta.url), "utf8");
expect(source).toContain('EXPOSE_PUBLIC="${NINE_ROUTER_EXPOSE_PUBLIC:-0}"');
+ expect(source).toContain('PROXY_NETWORK="${NINE_ROUTER_PROXY_NETWORK:-dokploy-network}"');
+ expect(source).toContain('network_args=(--network "$PROXY_NETWORK")');
expect(source).toContain('0) BIND=127.0.0.1');
expect(source).toContain('-p "$BIND:$PORT:$PORT"');
expect(source).not.toContain('-p "$PORT:$PORT"');
diff --git a/scripts/managed-app-9router b/scripts/managed-app-9router
index c19de57c..1a1e461c 100755
--- a/scripts/managed-app-9router
+++ b/scripts/managed-app-9router
@@ -35,6 +35,7 @@ readonly NINE_ROUTER_IMAGE_REF IMAGE EXPECTED_DIGEST
EXPOSE_PUBLIC="${NINE_ROUTER_EXPOSE_PUBLIC:-0}"
case "$EXPOSE_PUBLIC" in 0) BIND=127.0.0.1 ;; 1) BIND=0.0.0.0 ;; *) echo "NINE_ROUTER_EXPOSE_PUBLIC must be 0 or 1" >&2; exit 2 ;; esac
DATA="${NINE_ROUTER_DATA:-$HOME/.9router}"
+PROXY_NETWORK="${NINE_ROUTER_PROXY_NETWORK:-dokploy-network}"
BASE="http://127.0.0.1:${PORT}"
installed() { docker ps -a --format '{{.Names}}' | grep -qx "$NAME"; }
@@ -100,11 +101,16 @@ cmd_update() {
fi
mkdir -p "$DATA"
- echo "==> recreate $NAME (bind $BIND:$PORT)"
+ local network_args=()
+ if docker network inspect "$PROXY_NETWORK" >/dev/null 2>&1; then
+ network_args=(--network "$PROXY_NETWORK")
+ fi
+ echo "==> recreate $NAME (bind $BIND:$PORT${network_args:+, network $PROXY_NETWORK})"
docker rm -f "$NAME" 2>/dev/null || true
docker run -d \
--name "$NAME" \
--restart unless-stopped \
+ "${network_args[@]}" \
-p "$BIND:$PORT:$PORT" \
-v "$DATA:/app/data" \
-e DATA_DIR=/app/data \