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

支持在控制台查看版本等信息 #3055

Closed
wan92hen opened this issue Dec 27, 2022 · 14 comments · Fixed by #3182 or halo-dev/console#832
Closed

支持在控制台查看版本等信息 #3055

wan92hen opened this issue Dec 27, 2022 · 14 comments · Fixed by #3182 or halo-dev/console#832
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@wan92hen
Copy link
Collaborator

你当前使用的版本

2.1.0-rc.1

描述一下此特性

目前查看 Halo 版本需要在后台通过查看容器信息的方式获取。建议在控制台中增加关于页面,展示 Halo 版本、站点 URL 等相关信息。
具体展示的信息可以参考 WordPress 的站点健康页面。
image

附加信息

No response

@ruibaby
Copy link
Member

ruibaby commented Dec 27, 2022

/kind feature
/milestone 2.2.x

@f2c-ci-robot f2c-ci-robot bot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 27, 2022
@f2c-ci-robot f2c-ci-robot bot added this to the 2.2.x milestone Dec 27, 2022
@minliacom
Copy link
Contributor

通过插件的形式好还是核心系统里面包含的形式好些呢?

@ruibaby
Copy link
Member

ruibaby commented Dec 27, 2022

通过插件的形式好还是核心系统里面包含的形式好些呢?

个人认为这个应该添加到 Core。试想一下,如果我们要在 issue 中让使用者提供这些信息来做判断,还需要让他先安装一个插件吗?

@guqing
Copy link
Member

guqing commented Dec 27, 2022

core 本身也是需要包含版本信息的,否则插件/主题安装和升级将无法检查版本

@minliacom
Copy link
Contributor

嗯嗯 目前情况来看在这里添加一个关于菜单还比较合适

image

@JohnNiang
Copy link
Member

可以的。不过可以考虑自定义 actuator endpoint 来实现。

@minliacom
Copy link
Contributor

minliacom commented Dec 27, 2022

感觉有点不妥当,actuator接口一般都用来做内部系统间通讯了,有可能出现鉴权体系跟本系统管理后台不同的情况,比如当在kubernetes环境下拿来给 k8s 用了,这时候没有鉴权,如果管理后台也用了这个 actuator 接口,那就成了一个开放接口,暴露系统信息在安全层面不太妥当。有没有更好的方案可以搞定?可否考虑新开一个系统管理员级别的接口出来如 /api/system/probe 这种呢?

@JohnNiang
Copy link
Member

感觉有点不妥当,actuator接口一般都用来做内部系统间通讯了,有可能出现鉴权体系跟本系统管理后台不同的情况,比如当在kubernetes环境下拿来给 k8s 用了,这时候没有鉴权,如果管理后台也用了这个 actuator 接口,那就成了一个开放接口,暴露系统信息在安全层面不太妥当。有没有更好的方案可以搞定?可否考虑新开一个系统管理员级别的接口出来如 /api/system/probe 这种呢?

我们可以试着扩展 actuator endpoint 来实现获取系统信息的逻辑。该接口期望匿名用户也能够访问到。

@wan92hen
Copy link
Collaborator Author

我们可以试着扩展 actuator endpoint 来实现获取系统信息的逻辑。该接口期望匿名用户也能够访问到。

匿名用户还是要限制部分信息的,不能将所有系统信息全部匿名暴露出去

@JohnNiang
Copy link
Member

目前开发环境已经暴露 info 端口,请看下面的结果:

curl -s http://172.19.144.1:8090/actuator/info | jq .
{
  "build": {
    "artifact": "halo",
    "name": "halo",
    "time": "2023-01-16T03:48:34.919Z",
    "version": "2.2.0-SNAPSHOT",
    "group": "run.halo.app"
  }
}

以上信息需要允许匿名用户查看么?

@JohnNiang
Copy link
Member

感觉有点不妥当,actuator接口一般都用来做内部系统间通讯了,有可能出现鉴权体系跟本系统管理后台不同的情况,比如当在kubernetes环境下拿来给 k8s 用了,这时候没有鉴权,如果管理后台也用了这个 actuator 接口,那就成了一个开放接口,暴露系统信息在安全层面不太妥当。有没有更好的方案可以搞定?可否考虑新开一个系统管理员级别的接口出来如 /api/system/probe 这种呢?

@minliacom 直接暴露 /actuator/info 确实存在安全性问题。我计划的实现方案如下:

  • 扩展 Actuator Endpoint:/actuator/globalconfig,返回结果仅包含一些关于 Halo 的系统级别配置,例如是否允许注册,是否允许评论。
  • 允许 /actuator/health 匿名访问。主要是为了方便 Kubernetes Probe 配置。
  • 其他 Actuator Endpoints 仅允许管理员访问。

@JohnNiang
Copy link
Member

/assign

f2c-ci-robot bot pushed a commit that referenced this issue Jan 30, 2023
#### What type of PR is this?

/kind feature
/area core
/milestone 2.2.x

#### What this PR does / why we need it:

Provide `globalconfig` actuator endpoint to let console and theme know how to do according various system configuration. The endpoint allows anonymous users to access, but other actuator endpoints can be accessed by admin users.

#### Which issue(s) this PR fixes:

Fixes #3055

#### Special notes for your reviewer:

Try to request <http://localhost:8090/actuator/globalinfo> and see the result.

```json
{
   "externalUrl":"http://localhost:8090",
   "timeZone":"Asia/Shanghai",
   "locale":"en_US",
   "allowComments":true,
   "allowRegistration":false
}
```

You can request <http://localhost:8090/actuator/info> to see more detail as well.

```json
{
  "git": {
    "branch": "feat/system-info",
    "commit": {
      "id": "ca4e93d",
      "time": "2023-01-19T08:56:15Z"
    }
  },
  "build": {
    "artifact": "halo",
    "name": "halo",
    "time": "2023-01-29T15:04:42.151Z",
    "version": "2.2.0-SNAPSHOT",
    "group": "run.halo.app"
  },
  "java": {
    "version": "17.0.6",
    "vendor": {
      "name": "Amazon.com Inc.",
      "version": "Corretto-17.0.6.10.1"
    },
    "runtime": {
      "name": "OpenJDK Runtime Environment",
      "version": "17.0.6+10-LTS"
    },
    "jvm": {
      "name": "OpenJDK 64-Bit Server VM",
      "vendor": "Amazon.com Inc.",
      "version": "17.0.6+10-LTS"
    }
  },
  "os": {
    "name": "Windows 11",
    "version": "10.0",
    "arch": "amd64"
  }
}
```

#### Does this PR introduce a user-facing change?

```release-note
提供系统配置详情端口
```
@ruibaby
Copy link
Member

ruibaby commented Jan 30, 2023

/reopen

等待 halo-dev/console#832 完成。

@f2c-ci-robot f2c-ci-robot bot reopened this Jan 30, 2023
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Jan 30, 2023

@ruibaby: Reopened this issue.

In response to this:

/reopen

等待 halo-dev/console#832 完成。

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

f2c-ci-robot bot pushed a commit to halo-dev/console that referenced this issue Jan 31, 2023
#### What type of PR is this?

/kind feature

#### What this PR does / why we need it:

添加 Actuator 信息查看页面。适配 halo-dev/halo#3182

todo:

- [x] 页面入口

#### Which issue(s) this PR fixes:

Fixes halo-dev/halo#3055

#### Screenshots:

![image](https://user-images.githubusercontent.com/21301288/215386617-e3aafc6d-777d-49e8-93c9-b9432623e98e.png)


#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 halo-dev/halo#3182 分支。
2. Console 需要 `pnpm build:packages`
3. 访问 http://localhost:8090/console#/actuator

#### Does this PR introduce a user-facing change?

```release-note
Console 端添加系统信息查看页面
```
@ruibaby ruibaby modified the milestones: 2.2.x, 2.2.0 Jan 31, 2023
JohnNiang pushed a commit to JohnNiang/halo that referenced this issue Mar 2, 2023
#### What type of PR is this?

/kind feature

#### What this PR does / why we need it:

添加 Actuator 信息查看页面。适配 halo-dev#3182

todo:

- [x] 页面入口

#### Which issue(s) this PR fixes:

Fixes halo-dev#3055

#### Screenshots:

![image](https://user-images.githubusercontent.com/21301288/215386617-e3aafc6d-777d-49e8-93c9-b9432623e98e.png)


#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 halo-dev#3182 分支。
2. Console 需要 `pnpm build:packages`
3. 访问 http://localhost:8090/console#/actuator

#### Does this PR introduce a user-facing change?

```release-note
Console 端添加系统信息查看页面
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants