交易按钮

该插件有点过时,今天才得到升级(必须得说,这得益于 @Arkshine :slight_smile: )。更新插件,我认为您必须重建应用程序(如果是生产环境)或重启应用程序。以下是 Discourse 团队的一些说明:Install plugins on a self-hosted site

5 个赞

谢谢更新。我确认一切正常。

5 个赞

大家好

有人能帮我解决这个问题吗?

桌面显示黑屏

Discourse - V3.1.3

Uncaught (in promise) Error: Could not find module discourse-i18n imported from discourse/plugins/discourse-topic-trade-buttons/discourse/connectors/topic-above-post-stream/trade-buttons

Uncaught (in promise) Error: Could not find module `discourse-i18n` imported from `discourse/plugins/discourse-topic-trade-buttons/discourse/connectors/topic-above-post-stream/trade-buttons`
    at loader.js:247:1
    at u (loader.js:258:1)
    at a.findDeps (loader.js:168:1)
    at u (loader.js:262:1)
    at requireModule (loader.js:24:1)
    at plugin-connectors.js:57:1
    at plugin-connectors.js:45:1
    at Array.forEach (<anonymous>)
    at b (plugin-connectors.js:40:1)
    at plugin-connectors.js:56:1
    at plugin-connectors.js:153:1
    at plugin-connectors.js:45:1
    at Array.forEach (<anonymous>)
    at b (plugin-connectors.js:40:1)
    at S (plugin-connectors.js:150:1)
    at j (plugin-connectors.js:159:1)
    at e.renderedConnectorsFor (plugin-connectors.js:164:1)
    at get connectors [as connectors] (plugin-outlet.js:126:1)
    at Ce (index.js:1251:1)
    at reference.js:175:1
    at reference.js:136:1
    at e.track (validator.js:668:1)
    at f (reference.js:135:1)
    at index.js:5588:1
    at reference.js:136:1
    at e.track (validator.js:668:1)
    at f (reference.js:135:1)
    at index.js:5588:1
    at reference.js:136:1
    at e.track (validator.js:668:1)
    at f (reference.js:135:1)
    at reference.js:312:1
    at reference.js:136:1
    at e.track (validator.js:668:1)
    at f (reference.js:135:1)
    at Object.evaluate (runtime.js:3440:1)
    at Object.evaluate (runtime.js:1052:1)
    at It.evaluateSyscall (runtime.js:4263:1)
    at It.evaluateInner (runtime.js:4234:1)
    at It.evaluateOuter (runtime.js:4227:1)
    at Wt.next (runtime.js:5058:1)
    at Wt._execute (runtime.js:5045:1)
    at Wt.execute (runtime.js:5038:1)
    at Qt.sync (runtime.js:5105:1)
    at wr.render (index.js:6749:1)
    at index.js:7013:1
    at Mt (runtime.js:4139:1)
    at Tr._renderRoots (index.js:6996:1)
    at Tr._renderRootsTransaction (index.js:7039:1)
    at Tr._renderRoot (index.js:6985:1)
    at Tr._appendDefinition (index.js:6911:1)
    at Tr.appendOutletView (index.js:6899:1)
    at p.invoke (queue.ts:203:14)
    at p.flush (queue.ts:98:13)
    at h.flush (deferred-action-queues.ts:75:19)
    at $._end (index.ts:616:32)
    at _boundAutorunEnd (index.ts:257:12)

你好,欢迎你 @viswanatha :slight_smile:

由于这似乎与 topic-trade-buttons 插件有关,我已经将你的帖子移至相关主题,以便让合适的人员看到它。 :+1:

@viswanatha 您添加此插件后是否重新构建了项目?

您好 @Janno_Liivak

我已重建我的项目,但仍遇到相同问题。

以下选项也丢失了。


启用主题交易按钮

image

类别设置


1 个赞

@Janno_Liivak 您可能需要 https://meta.discourse.org/t/pinning-plugin-and-theme-versions-for-older-discourse-installs-discourse-compatibility/272665,因为上一个 PR 引入了 discourse-i18n 导入,而它是在最近(我认为是 10 月 12 日)才添加到核心的。

据我所知,此更改发生在 3.2.0.beta2-dev(9 月 12 日)之后。

因此,我认为在 .discourse-compatibility 中添加一个条目是有意义的,说明版本低于 3.2.0-beta2-dev 的 Discourse 用户将被锁定在我 PR(即 2 月 22 日的那个)之前的最新提交。

< 3.2.0.beta2-dev 88db827dcecf5faf4e009e38422ede6847488535
4 个赞

:warning: 安全漏洞 :warning:

简而言之,安装此插件即使在禁用状态下,也会将所有存在的主题自定义字段泄露给任何可以访问该主题的用户,包括匿名用户。根据您安装的其他插件,主题自定义字段可能包含敏感数据。

~~我们在为客户审查此插件时发现了一些安全问题。我们已经在我们的分支(https://github.com/communiteq/discourse-topic-trade-buttons/tree/master)中修复了这些问题,并提交了一个拉取请求。但是,主题作者没有回复我们的拉取请求或私人消息,因此我们现在披露这些问题。~~

安全修复:信息泄露

所有自定义字段(包括来自其他插件的字段!)都会被序列化,包括对匿名用户。自定义字段可能包含敏感数据,不应如此序列化。

由于 sold_at 等值无论如何都是在服务器端设置的,并且按钮是在 topic.archived 上“计算”的,因此可以将自定义字段逻辑从前端面向用户的代码中移除,并且仅需要为管理员界面序列化自定义字段才能工作——因此序列化可以限制为管理员用户。我们怀疑这甚至不是必需的。

初始化修复

用于隔离序列化逻辑的 if SiteSetting.topic_trade_buttons_enabled 检查使得在启用或禁用插件后必须重新启动 Discourse。此检查是不必要的,因为 Discourse 已经处理了这个问题。
使用 respect_plugin_enabled: false 是不必要的,并且会加剧上述安全问题。

6 个赞

拉取请求已合并

3 个赞

我也是,无法设置

我在浏览器的开发者控制台中发现了一个弃用通知:

deprecation-identify-source.js:15 DEPRECATION:[PLUGIN discourse-topic-trade-buttons] 在 discourse/plugins/discourse-topic-trade-buttons/discourse/templates/connectors/topic-above-post-stream/trade-buttons.hbs 模板中使用了 model 属性路径,但未使用 this。此回退行为已被弃用,所有属性在使用时都必须在 this 上查找:{{this.model}} [deprecation id: ember-this-fallback.this-property-fallback] 这将在 ember-this-fallback n/a 中删除。有关更多详细信息,请参阅 Resolving the `this-property-fallback` deprecation

只是想提请注意——虽然我自己无法修复。:see_no_evil_monkey:

3 个赞

让我为您翻译成巴西葡萄牙语!我来自巴西。

2 个赞

@Anderson_Cardoso_Silva !你能提交一个包含翻译的拉取请求吗?

我修复了浏览器日志中看到的一些问题(包括 @Roi 提到的问题)以及一些奇怪的英文文本。在本地开发环境中测试了所有内容,但如果有人能在他们的 Discourse 上测试一下,我将不胜感激。

2 个赞

@Arkshine ,已将此行添加到 .discourse-compatibility 中。谢谢!

1 个赞

:warning: 安全漏洞 :warning:

@Janno_Liivak

感谢您提供的这个有用的插件!我发现了一些需要关注的关键安全漏洞:

问题

  1. 无授权检查 - 任何用户都可以将任何主题标记为已售/已购/已交换
  2. 缺少后端验证 - 控制器未验证:
    • 插件已启用 (topic_trade_buttons_enabled)
    • 分类按钮已启用 (enable_*_button)
    • 仅前端检查这些设置(不安全)
  3. 无输入验证 - topic_id 参数未经验证
  4. 未创建操作日志 - 操作未记录,没有执行操作者的记录

影响

  • 未经授权的主题操纵
  • 通过直接 API 调用绕过插件/分类设置
  • 没有执行交易操作者的审计跟踪
4 个赞

您好 @Janno_Liivak

“[已购买]”和“[已售出]”标签突然在我们网站上显示为简体中文。Discourse 3.6.0.beta2。除了更新之外,我们网站上没有进行任何更改。

您有什么办法能让这些标签与主题/网站的语言和字符集匹配吗?

另外,@lava 提到的那些安全漏洞问题是否得到了解决?

谢谢!
Gunnar

你好 @Gunnar!你的网站正在使用什么语言(和语言代码)?

那些安全问题还没有得到解决。我最近一直很忙,而且由于我不再自己使用 Discourse,只是简单地忘记了它们 :see_no_evil_monkey:

但我现在会给自己创建一个任务,并尽快找时间修复所有问题。如果有人能帮忙,我很乐意审查拉取请求。

2 个赞

英语(美国)。这是我们网站所有“语言”设置的屏幕截图: