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

Aperta Adatta ai principianti
#8,788 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@whoalin1 ci sta già lavorando.

Dal 28/11/2026.

  • #8825 di @whoalin1 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
docker, mysql, php

Direzione di ricerca

Inizia da lib/Service/ConfigService.php, in ensureFederationEnabled(), dove entrambe le chiavi files_sharing vengono lette con un valore predefinito di 'no'. Cambia questi valori predefiniti in 'yes' per allinearli a FederatedShareProvider. Il lavoro è completato quando i test unitari dimostrano che la federazione passa con entrambe le chiavi non impostate e che continua a generare un'eccezione quando la federazione di Deck è disattivata o una delle due chiavi è 'no'.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
JavaScript
Stelle
1.4k
Fork
380
Merge medio
1g 17h
PR unite (30g)
72

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nextcloud/deck

Tutte le issue di nextcloud/deck

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.