極狐GitLab 是 GitLab 在中國的發行版,關于中文參考文檔和資料有:
- 極狐GitLab 中文文檔
- 極狐GitLab 中文論壇
- 極狐GitLab 官網
項目 API 的速率限制 (BASIC SELF)
-
引入于 15.10 版本,功能標志為rate_limit_for_unauthenticated_projects_api_access,默認禁用。
-
在私有化部署版上默認啟用于 16.0 版本。
-
在極狐GitLab Generally available in GitLab 16.0. Feature flag rate_limit_for_unauthenticated_projects_api_access removed.
-
Rate limit for group and projects API introduced in GitLab 17.1. with a flag named rate_limit_groups_and_projects_api. Disabled by default.
-
引入于 15.10 版本,功能標志為 rate_limit_for_unauthenticated_projects_api_access,默認禁用。
-
極狐GitLab 16.0 中為私有化部署版本默認開啟。
-
極狐GitLab 16.0 GA 并已移除功能開關 rate_limit_for_unauthenticated_projects_api_access。
-
針對群組和項目 API 的速率限制自極狐GitLab 17.1 引入,并使用名為 rate_limit_groups_and_projects_api 的功能開關。默認禁用。
您可以為下列[項目 API] 的每一個 IP 地址和用戶配置速率限制。
限制 | 默認值 | 查詢間隔 |
---|---|---|
GET /projects (unauthenticated requests) | 400 | 10 分鐘 |
GET /projects (authenticated requests) | 2000 | 10 分鐘 |
GET /projects/:id | 400 | 1 分鐘 |
GET /users/:user_id/projects | 300 | 1 分鐘 |
GET /users/:user_id/contributed_projects | 100 | 1 分鐘 |
GET /users/:user_id/starred_projects | 100 | 1 分鐘 |
更改速率限制:
1.在左側導航欄底部,選擇 管理中心。
2.選擇 設置 > 網絡。
3.展開 項目 API 速率限制。
4.在 每個 IP 地址每 10 分鐘的最大請求數 文本框中,輸入新值。
5.選擇 保存更改。
速率限制:
- 適用于每個 IP 地址。
- 不適用于經過身份驗證的請求。
- 可以設置為 0 來禁用速率限制。
- 除了對 GET /projects API 的未認證請求外,rate_limit_groups_and_projects_api 背后還有其他限制。
超過速率限制的請求將記錄到 auth.log 文件中。
例如,您將限制設置為 400,則會阻止在 10 分鐘內超過 400 速率的對 GET /projects/:id API 端點的未經身份驗證的請求。十分鐘后恢復對端點的訪問。