#### What type of PR is this?
/kind bug
/area core
/milestone 2.19.0
#### What this PR does / why we need it:
After merging https://github.com/halo-dev/halo/pull/6512 and https://github.com/halo-dev/halo/pull/6511, unit tests fail due to the changes of <05b73ceeec>.
This PR fixes the problem by letting `run.halo.app.infra.exception.handlers.ProblemDetailErrorAttributes` extend `org.springframework.boot.web.reactive.error.DefaultErrorAttributes`.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### 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
增加通过链接转存第三方资源至附件库的接口
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.19.0
#### What this PR does / why we need it:
This PR refactors "Template Not Found Exception" into "NotFoundException" to prevent too many exception stacktraces in logs file.
#### Which issue(s) this PR fixes:
Fixes#6501
#### Special notes for your reviewer:
1. Activate default theme
2. Request <http://localhost:8090/categories>
3. See the result
#### Does this PR introduce a user-facing change?
```release-note
优化当主题模板找不到的异常提示
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.19.x
#### What this PR does / why we need it:
修复切换账号登录时设备信息更新不正确的问题
原因:
1. 使用 admin 账号登录,此时会记录 device_id 的 cookie
2. 退出登录,device_id 会保留在 cookie 中并随着新账号带到服务端
3. 服务端根据 device_id 查询当前设备是否有对应的记录,但是没有校验用户名是否与当前登陆的一致然后就去更新登录时间
4. 正确的处理是校验 device_id 是否有与之对应的记录并且用户名相同,如果不相同则认为是新设备重新生成 device_id
**how to test it?**
1. 先清理 cookie 然后使用一个账号登录
2. 退出登陆并切换新账号登录
3. 检查新登录的账号的设备信息是否正确
#### Does this PR introduce a user-facing change?
```release-note
修复切换账号登录时设备信息更新不正确的问题
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.19.x
#### What this PR does / why we need it:
修复文章的上一篇下一篇链接包含了隐藏分类下的文章
#### Does this PR introduce a user-facing change?
```release-note
修复文章的上一篇下一篇链接包含了隐藏分类下的文章
```
#### 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
修复有时无法给用户赋权限的问题
```
#### What type of PR is this?
/kind cleanup
/area core
/milestone 2.19.x
#### What this PR does / why we need it:
清理没有用到的索引
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.19.x
#### What this PR does / why we need it:
优化用户创建
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
This PR allows users to filter search result by types, owner names, category names and tag names.
#### Does this PR introduce a user-facing change?
```release-note
完善搜索引擎过滤功能
```
#### What type of PR is this?
/milestone 2.19.x
/area core
/kind cleanup
#### What this PR does / why we need it:
删除对文章错误的索引声明
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/area core
/milestone 2.18.x
#### What this PR does / why we need it:
新增文章摘要生成扩展点用于扩展自动生成摘要的方式
#### Does this PR introduce a user-facing change?
```release-note
新增文章摘要生成扩展点用于扩展自动生成摘要的方式
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.18.x
#### What this PR does / why we need it:
修复保存系统配置时出现的 NPE 问题
此问题由于 PR #6346 导致
#### Which issue(s) this PR fixes:
Fixes#6416
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind cleanup
/area core
/milestone 2.18.x
#### What this PR does / why we need it:
This PR refines debug logs of listing all extensions.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind cleanup
/area core
#### What this PR does / why we need it:
移除在 https://github.com/halo-dev/halo/pull/6403 中误推送的代码。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.18.x
#### What this PR does / why we need it:
插件启动时触发一次插件配置更新事件以便进行资源初始化操作
之前配置插件完后重启/升级插件无法监听到事件则不方便初始化资源需要通过再次监听插件启动事件来实现,现在改为插件启动时可以监听到
#### Does this PR introduce a user-facing change?
```release-note
插件启动时触发一次插件配置更新事件以便进行资源初始化操作
```
#### What type of PR is this?
/area ui
/kind improvement
/milestone 2.18.x
#### What this PR does / why we need it:
升级 tiptap 的相关依赖至 2.5.7。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.18.x
#### What this PR does / why we need it:
通过将 ExtensionGetter Bean 共享到给插件的 ApplicationContext,插件能够方便地使用该 Bean 来获取扩展。此更改确保插件具有可靠的扩展访问方式,从而促进系统内更好的模块化和可扩展性。
#### Which issue(s) this PR fixes:
Fixes#6357
#### Does this PR introduce a user-facing change?
```release-note
将 ExtensionGetter Bean 共享给插件使用,以便插件可以通过它来获取扩展
```
#### What type of PR is this?
/kind bug
/area core
/area plugin
/milestone 2.18.x
#### What this PR does / why we need it:
This PR checks if the plugin is already unloaded while getting dependents to fix the problem that plugins without jar file may not be deleted or not be enabled or disabled.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/6072
#### Special notes for your reviewer:
1. Try to move plugins folder to another folder
2. Restart Halo
3. Try to change state of plugins or delete plugins directly
4. See the result
#### Does this PR introduce a user-facing change?
```release-note
修复在没有插件文件的情况下可能无法删除插件的问题
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.18.x
#### What this PR does / why we need it:
This PR checks readable of theme resources while getting resources to prevent Halo from throwing FileNotFoundException.
#### Which issue(s) this PR fixes:
Fixes#6338
#### Special notes for your reviewer:
1. Try to request <https://www.halo.run/themes/fake-theme/assets/favicons/favicon-32x32.png>
2. See the result
#### Does this PR introduce a user-facing change?
```release-note
修复访问不存在的主题资源时出现服务器异常的问题
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.18.x
#### What this PR does / why we need it:
This PR prevent remember-me token from updating after auto login.
#### Which issue(s) this PR fixes:
Fixes#6290
#### Does this PR introduce a user-facing change?
```release-note
修复“保持登录”可能失效的问题
```
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
更新预设插件版本。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.18.x
#### What this PR does / why we need it:
This PR fixes the problem of not being able to rebuild search index due to null description and updateTimestamp.
#### Which issue(s) this PR fixes:
Fixes#6317
#### Does this PR introduce a user-facing change?
```release-note
修复无法正常刷新搜索引擎的问题
```
#### What type of PR is this?
/kind cleanup
/area core
/milestone 2.18.x
#### What this PR does / why we need it:
This PR simplifies RememberMeAuthenticationFilter by reusing AuthenticationWebFilter.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/kind api-change
/area core
/area plugin
#### What this PR does / why we need it:
This PR adds `BeforeSecurityWebFilter` and `AfterSecurityWebFilter` extension points. See https://github.com/halo-sigs/plugin-page-cache/issues/4#issuecomment-2216677891 for more.
Now, we can do something before and after authenticating.
#### Does this PR introduce a user-facing change?
```release-note
添加认证授权的前置和后置处理器扩展点
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.18.x
#### What this PR does / why we need it:
设备管理去除 IP 地址检查以避免频繁登录
#### Does this PR introduce a user-facing change?
```release-note
设备管理去除 IP 地址检查以避免频繁登录
```
#### What type of PR is this?
/kind improvement
/area core
/kind api-change
/milestone 2.18.x
#### What this PR does / why we need it:
This PR makes ConcurrencyFailureException respond http status code 409 instead of 500.
#### Which issue(s) this PR fixes:
Fixes#6254
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area core
/milestone 2.18.x
#### What this PR does / why we need it:
为了平滑升级先保留 PluginWrapper 的 Bean
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/kind api-change
/area core
/area plugin
#### What this PR does / why we need it:
This PR supports obtaining plugins root in plugins. Below is an example in plugin:
```java
@Component
class PluginsRootGetterDemo {
private final PluginsRootGetter pluginsRootGetter;
PluginsRootGetterDemo(PluginsRootGetter pluginsRootGetter) {
this.pluginsRootGetter = pluginsRootGetter;
}
}
```
Meanwhile, I remove the `PluginProperties#pluginsRoot` for a clear way to obtain plugins root.
#### Does this PR introduce a user-facing change?
```release-note
支持在插件中获取插件根目录
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.18.x
#### What this PR does / why we need it:
This PR treats `ui/build/dist` as resource dir for application module to adapt building and running using IntelliJ IDEA.
How to use?
1. Build ui project by executing command `./gradlew :ui:build -x :ui:check`.
1. Create a `Run/Debug Configuration` with arguments `--spring.profiles.active=dev --halo.console.proxy.enabled=false --halo.uc.proxy.enabled=false`.
1. Go to `Settings | Build, Execution, Deployment | Build Tools | Gradle` and select `IntelliJ IDEA` for `Build and run using:`
1. Run/Debug the configuration
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind cleanup
/area plugin
/milestone 2.17.x
#### What this PR does / why we need it:
移除 BasePlugin 中已经过时的构造方法
在 2.6.1 版本中将 `BasePlugin(PluginWrapper wrapper)` 标记为过时并使用 `BasePlugin(PluginContext pluginContext)` 代替,现在已经过了很多版本,是时候移除它了。
see also #4023
#### Does this PR introduce a user-facing change?
```release-note
开发者相关:移除 BasePlugin 中已经过时的构造方法
```
#### What type of PR is this?
/kind cleanup
/area core
/milestone 2.17.x
#### What this PR does / why we need it:
清理已经过时很久的 yaml extension 声明
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area plugin
/milestone 2.17.x
#### What this PR does / why we need it:
修复当插件入口文件的缓存目录被系统清理后会导致一直无法加载的问题
原问题复现步骤:
1. 登录后刷新页面,此时缓存目录被创建
2. 删除缓存目录后就会提示文件不存在然后导致插件入口文件一致无法加载直到重启 Halo
#### Which issue(s) this PR fixes:
Fixes#6226
#### Does this PR introduce a user-facing change?
```release-note
修复当插件入口文件的缓存目录被系统清理后会导致一直无法加载的问题
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.17.0
#### What this PR does / why we need it:
This PR provides a configuration property to control whether two-factor authentication is disabled. e.g.:
```yaml
halo:
security:
two-factor-auth:
disabled: true | false # Default is false.
```
#### Which issue(s) this PR fixes:
Fixes#5640
#### Special notes for your reviewer:
1. Enable 2FA and configure TOTP
2. Disable 2FA by configuring property above
3. Restart Halo and try to login
#### Does this PR introduce a user-facing change?
```release-note
支持通过配置的方式全局禁用二步验证
```
#### What type of PR is this?
/kind feature
/area core
/milestone 2.17.x
#### What this PR does / why we need it:
提供对模板中 halo footer 标签内容的扩展点以支持扩展页脚内容
#### Which issue(s) this PR fixes:
Fixes#6189
#### Does this PR introduce a user-facing change?
```release-note
提供对模板中 halo footer 标签内容的扩展点以支持扩展页脚内容
```
#### What type of PR is this?
/kind feature
/area core
/area theme
/milestone 2.17.x
#### What this PR does / why we need it:
支持在主题中检查已启动的插件是否符合指定的版本要求,以便可以在某些功能可以正常工作时才渲染
示例
```html
<p th:if="${pluginFinder.available('plugin-search-widget', '>=2.3.0')}>
<!-- do something -->
</p>
```
#### Does this PR introduce a user-facing change?
```release-note
支持在主题中检查已启动的插件是否符合指定的版本要求
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.17.0
#### What this PR does / why we need it:
This PR adds missed type to HaloDocument while converting.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/6235
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/kind api-change
/area core
/area plugin
/milestone 2.17.0
#### What this PR does / why we need it:
This PR creates a SearchService and makes it invokable for plugins.
#### Special notes for your reviewer:
1. Create a plugin
2. Publish all publication into Maven local repository by executing `./gradlew publishAllPublicationsToMavenLocalRepository`
3. Use `2.17.0-SNAPSHOT` as dependency version and refresh dependencies
4. Try to use the SearchService to search something.
#### Does this PR introduce a user-facing change?
```release-note
为插件提供全文搜索服务
```
#### What type of PR is this?
/kind feature
/area core
/milestone 2.17.x
#### What this PR does / why we need it:
This PR add support for allowing plugin to listen the event that the plugin has started. Below is an example of listening the event in plugin:
```java
@EventListener
void onPluginStartedEvent(PluginStartedEvent event) {
// do something.
}
```
See https://github.com/halo-dev/halo/issues/5339#issuecomment-2199220068 for more.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/5339#issuecomment-2199220068
#### Special notes for your reviewer:
1. Create a plugin, add the listener above and write some logs
2. Build and install the plugin
3. Start plugin and see the logs you wrote
#### Does this PR introduce a user-facing change?
```release-note
支持在插件中监听已启动事件
```
#### What type of PR is this?
/area core
/milestone 2.17.x
#### What this PR does / why we need it:
由于2.17.0 修改了 listAll 的实现导致出现了不兼容 Sort 参数为 null 的情况,考虑到给开发者适应的时间因此先兼容并给出警告日志
see also #6219
#### Which issue(s) this PR fixes:
Fixes#6219
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.17.x
#### What this PR does / why we need it:
新增 LoginHandlerEnhancer 用于 Halo 扩展登录成功或失败后的处理逻辑如 RememberMe 和设备管理等
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area core
/kind improvement
/milestone 2.17.x
#### What this PR does / why we need it:
更新预设插件的版本。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
/area plugin
/milestone 2.17.x
#### What this PR does / why we need it:
This PR makes sure the method `cache#put` is called before the event is published to avoid the event listener to fetch the old value from the cache.
The problem was introduced by <https://github.com/halo-dev/halo/pull/6141>.
#### Which issue(s) this PR fixes:
Fixes#6213
#### Does this PR introduce a user-facing change?
```release-note
修复在插件配置变更监听器中始终获取到旧数据的问题
```
#### What type of PR is this?
/kind improvement
/area core
/area plugin
#### What this PR does / why we need it:
修复当启动插件遇到 Error 级别的错误时会导致 API 被挂起无法终止的问题
```
- Throwable
- Error
- Exception
```
see #6192 for more details
#### Which issue(s) this PR fixes:
Fixes#6192
#### Does this PR introduce a user-facing change?
```release-note
修复当启动插件遇到 Error 级别的错误时会导致 API 被挂起无法终止的问题
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.17.x
#### What this PR does / why we need it:
修复文章关联或取消关联隐藏分类后显示不正确的问题
#### Which issue(s) this PR fixes:
Fixes#6194Fixes#6195
#### Does this PR introduce a user-facing change?
```release-note
修复文章关联或取消关联隐藏分类后显示不正确的问题
```
#### 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 插件提供。
```