Commit graph

489 commits

Author SHA1 Message Date
Carl Schwan
9a8d45d81f
refactor(QueryException): Remove most usage of QueryException
This is preparation to move QueryException from OCP to OC as part of
Nextcloud 34.

Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-01-16 11:55:06 +01:00
Andy Scherzinger
32327c6285
Merge pull request #56773 from nextcloud/carl/remove-sciencemesh
refactor(share): Remove code related to science mesh integration
2025-12-30 14:18:53 +01:00
Carl Schwan
18964750f9
fix(openapi): Fix returned types from external share
We always been returning an int for for accepted, but since it was
returned as a mixed from the DB, psalm never complained about the fact
this was typed as a bool in the API doc.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-12-17 10:14:41 +01:00
Carl Schwan
df2f3a8422
refactor(integration): Refactor and fix federation integration tests
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-12-17 10:14:35 +01:00
Carl Schwan
3183ea79d2
refactor(external-share): Port more code to string as type for the id
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-12-16 10:40:09 +01:00
Carl Schwan
3bdb344224
perf(external-sharing): Port to Entity and SnowflakeId
This removes all the read after write and we don't need to queries all
the time the same share in the same request anymore.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-12-16 10:40:07 +01:00
Carl Schwan
cc7655136c
refactor(share): Remove code related to science mesh integration
The app was not updated for the past 2 years.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-12-03 14:11:58 +01:00
Côme Chilliet
cc66d203d4 chore: Improve wording in debug log
Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com>
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2025-11-24 10:29:46 +01:00
Côme Chilliet
a60f9494ec fix(files_sharing): Allow deleting a share of a missing file
This can happen in various scenarios, we should allow the user to delete
 the share in this situation.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-11-24 10:29:46 +01:00
nfebe
64016898d5 fix(sharing): Allow reasonable control 4 'Hide download' on fed shares
When creating public links from federated shares, users should be able to set
the 'Hide download' option independently as long as they are more restrictive
than the original share permissions.

Previously, the `checkInheritedAttributes` method was ignoring user preferences
and always overriding the hideDownload setting based solely on inherited
permissions, preventing users from disabling downloads even when the parent
share allowed them.

This fix implements some sort of inheritance logic:
- Users can only be MORE restrictive than parent shares, never LESS restrictive
- If parent hides downloads -> child MUST hide downloads (enforced)
- If parent allows downloads -> child can CHOOSE to hide or allow downloads
- If parent forbids downloads entirely -> child cannot enable downloads

Signed-off-by: nfebe <fenn25.fn@gmail.com>
2025-10-23 16:09:21 +01:00
skjnldsv
9c98b722f4 fix(dav): allow multiple link shares token in session
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
2025-10-23 13:10:39 +02:00
nfebe
a28834b163 fix(files_sharing): Only send password on change
The password param should never be sent if the intention is not
remove it or update it.

This commit adapts the frontend and backend to this rule to avoid weird bugs
especially around updating new shares.

Signed-off-by: nfebe <fenn25.fn@gmail.com>
2025-10-21 16:54:55 +01:00
Daniel Kesselberg
83a691709c
refactor: use IEmailValidator.isValid instead of IMailer.validateEmailAddress
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2025-10-04 21:54:22 +02:00
nfebe
0970409765 refactor(ShareApiController): Streamline share providers & add error logging
1. Consolidated the repetitive provider code into a clean loop
2. Added exception handling to log unexpected errors

Signed-off-by: nfebe <fenn25.fn@gmail.com>
2025-10-01 12:48:53 +01:00
Richard Steinmetz
b7dc720848
feat: calendar federation
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2025-08-27 17:14:15 +02:00
provokateurin
37175e0e2b
fix(files_sharing): Also hide own reshares in shared with me section
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-08-18 11:38:05 +02:00
nfebe
2bb8c72c47 feat(files_sharing): Toggle display for trusted server shares
Signed-off-by: nfebe <fenn25.fn@gmail.com>
2025-07-29 13:24:49 +01:00
Ferdinand Thiessen
a18e61a1e5
feat(files_sharing): add config option for extending link-share permissions
This allows the admin to control the behavior whether link shares with
READ permissions should be extended to also gain SHARE permissions,
allowing users (public share receivers) to add the share to their cloud.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-07-17 16:59:36 +02:00
Côme Chilliet
90a2c77abf
fix: Use Server::get in files_sharing DeletedShareAPIController
In this case we do not want the application DI container because we are
 requesting classes from other applications, so it’s better to ask the
 server container. We use \OCP\Server::get for this.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-07-08 13:32:15 +02:00
Côme Chilliet
ab310ce938
fix: Fix issues and tests in DIContainer and friends
Some tests related to MiddlewareDispatcher are still failing.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-07-08 13:32:14 +02:00
Robin Appelman
aa15f9d16d
chore: run rector
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-07-01 22:45:52 +02:00
Ferdinand Thiessen
5981b7eb51
chore: apply new CSFixer rules
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>

# Conflicts:
#	apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
2025-07-01 16:26:50 +02:00
skjnldsv
9806a9830c feat(files_sharing): allow viewing files with download disabled
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
2025-06-26 11:47:53 +02:00
Ferdinand Thiessen
495c364268
chore: use consistent casing for header names (required by openAPI)
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-06-09 19:24:26 +02:00
Ferdinand Thiessen
4a9dc6c64d
refactor: move tag handling from files handler to files_sharing
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-05-16 13:09:03 +02:00
John Molakvoæ (skjnldsv)
cd6a53ea4d fix(files_sharing): add mime fallback to public preview too
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2025-05-13 18:28:54 +02:00
Maxence Lange
cc96782177 fix(share): assume download enabled on federated share
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2025-05-06 14:48:28 -01:00
Ferdinand Thiessen
47d1afbb7f
revert: do not unify hide-download and prevent-download permissions
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-04-16 20:38:20 +02:00
John Molakvoæ
50dcbdeec6
fix(files_sharing): adjust rate limit share creation to 20 over 10 minutes
Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
2025-04-15 10:32:47 +02:00
skjnldsv
338ab64365
fix(files_sharing): rate limit share creation 10 times per 10 minutes
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
2025-04-15 08:45:25 +02:00
skjnldsv
70218dc0a4 fix(files_sharing): fix share creation error handling
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
2025-04-09 14:52:42 +00:00
Côme Chilliet
a39bee57d9 fix: Fix download activity for folders
Remove duplicate activity publishing from share controller download,
 listen to BeforeZipCreatedEvent to publish activity for folders, and
 cache folders activity to avoid sending activity for each file in the
 folder.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-03-25 15:43:09 +01:00
Ferdinand Thiessen
00d08a4f69
fix(lookup-server): disable lookup server for non-global scale setups
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-03-11 14:26:47 +01:00
Ferdinand Thiessen
34251c4375
fix(lookup-server): do not query data by default
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-03-11 14:26:47 +01:00
Ferdinand Thiessen
7e6608d119
fix(files_sharing): Also list deleted team shares
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-02-20 14:32:22 +01:00
Ferdinand Thiessen
c19ce403f3
fix(files_sharing): block downloading if needed
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-02-18 11:58:12 +01:00
Côme Chilliet
64863c9d46
chore: Apply new rector configuration to apps folder
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-02-13 11:46:42 +01:00
Côme Chilliet
ed5b7ae161
chore: re-apply current rector configuration to apps folder
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-02-13 11:45:33 +01:00
Côme Chilliet
a3685551f7
fix: Replace isInstalled calls with isEnabledForAnyone or isEnabledForUser
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-02-13 10:19:19 +01:00
nfebe
8178797eb5 refactor: Remove some deprecated containers and exceptions
Signed-off-by: nfebe <fenn25.fn@gmail.com>
2025-02-06 12:15:31 +01:00
Ferdinand Thiessen
73dc0f0f19
fix(sharing): Ensure download restrictions are not dropped
When a user receives a share with share-permissions but also with
download restrictions (hide download or the modern download permission attribute),
then re-shares of that share must always also include those restrictions.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-02-04 15:39:14 +01:00
Ferdinand Thiessen
253f4345f1
fix(files_sharing): Respect permissions passed when creating link shares
Given:
User creates a link or email share with permissions=4 (create only = file drop).

Problem:
Currently the permissions are automatically extended to permissions = 5
(READ + CREATE). Work around was to create the share and directly update
it.

Solution:
Respect what the user is requesting, create a file drop share.

Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-01-28 16:40:50 +01:00
Ferdinand Thiessen
305e1bb260
fix: Ensure label is always a string
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-01-26 20:41:31 +01:00
Anna
d9a7124592
Merge pull request #49898 from nextcloud/fix/noid/no-emails-for-user-shares
fix(sharing): send share emails for internal users too
2025-01-16 18:50:30 +01:00
Christopher Ng
0eb39d7b9c feat(sharing): Respect admin custom tokens setting
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2025-01-15 15:50:43 -08:00
Christopher Ng
beffb26266 feat(sharing): Fetch a unique generated token
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2025-01-15 15:49:19 -08:00
Christopher Ng
f92875cf6a feat(sharing): Allow updating share token
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2025-01-15 15:49:19 -08:00
provokateurin
4dfa02c29d
fix(files_sharing): Handle null userId
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-01-13 15:19:54 +01:00
Anna Larch
236e084fbb fix(sharing): send share emails for internal users too
Signed-off-by: Anna Larch <anna@nextcloud.com>
2025-01-13 14:13:02 +01:00
provokateurin
085d4c9364
refactor(OpenAPI): Adjust scopes to match previous behavior
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-01-06 14:30:40 +01:00