Commit Graph

17 Commits (b761fe2b7933281ec86c5ba2cbe4d2c0fee4c644)

Author SHA1 Message Date
guqing fbe40c28fc
chore: restrict username and password length during user registration (#6808)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.20.x

#### What this PR does / why we need it:
为注册用户增加用户名和密码长度校验

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-10-10 07:57:00 +00:00
Ryan Wang 5df755d4a8 Refine setup page 2024-10-09 12:20:54 +08:00
Ryan Wang 2c849d8361
chore: regenerate api client for login-related (#6728)
#### What type of PR is this?

/area core
/kind cleanup
/milestone 2.20.x

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

重新生成 OpenAPI 定义和 API Client,在 https://github.com/halo-dev/halo/pull/6488 中忘了重新生成。

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

```release-note
None
```
2024-09-29 07:47:46 +00:00
John Niang 9305fd51d8
Merge pull request #6688 from guqing/refactor/6468
fix: resolve 403 error on menu page when system config access is missing
2024-09-28 18:30:50 +08:00
Ryan Wang c945a9443c Refine UI 2024-09-24 12:50:25 +08:00
guqing a634065d48 feat: support JSON-based retrieval and update for theme and plugin configs 2024-09-14 16:10:31 +08:00
John Niang 7281a48325
Prepare for developing 2.20.0 (#6575)
#### What type of PR is this?

/kind cleanup
/area core

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

This PR bumps all version to 2.20.0 to prepare for next development.

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

```release-note
None
```
2024-09-02 09:41:37 +00:00
guqing ef37aa794b
feat: implement new mechanisms for generating and managing attachment thumbnails (#6454)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.19.x

#### What this PR does / why we need it:
实现了图片类型的附件缩略图生成和管理的新机制

实现依据 RFC:https://github.com/halo-dev/rfcs/pull/24

使用缩略图前需要配置 externalUrl 才能生成

**How to test it?**
1. 测试本地缩略图的文件是否正确,每个图片对应到相应 size 的目录如 thumbnails/w400 应该是一对一
2. 每个图片生成缩略图的只会在 `http://localhost:8090/apis/storage.halo.run/v1alpha1/thumbnails` 中存在一份记录
3. 测试删除附件会删除对应的缩略图文件和 [thumbnails](http://localhost:8090/apis/storage.halo.run/v1alpha1/thumbnails) 
记录
4. 修改 externalUrl 以上功能均不会受到影响

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

#### Does this PR introduce a user-facing change?
```release-note
附件图片支持生成多尺寸图片,文章支持响应式图片。
```
2024-08-26 10:27:14 +00:00
Takagi e5bbbb3b7b
feat: API to save external links as attachments (#6364)
#### What type of PR is this?

/kind api-change
/kind feature
/area core

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

see #2335 

增加将第三方资源转存为附件资源的接口。

`/apis/api.console.halo.run/v1alpha1/attachments/-/upload-from-url`

UC:

`/apis/uc.api.content.halo.run/v1alpha1/attachments/-/upload-from-url`

其中参数为

```json
{
  "url": "string",
  "filename": "string",
  "groupName": "string",
  "policyName": "string"
}
```

#### How to test it?

测试能否将第三方接口的资源保存至附件中。
测试各类附件,例如图片、视频、文本等。

#### Does this PR introduce a user-facing change?
```release-note
增加通过链接转存第三方资源至附件库的接口
```
2024-08-26 06:31:14 +00:00
JohnNiang 3460d4c94b Add support for restoring from backup root
Signed-off-by: JohnNiang <johnniang@foxmail.com>
2024-08-21 11:45:49 +08:00
John Niang 3a782be607
Fix the problem that roles could not be granted sometimes (#6471)
#### What type of PR is this?

/kind improvement
/area core

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

This PR refactors searching roles by using index mechanism to speed up every request and fix the problem of not being able to grant roles to users sometimes.

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

Fixes #5807 
Fixes https://github.com/halo-dev/halo/issues/4954
Fixes https://github.com/halo-dev/halo/issues/5057

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

```release-note
修复有时无法给用户赋权限的问题
```
2024-08-21 03:22:50 +00:00
John Niang 5147d3efff
Prepare for developing 2.19.0 (#6429)
#### What type of PR is this?

/kind cleanup
/area core

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

This is a regular updates after a new release.

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

```release-note
None
```
2024-08-02 04:56:14 +00:00
John Niang 69d0586c2b
Regenerate OpenAPI docs and api client (#6378)
#### What type of PR is this?

/kind cleanup
/area core

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

Regenerate API docs and client to prevent unrelated changes from other PRs.

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

```release-note
None
```
2024-07-25 07:07:37 +00:00
Ryan Wang f0445f4e51
refactor: remove page cache feature (#6108)
#### What type of PR is this?

/area core
/kind api-change
/milestone 2.17.x

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

移除内置的页面静态缓存功能,后续将由 https://github.com/halo-sigs/plugin-page-cache 插件提供。

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

Fixes #5639 

#### Special notes for your reviewer:

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

```release-note
移除内置的页面静态缓存功能,后续由 https://github.com/halo-sigs/plugin-page-cache 插件提供。
```
2024-06-28 10:08:59 +00:00
John Niang 632bb69dfe
Refactor search engine and improve document extensibility (#6082)
#### What type of PR is this?

/kind improvement
/kind api-change
/area core

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

See https://github.com/JohnNiang/halo/blob/refactor/search/docs/extension-points/search-engine.md for more

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

Fixes https://github.com/halo-dev/halo/issues/5202
Fixes https://github.com/halo-dev/halo/issues/5339
Fixes https://github.com/halo-dev/halo/issues/5613
Fixes https://github.com/halo-dev/halo/issues/5172
Fixes https://github.com/halo-dev/halo/issues/4796
Fixes https://github.com/halo-dev/halo/issues/5625
Fixes https://github.com/halo-dev/halo/issues/5805

#### Special notes for your reviewer:

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

```release-note
重构搜索引擎并提高可扩展性。
```
2024-06-26 15:22:51 +00:00
guqing ae6724a2b6
feat: implement persistent token based remember me mechanism (#6131)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.17.x

#### What this PR does / why we need it:
新增基于持久化 Token 的 RememberMe 机制

本次更新引入了一种新的 RememberMe 机制,该机制基于持久化 Token,以增强安全性和管理灵活性。在此之前,RememberMe 功能通过以下方式生成 Token,并将其作为 cookie 发送回客户端:
```
 username + ":" + expiryTime + ":" + algorithmName + ":"
   + algorithmHex(username + ":" + expiryTime + ":" + password + ":" + key)
```
此方法的优点在于无需存储 Token 就可以进行验证,并且用户密码的更改会自动使 Token 失效。然而,它的主要缺点是缺乏管理能力,例如无法手动撤销 Token。

鉴于最新的设备管理需求(见 PR #6100),我们需要一种支持设备撤销(revoke)的机制。因此,我们采用了持久化 Token 的方式,并通过随机生成的方法来提高安全性,而不将用户名和密码直接签名在 Token 中。新的 Token 格式如下:
```
base64(tokenValue:series)
```
此更改将为系统带来更高的安全保障和更灵活的管理选项,特别是在需要高度控制和监管设备访问时。

#### Does this PR introduce a user-facing change?
```release-note
引入基于持久化 Token 的新 RememberMe 机制以增强安全性和管理灵活性,升级后需要重新登录
```
2024-06-26 08:40:49 +00:00
JohnNiang ecc0a70249 Refactor api client using separated OpenAPI groups 2024-06-25 12:31:25 +08:00