• @guqing guqing commented on issue #6255 in halo-dev/halo

    这个是雷池获取上游的的设置,比如腾讯云eo默认就是Tencent-Client-IP在这个地方就要设置Tencent-Client-IP
    已在 #6363 中增加了对这两个请求头的支持,可以帮忙测试一下看你能否正确获取到真实 IP 吗

    0 0
  • @guqing guqing opened pull request #6363 in halo-dev/halo

    What type of PR is this?

    /kind improvement
    /area core
    /milestone 2.18.x

    What this PR does / why we need it:

    在 IpAddressUtils 中增加对 X-Forwarded-Proto 和 X-Forwarded-Host 请求头的支持

    Which issue(s) this PR fixes:

    Fixes #6255

    Does this PR introduce a user-facing change?

    None
    
    0 0
  • @guqing guqing created branch chore/6255 in guqing/halo

    guqing/halo

    ✍ 一款优秀的开源博客发布应用。

    0 0
  • @guqing guqing commented on issue #6255 in halo-dev/halo

    希望增加X-Forwarded-Proto和X-Forwarded-Host,通过雷池代理的网站是通过这俩请求头传递上游IP的

    Hi @52lemon6 , 看看能否通过配置的方式解决 https://waf-ce.chaitin.cn/docs/faq/other ,一般来说 X-Forwarded-For 和 X-Real-IP 才是最常用的

    0 0
  • @guqing guqing created a review on pull request #6334 in halo-dev/halo

    /lgtm

    0 0
  • @guqing guqing commented on issue #6359 in halo-dev/halo

    你可以写一个插件来做这件事,目前 Halo 没有计划添加这样的功能

    0 0
  • @guqing guqing pushed to feature/api-client in halo-sigs/halo-gradle-plugin

    Below is the list of commits:

    • feat: add tasks for OpenAPI docs and api-client code generation (a0cd1b0)
    0 0
  • @guqing guqing pushed to feature/api-client in halo-sigs/halo-gradle-plugin

    Below is the list of commits:

    • feat: add tasks for OpenAPI docs and api-client code generation (12952df)
    0 0
  • @guqing guqing opened pull request #16 in halo-sigs/halo-gradle-plugin

    What this PR does?

    实现了两个 tasks,用于为插件项目生成 OpenAPI docs 和 API Client

    • generateOpenApiDocs: 启动一个 Halo 作为 API Docs Server 并根据用户配置的 groupedApiMappings 来下载 Open API 的 json 文件到指定目录
    • generateApiClient 根据 groupedApiMappings 指定的文件名称和其他配置来生成 API Client 到前端模块的项目中

    使用方式:
    在 build.gradle 中配置

    haloPlugin {
        openApi {
            outputDir = file("$rootDir/api-docs/openapi/v3_0")
            groupedApiMappings = [
                    '/v3/api-docs/apis_aggregated.api_v1alpha1': 'aggregated.json'
            ]
            generator {
                // 默认配置可缺省
                outputDir = file("${projectDir}/console/src/api/generated")
                // 默认配置可缺省
                additionalProperties = [
                        useES6: true,
                        useSingleRequestParameter: true,
                        withSeparateModelsAndApi: true,
                        apiPackage: "api",
                        modelPackage: "models"
                ]
                // 默认配置可缺省
                typeMappings = [
                        set: "Array"
                ]
            }
        }
    }
    0 0
  • @guqing guqing pushed to feature/api-client in halo-sigs/halo-gradle-plugin

    Below is the list of commits:

    • feat: add tasks for OpenAPI docs and api-client code generation (637bcdd)
    0 0