Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.
fix(install): validate Compose before saving port changes
Dongdong Chen2333312a4e5c
diff --git a/scripts/install.test.ts b/scripts/install.test.tsindex f358a7a5..0697a124 100644--- a/scripts/install.test.ts+++ b/scripts/install.test.ts@@ -930,7 +930,7 @@ esacHOME: homeDir,XDG_CACHE_HOME: xdgCache,PATH: `${fakeBin}:/usr/local/bin:/usr/bin:/bin`,- LINGER_INSTALL_BUSY_PORTS: "7883/tcp",+ LINGER_INSTALL_BUSY_PORTS: "3001,17881,7883",},input: ["1", "y"].join("\n") + "\n",});@@ -938,6 +938,9 @@ esacexpect(unsupported.stderr).toContain("requires Docker Compose 2.24.4 or later",);+ expect(await readFile(path.join(fakeRepo, ".env"), "utf8")).toBe(+ updatedEnv,+ );expect(await readFile(overridePath, "utf8")).toBe(override);});diff --git a/scripts/install/install.sh b/scripts/install/install.shindex 897541ab..18f9ccbb 100755--- a/scripts/install/install.sh+++ b/scripts/install/install.sh@@ -630,6 +630,17 @@ ensure_compose_ports() {die "Free those ports or update $env_file, then rerun $SELF_CMD."fi+ if [[ "$new_lk_http" != "$cur_lk_http" || "$new_lk_tcp" != "$cur_lk_tcp" || "$new_lk_udp" != "$cur_lk_udp" ]]; then+ local compose_version=""+ compose_version="$(docker compose version --short 2>/dev/null || true)"+ if [[ ! "$compose_version" =~ ^v?([0-9]+)\.([0-9]+)\.([0-9]+) ]] ||+ ! (( BASH_REMATCH[1] > 2 ||+ (BASH_REMATCH[1] == 2 && (BASH_REMATCH[2] > 24 ||+ (BASH_REMATCH[2] == 24 && BASH_REMATCH[3] >= 4))) )); then+ die "Automatic LiveKit port reassignment requires Docker Compose 2.24.4 or later. Update Docker Compose and rerun $SELF_CMD."+ fi+ fi+if [[ "$new_pg" != "$cur_pg" ]]; thenset_env_value "$env_file" "POSTGRES_PORT" "$new_pg"fi@@ -665,14 +676,6 @@ ensure_compose_ports() {fifiif [[ "$new_lk_http" != "$cur_lk_http" || "$new_lk_tcp" != "$cur_lk_tcp" || "$new_lk_udp" != "$cur_lk_udp" ]]; then- local compose_version=""- compose_version="$(docker compose version --short 2>/dev/null || true)"- if [[ ! "$compose_version" =~ ^v?([0-9]+)\.([0-9]+)\.([0-9]+) ]] ||- ! (( BASH_REMATCH[1] > 2 ||- (BASH_REMATCH[1] == 2 && (BASH_REMATCH[2] > 24 ||- (BASH_REMATCH[2] == 24 && BASH_REMATCH[3] >= 4))) )); then- die "Automatic LiveKit port reassignment requires Docker Compose 2.24.4 or later. Update Docker Compose and rerun $SELF_CMD."- fimkdir -p "$(dirname "$override_file")"cat > "$override_file" <<EOFservices: