@jeffreycao/copilot-api 2.5.5 → 2.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -442,13 +442,13 @@ docker compose ps
|
|
|
442
442
|
|
|
443
443
|
If `COPILOT_API_GITHUB_TOKEN` or the legacy `GH_TOKEN` is already available in your environment or a private `.env` file, you can skip `--auth login`. A GitHub token authorizes access to GitHub Copilot; it does not replace the gateway API key configured above.
|
|
444
444
|
|
|
445
|
-
Before every server or authentication run, the one-shot `data-init` service repairs ownership of the mounted data directory. This lets the non-root server reuse files written by an earlier root container, including mode `0600` configuration files. The host directory defaults to `./copilot-data`, matching the earlier Docker instructions; Compose mounts it at `/data` and sets `COPILOT_API_HOME` accordingly. Set `COPILOT_API_DATA_DIR` in the environment or your own `.env` to use an existing directory elsewhere.
|
|
445
|
+
Before every server or authentication run, the one-shot `data-init` service repairs ownership of the gateway's own state in the mounted data directory: `config.json`, `github_token` (including the enterprise `ent_github_token` and OAuth app subdirectories such as `opencode/github_token`), `codex_credentials.json`, `desktop-config.json`, `copilot-api.sqlite*`, `logs/`, and `cache/`. Other files and directories in the mount are left untouched. This lets the non-root server reuse files written by an earlier root container, including mode `0600` configuration files. The host directory defaults to `./copilot-data`, matching the earlier Docker instructions; Compose mounts it at `/data` and sets `COPILOT_API_HOME` accordingly. Set `COPILOT_API_DATA_DIR` in the environment or your own `.env` to use an existing directory elsewhere.
|
|
446
446
|
|
|
447
447
|
```dotenv
|
|
448
448
|
COPILOT_API_DATA_DIR=/absolute/path/to/copilot-data
|
|
449
449
|
```
|
|
450
450
|
|
|
451
|
-
Create the host directory before the first run. Compose does not auto-create a missing host directory (`create_host_path: false`), so a typo in `COPILOT_API_DATA_DIR` fails fast instead of starting with empty state. The one-shot `data-init` service also refuses unsafe values such as
|
|
451
|
+
Create the host directory before the first run. Compose does not auto-create a missing host directory (`create_host_path: false`), so a typo in `COPILOT_API_DATA_DIR` fails fast instead of starting with empty state. The one-shot `data-init` service also refuses unsafe values such as `/`, and refuses to run when the mount contains system directories (`/etc`, `/usr`, and so on), which means the path resolved to a system root.
|
|
452
452
|
|
|
453
453
|
The local endpoint is `http://127.0.0.1:4141`. To publish the gateway on every host interface after configuring a gateway API key, add this to your `.env`:
|
|
454
454
|
|
package/README.zh-CN.md
CHANGED
|
@@ -472,13 +472,13 @@ docker compose ps
|
|
|
472
472
|
|
|
473
473
|
如果环境变量或用户自己创建的私有 `.env` 中已经设置 `COPILOT_API_GITHUB_TOKEN` 或旧变量 `GH_TOKEN`,可以跳过 `--auth login`。GitHub token 用于访问 GitHub Copilot,不能替代上面配置的 gateway API Key。
|
|
474
474
|
|
|
475
|
-
每次启动服务或执行认证命令前,一次性的 `data-init`
|
|
475
|
+
每次启动服务或执行认证命令前,一次性的 `data-init` 服务只会修复挂载目录中属于 gateway 自身的状态文件:`config.json`、`github_token`(含企业版的 `ent_github_token`,以及 `opencode/github_token` 这类 OAuth 应用子目录)、`codex_credentials.json`、`desktop-config.json`、`copilot-api.sqlite*`、`logs/` 和 `cache/`。挂载目录中的其他文件和目录不会被改动。因此非 root 服务可以直接复用旧 root 容器写入的数据,包括权限为 `0600` 的配置文件。宿主机目录仍默认使用旧 Docker 文档中的 `./copilot-data`;Compose 将它挂载到 `/data`,并设置对应的 `COPILOT_API_HOME`。如需复用其他位置的已有目录,可在环境变量或用户自己的 `.env` 中设置 `COPILOT_API_DATA_DIR`。
|
|
476
476
|
|
|
477
477
|
```dotenv
|
|
478
478
|
COPILOT_API_DATA_DIR=/absolute/path/to/copilot-data
|
|
479
479
|
```
|
|
480
480
|
|
|
481
|
-
首次运行前请先建好宿主机目录。Compose 不会自动创建缺失的宿主机目录(`create_host_path: false`),因此 `COPILOT_API_DATA_DIR` 写错会直接报错,而不会以空状态启动。一次性的 `data-init`
|
|
481
|
+
首次运行前请先建好宿主机目录。Compose 不会自动创建缺失的宿主机目录(`create_host_path: false`),因此 `COPILOT_API_DATA_DIR` 写错会直接报错,而不会以空状态启动。一次性的 `data-init` 服务在改归属前会拒绝 `/` 这类危险路径;当挂载内容中出现 `/etc`、`/usr` 等系统目录时(说明路径实际指向了系统根目录)也会直接拒绝运行。
|
|
482
482
|
|
|
483
483
|
默认本地地址为 `http://127.0.0.1:4141`。配置好 gateway API Key 后,如需监听宿主机所有网卡,可在用户自己的 `.env` 中设置:
|
|
484
484
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@jeffreycao/copilot-api",
|
|
4
|
-
"version": "2.5.
|
|
4
|
+
"version": "2.5.6",
|
|
5
5
|
"description": "GitHub Copilot, OpenAI Codex, OpenCode Go, and third-party AI provider gateway with OpenAI and Anthropic API compatibility.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"github-copilot",
|