[PR #961] [MERGED] [FEAT] Check port access in docker before showing a default error #3539

Closed
opened 2026-02-22 18:33:59 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/961
Author: @ivanskodje
Created: 3/23/2024
Status: Merged
Merged: 4/2/2024
Merged by: @timothycarambat

Base: masterHead: 959-check-port-access-in-docker-before-showing-error


📝 Commits (4)

  • 0774f9a [FEAT] Added port checks in updateENV.validDockerizedUrl to prevent docker from assuming it cannot access localhost URLs
  • 54375bb [CHORE] Updated error message to include Linux URL
  • 3d111c5 Patch port checking for general loopbacks
  • 0c053c2 typo

📊 Changes

2 files changed (+74 additions, -9 deletions)

View changed files

server/utils/helpers/portAvailabilityChecker.js (+46 -0)
📝 server/utils/helpers/updateENV.js (+28 -9)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #959

What is in this change?

In validDockerizedUrl (which only runs in docker environments) we now do a port check before we simply assume that the user cannot connect to the port. When you run docker in host network mode, it is perfectly fine to use localhost URLs.

Additional Information

  • Since host.docker.internal is not available in Linux systems, I have added the Docker URL for Linux in the error message.
  • Added handling of async functions in a separate method, so you can now make a validation function async if needed

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/961 **Author:** [@ivanskodje](https://github.com/ivanskodje) **Created:** 3/23/2024 **Status:** ✅ Merged **Merged:** 4/2/2024 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `959-check-port-access-in-docker-before-showing-error` --- ### 📝 Commits (4) - [`0774f9a`](https://github.com/Mintplex-Labs/anything-llm/commit/0774f9a4528eab9d0bc1dae7216c3573004606ae) [FEAT] Added port checks in updateENV.validDockerizedUrl to prevent docker from assuming it cannot access localhost URLs - [`54375bb`](https://github.com/Mintplex-Labs/anything-llm/commit/54375bbe3d2c616e45837c60f81cd08955457ca1) [CHORE] Updated error message to include Linux URL - [`3d111c5`](https://github.com/Mintplex-Labs/anything-llm/commit/3d111c5afebd21beed508c0a5dff42f5ac696612) Patch port checking for general loopbacks - [`0c053c2`](https://github.com/Mintplex-Labs/anything-llm/commit/0c053c2d8d026324aa6ecdcf8206ac3569def872) typo ### 📊 Changes **2 files changed** (+74 additions, -9 deletions) <details> <summary>View changed files</summary> ➕ `server/utils/helpers/portAvailabilityChecker.js` (+46 -0) 📝 `server/utils/helpers/updateENV.js` (+28 -9) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat - [ ] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [x] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #959 ### What is in this change? In validDockerizedUrl (which only runs in docker environments) we now do a port check before we simply _assume_ that the user cannot connect to the port. When you run docker in host network mode, it is perfectly fine to use localhost URLs. ### Additional Information - Since host.docker.internal is not available in Linux systems, I have added the Docker URL for Linux in the error message. - Added handling of async functions in a separate method, so you can now make a validation function async if needed ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:33:59 -05:00
yindo closed this issue 2026-02-22 18:33:59 -05:00
yindo changed title from [PR #961] [FEAT] Check port access in docker before showing a default error to [PR #961] [MERGED] [FEAT] Check port access in docker before showing a default error 2026-06-05 15:13:56 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#3539