Skip to content

v1.0.3 新增功能和修复问题#16

Closed
carolcoral wants to merge 23 commits intohalo-dev:mainfrom
carolcoral:main
Closed

v1.0.3 新增功能和修复问题#16
carolcoral wants to merge 23 commits intohalo-dev:mainfrom
carolcoral:main

Conversation

@carolcoral
Copy link

Change

为了解决了站点在使用反向代理、NG代理、CDN回源等情况下,domain://sitemap.xml 中的站点地址与实际期望的访问地址不一致问题

  • 新增自定义站点地址功能(手动可控)
  • 调整地址权重为 1.0

FIX

  • 修复站点xml中时间为文章的最后更新时间(非刷新时间,tags等依然保留刷新时间机制)

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Sep 1, 2023

@carolcoral: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

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 f2c-ci-robot bot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Sep 1, 2023
@JohnNiang
Copy link
Member

关于 Site URL 的配置问题,我有一个建议:

Halo 目前在 HaloProperties 中提供了 externalUrl 的配置,主要是为了避免用户在各个插件都手动配置它。这里建议直接调用 ExternalURLSupplier#getURL(HttpRequest)方法获取 Site URL。这里将优先返回用户配置的 halo.externalUrl,其次才会解析当前用户所请求的域名。

如果无法正常获取当前用户所请求的域名,大概率是因为反向代理工具(如 Nginx)没有正确代理 X-Forward-For 头。

@JohnNiang
Copy link
Member

JohnNiang commented Sep 5, 2023

Hi @carolcoral ,我发现在当前版本中无法正常调用 ExternalUrlSupplier#getURL(HttpRequest) 方法,我将尝试升级一下 Halo 的依赖来支持。


已升级。

AirboZH and others added 3 commits September 18, 2023 12:15
fix: Modify default rules

chore: set default rule

当自定义规则开关关闭时,默认disallow /console
修改了代码样式细节

fix: 修复缓存导致调整robots_txt_enable失效的问题

chore: 修改缓存控制代码

docs: 修改label名

Co-authored-by: Ryan Wang <[email protected]>

chore: 格式化代码

chore: 设置项改名
feat: support robots.txt router
@f2c-ci-robot f2c-ci-robot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 18, 2023
@f2c-ci-robot f2c-ci-robot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 20, 2023
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Sep 20, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign guqing after the PR has been reviewed.
You can assign the PR to them by writing /assign @guqing in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

change: 变更自定义站点参数为动态获取(不再需要重启插件)
@carolcoral
Copy link
Author

change

  1. 删除无效类
  2. 变更自定义站点参数为动态获取(不再需要重启插件)
  3. 解决代码冲突合并robots.txt 功能

@carolcoral
Copy link
Author

关于 Site URL 的配置问题,我有一个建议:

Halo 目前在 HaloProperties 中提供了 externalUrl 的配置,主要是为了避免用户在各个插件都手动配置它。这里建议直接调用 ExternalURLSupplier#getURL(HttpRequest)方法获取 Site URL。这里将优先返回用户配置的 halo.externalUrl,其次才会解析当前用户所请求的域名。

如果无法正常获取当前用户所请求的域名,大概率是因为反向代理工具(如 Nginx)没有正确代理 X-Forward-For 头。

不仅仅是存在NG代理设置问题导致的获取站点地图和期望地址不一致问题。同时存在多重穿透和CDN源站方式导致的获取到的站点地址加上了源站地址的端口(实际上访问地址是没有端口的,仅源站存在端口)

@guqing
Copy link
Member

guqing commented Sep 20, 2023

希望一个 PR 只单纯的解决一个问题,不要在一个 PR 中做多件事,并且希望先提一个 issue 来与之关联让我们知道到底发生了什么事,不然会给 reviewer 带来困扰。

目前你的 PR 包含了之前已经合并的改动,很难 review,建议:

# https or ssh
git remote add upstream https://github.com/halo-dev/plugin-sitemap.git
git fetch upstream/main
git merge upstream/main
git reset --soft upstream/main
git add .
git commit -m '这里改为你的提交信息'
git push origin HEAD -f

参考 https://git-scm.com/docs/git-reset

@carolcoral
Copy link
Author

希望一个 PR 只单纯的解决一个问题,不要在一个 PR 中做多件事,并且希望先提一个 issue 来与之关联让我们知道到底发生了什么事,不然会给 reviewer 带来困扰。

目前你的 PR 包含了之前已经合并的改动,很难 review,建议:

# https or ssh
git remote add upstream https://github.com/halo-dev/plugin-sitemap.git
git fetch upstream/main
git merge upstream/main
git reset --soft upstream/main
git add .
git commit -m '这里改为你的提交信息'
git push origin HEAD -f

参考 https://git-scm.com/docs/git-reset

解决ISSUE:

  1. sitemap 中地址都是 http #13
  2. 插件生成site.xml内的域名后面带数字 #11
  3. sitemap权重和时间错误 #10

因为PR最开始仅仅解决 #11 但未被接受PR。因此后续的commit被依次提交了。

@carolcoral
Copy link
Author

carolcoral commented Sep 22, 2023

目前来看:

  1. 支持自定义站点地址
  2. 支持自定义权重(针对全局权重一致无法对文章类权重进行变更的需求) sitemap权重和时间错误 #10
  3. 支持站点地址中文章类型地址使用最后更新时间 sitemap权重和时间错误 #10
  4. 支持自定义设置动态修改加载

如果依然不符合您的要求,请直接关闭当前PR吧,不想折腾了

@ruibaby
Copy link
Member

ruibaby commented Sep 25, 2023

如果依然不符合您的要求,请直接关闭当前PR吧,不想折腾了

实际上 reset 之后重新 commit 并强制推送即可,不过依旧感谢你参与贡献。

针对这个问题已经有了一个新的 PR:#25,欢迎 Review 和测试。

/close

@f2c-ci-robot f2c-ci-robot bot closed this Sep 25, 2023
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Sep 25, 2023

@ruibaby: Closed this PR.

Details

In response to this:

如果依然不符合您的要求,请直接关闭当前PR吧,不想折腾了

实际上 reset 之后重新 commit 并强制推送即可,不过依旧感谢你参与贡献。

针对这个问题已经有了一个新的 PR:#25,欢迎 Review 和测试。

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants