服务器配置 Qdrant 代码库索引并用 Cloudflare Tunnel 实现 RooCode 公网访问

服务器配置 Qdrant 代码库索引并用 Cloudflare Tunnel 实现 RooCode 公网访问

各种智能体工具用下来,还是 VSCode 的 RooCode 插件较得我心。

现 RooCode 支持 Qdrant 代码库索引。 本教程实现在服务器上用 Docker Compose 部署 Qdrant 服务并配置 Cloudflare Tunnel 实现 RooCode 从公网访问代码索引。

部署 Qdrant

  1. 创建 Docker Compose 文件:

    请将 YourApiKey 替换为您想要设置的 API 密钥。

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    services:
    qdrant:
    image: qdrant/qdrant:latest
    container_name: qdrant
    restart: always
    ports:
    - "6333:6333"
    - "6334:6334"
    environment:
    QDRANT__SERVICE__READ_ONLY_API_KEY: "YourApiKey"
    volumes:
    - ./data:/qdrant/storage
  2. 执行 docker compose up -d 启动服务:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    [15:26:11] with username in username
    $ cd ~/.local/bin/

    [15:26:19] with username in bin
    $ cd qdrant

    [15:26:22] with username in qdrant
    $ bat docker-compose.yml
    ───────┬──────────────────────────────────────────────────────────────────
    │ File: docker-compose.yml
    ───────┼──────────────────────────────────────────────────────────────────
    1 │ services:
    2 │ qdrant:
    3 │ image: qdrant/qdrant:latest
    4 │ container_name: qdrant
    5 │ restart: always
    6 │ ports:
    7 │ - "6333:6333"
    8 │ - "6334:6334"
    9 │ environment:
    10 │ QDRANT__SERVICE__READ_ONLY_API_KEY: "YourApiKey"
    11 │ volumes:
    12 │ - ./data:/qdrant/storage
    ───────┴─────────────────────────────────────────────────────────────────

    [15:26:58] with username in qdrant
    $ docker compose up -d
  3. 执行 curl http://localhost:6333 检查服务是否启动成功,并可访问:

    1
    2
    3
    [15:28:20] with username in qdrant
    $ curl http://localhost:6333
    {"title":"qdrant - vector search engine","version":"1.1X.x","commit":"afxax5b192f0xc9d9cd7fxf119eab2ae737x5cc0"}

配置 Cloudflare Tunnel

  1. 创建 Cloudflare Tunnel:

    域名服务类型服务 URL
    您的域名HTTPhttp://localhost:6333

    保存。

  2. 在客户机器测试访问:

    1
    curl https://您的域名

    应返回与在服务器上执行 curl http://localhost:6333 返回的相同内容。

配置 RooCode

  1. 点击 RooCode 插件右下角的“数据库”图标按钮,打开“代码库索引”设置浮窗。
  2. 设置“嵌入器提供商”。截止文章首次编写时, 推荐 jina-embeddings-v4(强大、提供试用 Token)、Qwen3-Embedding-8B(不赖)、 BAAI/bge-m3(略过时,但硅基流动提供免费调用)。配置过程在此处不赘述。
  3. “Qdrant URL”处填写 https://您的域名/
  4. “Qdrant API 密钥”处填写您将 YourApiKey 替换为的 API 密钥值。
  5. “保存”并点击“开始”。

服务器配置 Qdrant 代码库索引并用 Cloudflare Tunnel 实现 RooCode 公网访问

https://blog.pj568.sbs/2025/09-15-roo_qdrant_cf_tunnel/

作者

PJ568

发布于

2025-09-15

更新于

2025-09-15

许可协议

评论