mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-14 10:17:55 +00:00
fix: refuse the Docker-only options in native mode instead of ignoring them
`up --native` took --expose, --domain and --docling and did nothing with them. Asking for network exposure and silently getting a loopback-only install, or asking for docling and getting an install without it, is worse than being told. Each now says what to do instead: a reverse proxy or the Docker stack for exposure, and the docling extra for the parser engine. --expose local and --no-docling already describe native mode, so they stay silent.
This commit is contained in:
1 parent
501baf8aae
commit
6cfd0948bc
2 files changed
+33
No files matched your search
@@ -240,6 +240,22 @@ def _docsgpt_launcher() -> list[str]:
|
||||
)
|
||||
|
||||
|
||||
def _refuse_docker_only_options(args) -> None:
|
||||
"""Options that only mean something to the Docker stack, refused rather than quietly ignored."""
|
||||
if getattr(args, "domain", None) or getattr(args, "expose", None) in ("network", "domain"):
|
||||
raise DeployError(
|
||||
"a native install serves on 127.0.0.1 only, so --domain, --expose network and "
|
||||
"--expose domain have nothing to act on here. Put a reverse proxy in front of it, or run "
|
||||
"the Docker stack with `docsgpt up --expose ...`, which brings its own Caddy for a domain."
|
||||
)
|
||||
if getattr(args, "docling", None):
|
||||
raise DeployError(
|
||||
"--docling selects a Docker image variant, which a native install does not use. Install the "
|
||||
'parser engine into this environment instead, with `uv tool install "docsgpt[docling]"` or '
|
||||
'`pip install "docsgpt[docling]"`, then run `docsgpt up --native` again.'
|
||||
)
|
||||
|
||||
|
||||
def _native_port(env: Mapping[str, str]) -> str:
|
||||
"""The port a native install listens on."""
|
||||
return str(env.get("DOCSGPT_PORT") or stack.DEFAULT_PORT)
|
||||
@@ -252,6 +268,7 @@ def _native_address(env: Mapping[str, str]) -> str:
|
||||
|
||||
def _native_up(args, context: Context, directory: Path) -> int:
|
||||
"""Run the API and the worker as services on this machine, against an existing Postgres and Redis."""
|
||||
_refuse_docker_only_options(args)
|
||||
services = context.service_manager()
|
||||
env_path = directory / ".env"
|
||||
existing = envfile.read(env_path)
|
||||
|
||||
Reference in new issue
Block a user