Copilot commented on code in PR #12616: URL: https://github.com/apache/apisix/pull/12616#discussion_r2348388097
########## docs/en/latest/dashboard.md: ########## @@ -0,0 +1,157 @@ +--- +title: Apache APISIX Dashboard +--- + +<!-- +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +--> + +## Overview + +[Apache APISIX Dashboard](https://github.com/apache/apisix-dashboard) provides users with an intuitive web interface to operate and manage Apache APISIX. APISIX has a built-in Dashboard UI that is enabled by default, allowing users to easily configure routes, plugins, upstream services, and more through a graphical interface. + +## Configuring Dashboard + +### Enable or Disable Dashboard + +Apache APISIX enables the embedded Dashboard by default. To modify this setting, please edit the `conf/config.yaml` file: + +```yaml title="./conf/config.yaml" +deployment: + admin: + # Enable embedded APISIX Dashboard + enable_admin_ui: true +``` + +**Configuration Description:** + +- `enable_admin_ui: true` - Enable embedded Dashboard (enabled by default) +- `enable_admin_ui: false` - Disable embedded Dashboard + +After modifying the configuration, restart Apache APISIX for changes to take effect. + +### Restrict IP Access + +Apache APISIX supports setting an IP access whitelist for the Admin API to prevent unauthorized access and attacks on Apache APISIX. + +```yaml title="./conf/config.yaml" +deployment: + admin: + # http://nginx.org/en/docs/http/ngx_http_access_module.html#allow + allow_admin: + - 127.0.0.0/24 +``` + +### Admin API Key + +The Dashboard interacts with Apache APISIX through the Admin API and requires a correct Admin API Key for authentication. + +#### Configuration + +Configure the Admin API Key in `conf/config.yaml`: + +```yaml title="./conf/config.yaml" +deployment: + admin: + admin_key: + - + name: admin + role: admin + # Using a simple Admin API Key poses security risks. Please update it when deploying to production + key: edd1c9f034335f136f87ad84b625c8f1 +``` + +Configuration via environment variables is also supported: + +```yaml title="./conf/config.yaml" +deployment: + admin: + admin_key: + - name: admin + # Read from environment variable + key: ${{ADMIN_KEY}} + role: admin +``` + +Set the environment variable before use: + +```bash +export ADMIN_KEY=your-secure-api-key +``` + +Restart Apache APISIX after modifying the configuration for changes to take effect. + +#### Using in Dashboard + +Access the Dashboard, for example at `http://127.0.0.1:9180/ui`. + +When the Admin API Key is not configured, the settings modal will pop up: + + + +If you accidentally close the settings modal, you can click the button <img src="../../assets/images/dashboard-settings-btn-icon.png" alt="Apache APISIX Dashboard - Settings btn icon" width="25px" /> on the right side of the navigation bar to reopen it. + + + +Next, enter the Admin API Key configured in the previous section. The Dashboard will automatically make a request. If configured incorrectly, the Dashboard will still display `failed to check token` in the upper right corner: + + + +If configured correctly, the Dashboard will no longer display `failed to check token`. At this point, click `X` or the blank area to close the settings modal and use normally. + + + +## FAQ + +### Why was Apache APISIX Dashboard refactored? + +Apache APISIX Dashboard has evolved through multiple versions: + +- **Version 1.x**: A simple Web UI based on Vue.js that directly called the Admin API +- **Version 2.x**: Adopted React + Ant Design Pro frontend architecture, introducing a Golang backend and database storage + +During the development of version 2.x, as community demand for features continued to increase, the project gradually became complex and bloated, while synchronization with the main APISIX version also faced challenges. + +After thorough discussion, the community decided to clarify the Dashboard's positioning and functional boundaries, returning to a lightweight design to ensure tight integration and version synchronization with the APISIX core. + +Future Apache APISIX Dashboard will focus on: + +- **Simplified Architecture**: Remove unnecessary complex components and return to the Dashboard's essential functions +- **Enhanced User Experience**: Provide an intuitive and efficient management interface +- **Version Synchronization**: Maintain synchronized releases with Apache APISIX main versions +- **Production Ready**: Ensure stability and reliability, suitable for production environments + +For more planning information, please see: [Dashboard Roadmap](https://github.com/apache/apisix-dashboard/issues/2981) + +### Release Model + +The project no longer releases independently and has deprecated the release and tag versioning approach. + +When Apache APISIX is released, the Dashboard will be built directly based on a specified Git commit hash, and the artifacts will be embedded into Apache APISIX. + +### Legacy Apache APISIX Dashboard Review Comment: There's a typo in 'APSIX' on line 147. It should be 'APISIX' to match the correct product name. ########## docs/zh/latest/dashboard.md: ########## @@ -0,0 +1,157 @@ +--- +title: Apache APISIX Dashboard +--- + +<!-- +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +--> + +## 概述 + +[Apache APISIX Dashboard](https://github.com/apache/apisix-dashboard) 为用户提供了一个直观的 Web 界面来操作和管理 Apache APISIX。APISIX 内置了 Dashboard UI,默认启用,让用户可以通过图形界面轻松配置路由、插件、上游服务等。 + +## 配置 Dashboard + +### 启用或关闭 Dashboard + +Apache APISIX 默认启用内嵌 Dashboard。如需修改此设置,请编辑 `conf/config.yaml` 文件: + +```yaml title="./conf/config.yaml" +deployment: + admin: + # 启用内嵌 APISIX Dashboard + enable_admin_ui: true +``` + +**配置说明:** + +- `enable_admin_ui: true` - 启用内嵌 Dashboard(默认启用) +- `enable_admin_ui: false` - 关闭内嵌 Dashboard + +修改配置后,重启 Apache APISIX 生效。 + +### 限制 IP 访问 + +Apache APISIX 支持设置 Admin API 的 IP 访问白名单,防止 Apache APISIX 被非法访问和攻击。 + +```yaml title="./conf/config.yaml" +deployment: + admin: + # http://nginx.org/en/docs/http/ngx_http_access_module.html#allow + allow_admin: + - 127.0.0.0/24 +``` + +### Admin API Key + +Dashboard 通过 Admin API 与 Apache APISIX 交互,需要正确的 Admin API Key 进行身份验证。 + +#### 配置 + +在 `conf/config.yaml` 中配置 Admin API Key: + +```yaml title="./conf/config.yaml" +deployment: + admin: + admin_key: + - + name: admin + role: admin + # 使用简单的 Admin API Key 存在安全风险,部署到生产环境时请及时更新 + key: edd1c9f034335f136f87ad84b625c8f1 +``` + +也支持通过环境变量配置: + +```yaml title="./conf/config.yaml" +deployment: + admin: + admin_key: + - name: admin + # 从环境变量读取 + key: ${{ADMIN_KEY}} + role: admin +``` + +使用前需设置环境变量: + +```bash +export ADMIN_KEY=your-secure-api-key +``` + +修改配置后需重启 Apache APISIX 生效。 + +#### 在 Dashboard 中使用 + +访问 Dashboard,以 `http://127.0.0.1:9180/ui` 为例。 + +在未配置 Admin API Key 时,设置模态框将会弹出: + + + +如果不小心关闭了设置模态框,也可以点击导航栏右侧的按钮 <img src="../../assets/images/dashboard-settings-btn-icon.png" alt="Apache APISIX Dashboard - Settings btn icon" width="25px" /> 再次打开。 + + + +接下来,填入上一小节中配置的 Admin API Key,Dashboard 会自动发起请求。如配置错误,Dashboard 仍将在右上角显示 `failed to check token`: + + + +如配置正确,Dashboard 将不再显示 `failed to check token`。此时,点击 `X` 或空白处,关闭设置模态框,即可正常使用。 + + + +## FAQ + +### 为什么 Apache APISIX Dashboard 进行了重构? + +Apache APISIX Dashboard 经历了多个版本的演进: + +- **1.x 版本**:基于 Vue.js 的简单 Web UI,直接调用 Admin API +- **2.x 版本**:采用 React + Ant Design Pro 前端架构,引入了 Golang 后端和数据库存储 + +在 2.x 版本发展过程中,由于社区对功能的需求不断增加,项目逐渐变得复杂臃肿,同时与 APISIX 主版本的同步也面临挑战。 + +经过充分讨论,社区决定明确 Dashboard 的定位和功能边界,回归轻量化设计,确保与 APISIX 核心的紧密集成和版本同步。 + +未来 Apache APISIX Dashboard 将专注于: + +- **简化架构**:移除不必要的复杂组件,回归 Dashboard 的本质功能 +- **增强用户体验**:提供直观、高效的管理界面 +- **版本同步**:与 Apache APISIX 主版本保持同步发布 +- **生产就绪**:确保稳定性和可靠性,适合生产环境使用 + +更多规划信息请查看:[Dashboard 路线图](https://github.com/apache/apisix-dashboard/issues/2981) + +### 发布模式 + +项目不再独立发布,且已弃用 release 和 tag 的版本标记方式。 + +在 Apache APISIX 发布时,将直接基于指定的 Git commit hash 构建 Dashboard,并将产物嵌入到 Apache APISIX 中。 + +### 旧版本的 Apache APSIX Dashboard Review Comment: There's a typo in 'APSIX' on line 147. It should be 'APISIX' to match the correct product name. ```suggestion ### 旧版本的 Apache APISIX Dashboard ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org