Deck treats unset files_sharing server-to-server keys as disabled

未关闭 适合新手
#8,788 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@whoalin1 已经在做这个了。

开始于 2026年11月28日。

  • #8825 来自 @whoalin1 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
docker, mysql, php

调研方向

从 lib/Service/ConfigService.php 中的 ensureFederationEnabled() 开始,这里读取两个 files_sharing 键时默认值为 'no'。将这些默认值改为 'yes',使其与 FederatedShareProvider 保持一致。当单元测试显示两个键都未设置时联合功能可以通过,并且在 Deck 联合功能关闭或任一键为 'no' 时仍然抛出异常,即完成。

由索引模型根据 Issue 内容生成。

描述

0. Needs triage bug

Describe the bug
ConfigService::ensureFederationEnabled() reads files_sharing/outgoing_server2server_share_enabled and incoming_server2server_share_enabled with a default of 'no':
https://github.com/nextcloud/deck/blob/bf65da22e13a366c70c72391beaee00ed2152810/lib/Service/ConfigService.php#L156-L161

Nextcloud itself defaults both to 'yes' (FederatedShareProvider::isOutgoingServer2serverShareEnabled()). On an instance where an admin never changed the federated sharing settings, the admin page shows federated sharing as enabled, but Deck refuses every federated share with "Federation is disabled". The instance also does not advertise deck in /.well-known/ocm, so shares from other servers fail too.

To Reproduce

  1. On an instance where the federated sharing settings were never changed, enable Deck federation (occ config:app:set deck federationEnabled --value=yes).
  2. Share a board with a federated user.
  3. The API returns 400 "Federation is disabled".
  4. Setting both keys explicitly to yes makes it work.

Expected behavior
Deck uses the same defaults as federated file sharing.

Suggested fix
Use 'yes' as the default for both keys in ConfigService::ensureFederationEnabled():

if ($this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') !== 'yes') {
	throw new FederationDisabledException();
}
if ($this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') !== 'yes') {
	throw new FederationDisabledException();
}

Unit tests can cover: Deck federation enabled with both keys unset passes; Deck federation off, or either key set to no, still throws. I tested this change with unit tests and on instance A with both keys deleted: sharing with a user on instance B works.

Server details

Two instances, both Docker, MariaDB 11.8 / MySQL, PHP 8.5.13:

  • Instance A: Nextcloud 35.0.3, Deck 1.19.2
  • Instance B: Nextcloud 34.0.6, Deck 1.18.7

The code paths are unchanged on main (bf65da22e).


This report was drafted with AI assistance (Claude Code) and reproduced on the two instances above.

主要语言
JavaScript
星标
1.4k
派生
380
平均合并
1 天 17 小时
30 天内合并 PR
72

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nextcloud/deck 的其他 Issue

查看 nextcloud/deck 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。