通过Gitlab API从URL中的Token导入主题失败

大家好,

我正在尝试通过 API 从 GitLab(在 URL 中带有令牌)使用 discourse_api, '0.38' 上传远程主题。

这在 v2.9.0beta10 版本中是有效的,但似乎在 3.0.0 版本中失败了。

POST 请求在客户端返回此错误:

/opt/bundle/gems/discourse_api-0.38.0/lib/discourse_api/client.rb:158:in `handle_error': DiscourseApi::Error
        from /opt/bundle/gems/discourse_api-0.38.0/lib/discourse_api/client.rb:141:in `request'
        from /opt/bundle/gems/discourse_api-0.38.0/lib/discourse_api/client.rb:90:in `post'

我在目标开发 Discourse 实例的日志中看到这个:

Failed to process hijacked response correctly : FinalDestination::SSRFDetector::DisallowedIpError : FinalDestination: all resolved IPs were disallowed

请注意这些提交:SECURITY: Expand and improve SSRF Protections (#18815) · discourse/discourse@68b4fe4 · GitHub, FIX: Theme import error handling needs to happen inside the hijack bl… · discourse/discourse@1398bd5 · GitHub,
FIX: When following redirects before cloning, use the first git reque… · discourse/discourse@d9364a2 · GitHub

(这距离它起作用的 beta 版本并不远)

我是否需要进行其他配置才能允许此请求?

我看到这里有一个相关的主题,但它已关闭:

FYI,不知何故,这个问题在 3.1.0beta2 版本中似乎已得到解决 :+1:

1 个赞

此主题在最后回复后 3 天自动关闭。不再允许新回复。