这正是我们需要被引导到这个话题的原因。 原始帖子 包含一个似乎经常更新的列表。如果你查看编辑历史,你可以知道哪些插件被添加了以及何时添加的。
我们暂时完成了!最后一个是生日,将在几个月后完成。
我刚才绊了一下。我开始尝试进行一些 Discourse 开发,所以我想练习一下我的更新工作流程:
# git pull
# bundle install
# pnpm install
# ./bin/rails db:migrate
但我的猜测是,Discourse AI 插件需要 PostgreSQL 的 Pgvector 插件(我以前不知道它的存在):
== 20230710171141 EnablePgVectorExtension: migrating ==========================
-- enable_extension(:vector)
bin/rails aborted!
StandardError: An error has occurred, this and all later migrations canceled: (StandardError)
ERROR: current transaction is aborted, commands ignored until end of transaction block
/home/john/development/discourse/lib/mini_sql_multisite_connection.rb:109:in 'MiniSqlMultisiteConnection#run'
/home/john/development/discourse/plugins/discourse-ai/db/migrate/20230710171141_enable_pg_vector_extension.rb:8:in 'EnablePgVectorExtension#change'
/home/john/development/discourse/lib/freedom_patches/schema_migration_details.rb:8:in 'block in FreedomPatches::SchemaMigrationDetails#exec_migration'
/home/john/development/discourse/lib/freedom_patches/schema_migration_details.rb:8:in 'FreedomPatches::SchemaMigrationDetails#exec_migration'
/home/john/development/discourse/lib/migration/safe_migrate.rb:28:in 'Migration::SafeMigrate::SafeMigration#migrate'
/home/john/development/discourse/lib/migration/safe_migrate.rb:53:in 'Migration::SafeMigrate::NiceErrors#migrate'
/home/john/development/discourse/lib/tasks/db.rake:267:in 'block (2 levels) in <main>'
/home/john/development/discourse/lib/distributed_mutex.rb:53:in 'block in DistributedMutex#synchronize'
/home/john/development/discourse/lib/distributed_mutex.rb:49:in 'Thread::Mutex#synchronize'
/home/john/development/discourse/lib/distributed_mutex.rb:49:in 'DistributedMutex#synchronize'
/home/john/development/discourse/lib/distributed_mutex.rb:34:in 'DistributedMutex.synchronize'
/home/john/development/discourse/lib/tasks/db.rake:242:in 'block in <main>'
Caused by:
PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block (PG::InFailedSqlTransaction)
/home/john/development/discourse/lib/mini_sql_multisite_connection.rb:109:in 'MiniSqlMultisiteConnection#run'
/home/john/development/discourse/plugins/discourse-ai/db/migrate/20230710171141_enable_pg_vector_extension.rb:8:in 'EnablePgVectorExtension#change'
/home/john/development/discourse/lib/freedom_patches/schema_migration_details.rb:8:in 'block in FreedomPatches::SchemaMigrationDetails#exec_migration'
/home/john/development/discourse/lib/freedom_patches/schema_migration_details.rb:8:in 'FreedomPatches::SchemaMigrationDetails#exec_migration'
/home/john/development/discourse/lib/migration/safe_migrate.rb:28:in 'Migration::SafeMigrate::SafeMigration#migrate'
/home/john/development/discourse/lib/migration/safe_migrate.rb:53:in 'Migration::SafeMigrate::NiceErrors#migrate'
/home/john/development/discourse/lib/tasks/db.rake:267:in 'block (2 levels) in <main>'
/home/john/development/discourse/lib/distributed_mutex.rb:53:in 'block in DistributedMutex#synchronize'
/home/john/development/discourse/lib/distributed_mutex.rb:49:in 'Thread::Mutex#synchronize'
/home/john/development/discourse/lib/distributed_mutex.rb:49:in 'DistributedMutex#synchronize'
/home/john/development/discourse/lib/distributed_mutex.rb:34:in 'DistributedMutex.synchronize'
/home/john/development/discourse/lib/tasks/db.rake:242:in 'block in <main>'
Caused by:
ActiveRecord::StatementInvalid: PG::FeatureNotSupported: ERROR: extension "vector" is not available (ActiveRecord::StatementInvalid)
DETAIL: Could not open extension control file "/usr/share/postgresql/extension/vector.control": No such file or directory.
HINT: The extension must first be installed on the system where PostgreSQL is running.
/home/john/development/discourse/plugins/discourse-ai/db/migrate/20230710171141_enable_pg_vector_extension.rb:6:in 'EnablePgVectorExtension#change'
/home/john/development/discourse/lib/freedom_patches/schema_migration_details.rb:8:in 'block in FreedomPatches::SchemaMigrationDetails#exec_migration'
/home/john/development/discourse/lib/freedom_patches/schema_migration_details.rb:8:in 'FreedomPatches::SchemaMigrationDetails#exec_migration'
/home/john/development/discourse/lib/migration/safe_migrate.rb:28:in 'Migration::SafeMigrate::SafeMigration#migrate'
/home/john/development/discourse/lib/migration/safe_migrate.rb:53:in 'Migration::SafeMigrate::NiceErrors#migrate'
/home/john/development/discourse/lib/tasks/db.rake:267:in 'block (2 levels) in <main>'
/home/john/development/discourse/lib/distributed_mutex.rb:53:in 'block in DistributedMutex#synchronize'
/home/john/development/discourse/lib/distributed_mutex.rb:49:in 'Thread::Mutex#synchronize'
/home/john/development/discourse/lib/distributed_mutex.rb:49:in 'DistributedMutex#synchronize'
/home/john/development/discourse/lib/distributed_mutex.rb:34:in 'DistributedMutex.synchronize'
/home/john/development/discourse/lib/tasks/db.rake:242:in 'block in <main>'
Caused by:
PG::FeatureNotSupported: ERROR: extension "vector" is not available (PG::FeatureNotSupported)
DETAIL: Could not open extension control file "/usr/share/postgresql/extension/vector.control": No such file or directory.
HINT: The extension must first be installed on the system where PostgreSQL is running.
/home/john/development/discourse/plugins/discourse-ai/db/migrate/20230710171141_enable_pg_vector_extension.rb:6:in 'EnablePgVectorExtension#change'
/home/john/development/discourse/lib/freedom_patches/schema_migration_details.rb:8:in 'block in FreedomPatches::SchemaMigrationDetails#exec_migration'
/home/john/development/discourse/lib/freedom_patches/schema_migration_details.rb:8:in 'FreedomPatches::SchemaMigrationDetails#exec_migration'
/home/john/development/discourse/lib/migration/safe_migrate.rb:28:in 'Migration::SafeMigrate::SafeMigration#migrate'
/home/john/development/discourse/lib/migration/safe_migrate.rb:53:in 'Migration::SafeMigrate::NiceErrors#migrate'
/home/john/development/discourse/lib/tasks/db.rake:267:in 'block (2 levels) in <main>'
/home/john/development/discourse/lib/distributed_mutex.rb:53:in 'block in DistributedMutex#synchronize'
/home/john/development/discourse/lib/distributed_mutex.rb:49:in 'Thread::Mutex#synchronize'
/home/john/development/discourse/lib/distributed_mutex.rb:49:in 'DistributedMutex#synchronize'
/home/john/development/discourse/lib/distributed_mutex.rb:34:in 'DistributedMutex.synchronize'
/home/john/development/discourse/lib/tasks/db.rake:242:in 'block in <main>'
Tasks: TOP => db:migrate
我可以去安装它,但我想知道是否有什么方法可以在这个级别禁用插件,以便跳过它们的迁移。(我宁愿不安装额外的软件,特别是对于我不想在开发中探索的“插件”。)
我今天早些时候也遇到了这个问题。在 ChatGPT 的一些帮助下,我通过 sudo 安装了该软件包。我也在想这个问题;我想——也许删除 /plugins 目录下的插件文件夹会有帮助
… 但稍后 git pull 可能会重新安装它。
我反对这项更改。通常在软件开发中,拥有一个精简的核心意味着主发行版可以更小、更快,并减少攻击的表面积。我上次涉足插件时发现,即使插件代码处于“禁用”状态,它实际上也可以运行,因为这似乎取决于插件作者来检查,所以这似乎确实会显著增加风险和臃肿。
最直接的问题是,安装指南(https://meta.discourse.org/t/install-discourse-on-ubuntu-or-debian-for-development/14727)似乎没有更新任何说明(也许我只是错过了?)。目前还不清楚我们需要安装什么才能使一切正常工作。我通过安装 Ubuntu 包 postgresql-16-pgvector 解决了一些错误,但在运行 db:migrate 时仍然遇到了一些向量错误。我通过在本地删除 ai 插件来规避了它们。
总之,这是大量的额外代码,其中许多插件与大多数 Discourse 社区的用例完全无关。(这并不是说这些是坏插件!我相信它们对需要它们的社区非常有用。只是我很难认为每个社区论坛都需要附带 Zendesk 集成等功能)。特别是 AI 插件,鉴于其额外的要求正在破坏事物,我认为它绝对应该被淘汰。
就个人而言,当我登录到我的管理面板并突然看到一堆广告插件时,即使代码应该是惰性的,这也会让我非常担忧。我以最强烈的措辞表示,我绝对不希望在我的安装中默认包含任何大型科技公司的广告插件,即使是禁用的。 这是一个在历史上对用户隐私极其滥用的行业,Discourse 默认附带此类集成无助于自身。想要广告的人会毫不费力地找到所需的插件,没有必要将其包含在所有安装中。
TLDR:请重新考虑这项更改。 ![]()
Discourse正在将插件集成到核心中,这些插件在其官方托管中始终可用。
我同意这会在管理界面中增加额外的臃肿,有很多品牌名称在我脑海中构成“广告”。这不好。作为一个努力避免大品牌的自由软件倡导者,我认为这采取了 Ubuntu 几年前在完全被 Armazon、Gaggle 等公司殖民之前的步骤。如果你让它们进入你的视野,它们最终会吞噬它们。
将插件捆绑到核心中也为开发人员提供了一个机会,让他们随着时间的推移错误地将插件功能变成必需品,而将它们保留为插件可以确保不会犯这种错误。
@team 能否澄清这一变更背后的理由?
如果这是为了加快 Discourse 基础设施上的安装速度,也许在 CI 上自动创建一个 discourse-hosting-bundle 包可以达到相同的效果?
@david,请保持“受影响的插件”列表按字母顺序排列好吗?
这里的动机是为 Discourse 的首次用户提供更流畅的体验,让他们开箱即用就能获得更“功能齐全”的 Discourse 体验。
另一个动机是为我们的团队和社区贡献者提供开发者体验。通过将所有这些插件与核心捆绑在一起,就不再需要考虑与不同核心版本的兼容性。这对于像 discourse-ai 这样目前正在大量开发中的插件尤其有用,因为它与相关的核心更改同步进行。
品牌认证插件是最有可能被吸收到核心的插件,就像我们现有的核心认证方法(如 Google/Facebook/等)一样。因此,在不久的将来,它们很有可能从列表中删除。
此更改与我们在托管上的性能无关。我们已经有一个预先构建的发行版,其中包含您所描述的所有插件以及更多插件。![]()
我已经修复了排序 ![]()
这已经在主帖中回答过了:
这方面的几个例子:
- 如果我们在核心中为插件添加一些东西,我们就无需担心版本控制,我们知道它们都处于同一版本
- 如果代码同时存在,则更容易测试依赖于另一个插件的插件
- 当我们在核心中更改某些内容时,我们通常需要进行多个 PR 才能修复插件中的规范,现在这意味着只有一个独立的 PR
最终结果是 Discourse 团队有更多可用时间来改进和维护产品,而不是处理这类问题,所以最终你也会受益。
我非常希望这些能从我的UI中消失,但它们只是占用了空间,因为它们不是可选的也不是隐藏的:它们是核心的一部分。这正是我们担心的原因。
关于首次用户体验,也许更改容器模板以包含并记录官方捆绑包会起作用:
hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
# The docker_manager plugin is mandatory for automated web-based updates
- git clone https://github.com/discourse/docker_manager.git
# The following plugins are installed on all Discourse hosted instances.
# Uncomment the line by removing `#` before the `- git clone` line to enable them.
# See https://meta.discourse.org/t/bundling-more-popular-plugins-with-discourse-core/373574/
# Discourse Advertising plugin (Ads): https://meta.discourse.org/t/discourse-advertising-plugin-ads/33734
#- git clone https://github.com/discourse/discourse-adplugin
# Discourse Affiliate
#- git clone https://github.com/discourse/discourse-affiliate
# ...
# ...
# Please add other plugins below. For a list of official plugins, see:
# https://meta.discourse.org/tag/official
# For all available plugins, see:
# https://meta.discourse.org/c/plugin/22
关于开发者体验,你肯定可以用另一种不那么侵入性的方式来自动化插件版本的传递。例如,使用 pups 规则来取消注释使用上述文档策略的插件。
你甚至可以有一个为你完成此事的容器模板:
templates:
- "templates/discourse.hosting.yml"
- "templates/discourse.core-bundle.yml"
请注意,我的第一印象是好的:我发现了一些我以前不知道的有趣插件。但是,是的,自从我看到你在过去十年中一直在优化并寻找最少的共同分母,我才惊讶于你会以这种方式处理这样的提议。
我认为你可以在通常放置 git clone 命令的地方添加一个 rm -rf discourse-ai。我还没有亲自尝试过。
是的,从技术上讲,您可以删除插件目录中的所有文件夹,核心 Discourse 仍然可以工作。
可以肯定的是,由 discourse 团队开发的这些插件遵循规则并增加了最小的开销。将它们全部包含进来可以更容易地看到它们协同工作并共享相同的要求。
您是在运行外部 postgres 而不是包含的 postgres 吗?您是在运行一个很长时间没有更新的两个容器设置吗?
您可以设法删除它们,但除非您与邪恶公司创建账户并获取允许跟踪开始的密钥,否则它们什么也做不了。
感谢您的回复,
希望如此,但它确实增加了出现错误和被攻击的风险,而对于不使用这些插件的社区(大多数社区都是如此)来说,则没有任何好处。
我认为 Discourse 已经找到了一个真正的问题,但给出了错误的解决方案。
我完全同意 Discourse 的开发/插件生态系统的脆弱性是一个真正存在的问题。针对不断变化的目标进行开发确实很困难,核心 API 的更改也使之变得困难。在某种程度上,这只是针对前沿上游进行开发的一部分,但这正是为什么不应该默认启用它的原因。只有少数简单的插件,我才能理解并同情您的问题(其范围比我的大得多)。
然而,Discourse 现在的做法只是推迟问题。它可能解决了 Discourse 的问题,但没有解决其他插件开发人员的问题。其他所有人都正在经历同样的痛苦,只是规模较小。
一个更好的解决方案是提供一个更健壮的 LTS(长期支持)版本,可以进行开发。我知道这已经在其他地方讨论过,所以我不会再赘述,但社区、插件开发人员甚至 Discourse 员工面临的最大挑战之一是没有 LTS。稳定版被积极不推荐使用。如果采用更传统的开发流程,插件开发会容易得多。我们可以知道何时会出现问题(主要版本升级),并据此进行计划。否则,我们可以确信较小的升级不会随机破坏我们的论坛。(这可能是我认为 Discourse 的最大弊端之一,也是我在人们讨论论坛选项时在其他地方看到人们提出的问题。不稳定性是一个真正的缺点。)
是的——根据链接,我在一个非容器化的开发环境中遇到了这个问题。(我还没有在生产容器中尝试过)
我认为这是我担心的事情之一,如果“标准”路径假定这些插件存在,那么我可能会遇到错误,因为其他人都在接受广告插件。我必须冒着意外出现错误的风险,或者处理额外的插件负载。我的目标是为我的部署提供尽可能最大的稳定性。
还值得指出的是,与许多其他论坛相比,Discourse 核心本身在资源使用方面相当重量级。我认为尝试保持核心轻量级以避免进一步加剧性能问题是值得的。
我还没有审计过这些,以确保它们在禁用时不会拉入跟踪/回拨 JavaScript,但在此之前,我将假定您是正确的。我希望有人能仔细检查这一点,因为如果事实证明并非如此,那将是一场巨大的灾难。
我认为 Hellekin 关于混乱的观点是有效的,而且我也认为他们关于大型科技广告插件的说法不会受到一些开源社区成员的欢迎——那些更有可能使用开源论坛的人。
总之,我也想说我确实很感谢您听取我的反馈,即使这并不容易 ![]()
我认为很难知道哪些已经过校对,哪些没有。
我曾短暂地想过,你是否事先检查过是否有任何未关闭的评论现在丢失了,因为只添加了文本而没有添加 Crowdin 的所有数据。但我想我甚至不想知道这个问题的答案。最终,没有人回应几个月,或者翻译人员的问题和评论就消失了,这没有任何区别。
当移除具有新捆绑包的插件目录时,是否有针对无副作用的测试,以确保插件不会无意中成为必需项?
我们的核心测试套件在未加载任何插件的情况下运行,因此是的,CI 应该可以检测到从核心到插件的任何依赖关系。
我注释掉了克隆插件的行,但当我再次运行“launcher rebuild app”时,我收到了相同的消息:
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 546 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.3.0/lib/pups/exec_command.rb:131:in `spawn'
exec failed with the params {"cd"=>"$home", "tag"=>"migrate", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
---
HINT: 插件 'discourse-reactions' 现在已包含在 Discourse 中,不应包含在您的容器配置中。
从您的 containers/app.yml 文件中删除行 'git clone https://github.com/discourse/discourse-reactions',然后重试。
有关更多信息,请参阅 https://meta.discourse.org/t/373574
---
---
HINT: 插件 'discourse-data-explorer' 现在已包含在 Discourse 中,不应包含在您的容器配置中。
从您的 containers/app.yml 文件中删除行 'git clone https://github.com/discourse/discourse-data-explorer',然后重试。
有关更多信息,请参阅 https://meta.discourse.org/t/373574
---
---
HINT: 插件 'discourse-solved' 现在已包含在 Discourse 中,不应包含在您的容器配置中。
从您的 containers/app.yml 文件中删除行 'git clone https://github.com/discourse/discourse-solved',然后重试。
有关更多信息,请参阅 https://meta.discourse.org/t/373574
---
** FAILED TO BOOTSTRAP ** 请向上滚动并查找更早的错误消息,可能不止一条。
失败的原因位于 FAILED 行的上方。