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

Đang mở Phù hợp với người mới
#8,788 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@whoalin1 đang làm issue này rồi.

Từ ngày 28/11/2026.

  • #8825 của @whoalin1 — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker, mysql, php
Lĩnh vực
api, authorization, backend

Hướng nghiên cứu

Bắt đầu từ lib/Service/ConfigService.php, trong ensureFederationEnabled(), nơi cả hai khóa files_sharing được đọc với giá trị mặc định là 'no'. Đổi các giá trị mặc định này thành 'yes' để khớp với FederatedShareProvider. Hoàn thành khi các unit test cho thấy federation vẫn thông qua khi cả hai khóa chưa được đặt, và vẫn ném ngoại lệ khi federation của Deck bị tắt hoặc một trong hai khóa là 'no'.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
JavaScript
Star
1.4k
Fork
380
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
72

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nextcloud/deck

Tất cả issue của nextcloud/deck

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.