Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT]: Add network proxy settings to route all network requests through the proxy. #1228

Open
ilxqx opened this issue Apr 29, 2024 · 3 comments
Labels
enhancement New feature or request feature request

Comments

@ilxqx
Copy link

ilxqx commented Apr 29, 2024

What would you like to see?

As is well known, there are some restrictions on the internet in certain countries, which lead to the inability to directly access some well-known websites such as Github, Google and so on. Accessing these sites requires the use of a proxy. I wonder if this app can add network proxy configuration options to meet this need?

@ilxqx ilxqx added enhancement New feature or request feature request labels Apr 29, 2024
@timothycarambat
Copy link
Member

Proxy for which features in particular?

@ilxqx
Copy link
Author

ilxqx commented Apr 30, 2024

Thank you for your reply.

image image And access to the LLM providers server... In short, whenever there is a need to send network requests in the application, there should be an opportunity to proxy them.

@lineg-it
Copy link

lineg-it commented May 10, 2024

+1

I also have the following errors in log when trying to start AnythingLLM behind a proxy:

npm ERR! code ECONNRESET
npm ERR! network Client network socket disconnected before secure TLS connection was established
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
npm ERR! A complete log of this run can be found in: /app/.npm/_logs/2024-05-10T11_50_06_115Z-debug-0.log

Working without a proxy, I'm trying to get it to work by using the same, following docker config:

networks:
  llm-network:
    external: true

services:
  anything-llm:
    container_name: anything-llm
    image: mintplexlabs/anythingllm:latest
    restart: unless-stopped
    #user: "${UID:-1000}:${GID:-1000}"
    cap_add:
      - SYS_ADMIN
    environment:
      - SERVER_PORT
      - STORAGE_DIR
      - GENERATE_SOURCEMAP
      - VITE_API_BASE
      - LLM_PROVIDER
      - OLLAMA_BASE_PATH
      - OLLAMA_MODEL_PREF
      - OLLAMA_MODEL_TOKEN_LIMIT
      - VECTOR_DB
      - CHROMA_ENDPOINT
      - DISABLE_TELEMETRY
      - PASSWORDMINCHAR
      - PASSWORDMAXCHAR
      - PASSWORDLOWERCASE
      - PASSWORDUPPERCASE
      - PASSWORDNUMERIC
      - PASSWORDSYMBOL
      - PASSWORDREQUIREMENTS
      #- NODE_TLS_REJECT_UNAUTHORIZED
      - HTTPS_PROXY
      - HTTP_PROXY
      - https_proxy
      - http_proxy
    volumes:
      - /srv/docker/anything-llm/storage:/app/server/storage
      - /srv/docker/anything-llm/.env:/app/server/.env
      - /srv/certs/LINEG-Fullchain.pem:/etc/ssl/certs/LINEG-Fullchain.pem
    labels:
      - "com.centurylinklabs.watchtower.enable=true"
      - "com.centurylinklabs.watchtower.monitor-only=true"
    networks:
      - llm-network
    #ports:
    #  - 127.0.0.1:1337:${SERVER_PORT-3000}
    extra_hosts:
      - host.docker.internal:host-gateway
    healthcheck:
      test: [ "CMD", "curl", "-f", "http://localhost:3000/api/ping" ]
      interval: 10s
      timeout: 10s
      retries: 10
      start_period: 5s
  chromadb:
    image: chromadb/chroma:latest
    container_name: chromadb
    volumes:
      - /srv/docker/chromadb:/chroma/chroma
    environment:
      - IS_PERSISTENT=TRUE
      - ANONYMIZED_TELEMETRY=False
    restart: unless-stopped
    ports:
      - 8000:${CHROMA_PORT}
    networks:
      - llm-network
    extra_hosts:
      - host.docker.internal:host-gateway
    # healthcheck not working for chromadb...
    #healthcheck:
    #  # Adjust below to match your container port
    #  test: [ "CMD", "curl", "-f", "http://localhost:8000/api/v1/heartbeat" ]
    #  interval: 30s
    #  timeout: 10s
    #  retries: 3

I would love to have a setting within AnythingLLM to make npm use the proxy for its traffic towards the internet ..
Otherwise, what can we do to properly setup a proxy for AnythingLLM to use successfully?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature request
Projects
None yet
Development

No branches or pull requests

3 participants