Commit Graph

27400 Commits

Author SHA1 Message Date
provokateurin 1cf69c33ed fix(Share): Add missing optional parameter to IManager::shareApiAllowLinks()
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-05-28 15:35:24 +02:00
provokateurin b1724dbad0 chore(Cache): Remove deprecated insert and update events
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-05-28 14:02:08 +02:00
Stephan Orbaugh 4cad192bcd Merge pull request #60102 from nextcloud/automated/noid/rector-changes 2026-05-28 12:31:17 +02:00
Kate b165048074 Merge pull request #60733 from nextcloud/fix/db/sqlite-foreign-key-constraints
fix(DB): Enforce foreign key constraints in SQLite
2026-05-28 12:04:52 +02:00
Anna Larch b2c9273e5f fix(appconfig,userconfig): restore pre-migration fallback for ownCloud migration
AppConfig and UserConfig unconditionally queried NC-only columns (type,
lazy, flags, indexed) that don't exist in ownCloud's database schema,
breaking ownCloud → Nextcloud upgrades entirely before the schema
migration steps could run.

Restore the fallback pattern in both classes: on first loadConfig() call,
if a DBException with REASON_INVALID_FIELD_NAME is thrown, set
$migrationCompleted = false and retry selecting only the columns present
in ownCloud's schema. INSERT and UPDATE statements also omit NC-only
columns when $migrationCompleted is false.

The catch block also guards against infinite recursion: if $migrationCompleted
is already false when the exception fires, the exception is re-thrown
instead of triggering another recursive call.

Fixes: https://github.com/nextcloud/server/issues/57340

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 09:46:49 +02:00
Nextcloud bot 3f7721b996 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2026-05-28 00:23:06 +00:00
Louis da7c4ef3ce Merge pull request #60316 from Justinzobel/work/justinzobel/spellingfixes
Spelling fixes
2026-05-27 18:47:51 +02:00
Micke Nordin cc9e0ba582 fix(http-sig): make setSignature public and skip third-party-dependent test
Two CI failures introduced by the test additions in this PR:

1. testEd25519VerifyAcceptedWhenSodiumLoaded calls setSignature() to inject
   an externally-produced Ed25519 signature (since Algorithm::sign() rejects
   Ed25519 by design). setSignature was declared protected, so the test
   couldn't call it from outside the class hierarchy. Make it public —
   SignedRequest lives in the OC\ private namespace, so this widens
   internal-only visibility, not the public API surface.

2. testParseKeyRejectsContradictoryAlg expected firebase/php-jwt's
   JWK::parseKey() to throw on a kty=OKP/crv=Ed25519/alg=ES256 key. The
   current firebase/php-jwt version does not validate that coherence at
   parse time, so the test now fails to see any throwable. The actual
   security check happens at Algorithm::verify() time and is covered by
   testVerifyEd25519KeyAgainstES256Alg right above it. Skip the parse-time
   test with a comment pointing at the verify-time coverage.

Signed-off-by: Micke Nordin <kano@sunet.se>
2026-05-27 11:03:55 +02:00
Micke Nordin c753aad9e3 refactor(ocm): expose confirmRequestOrigin as a function on ocmDiscoveryService
Apps implementing OCM endpoints via OCMEndpointRequestEvent (e.g.
SUNET/nextcloud-ocm_request_share for request-share, nextcloud/contacts
for invite-accepted) need to apply the same identity check that the
built-in addShare and receiveNotification handlers apply, so it makes
sense to make it publicly accessible.

It also allows us to refactor RequestHandlerController::confirmSignedOrigin
to use the new public method and drop the confirmNotificationIdentity helper.

Signed-off-by: Micke Nordin <kano@sunet.se>
2026-05-27 11:03:55 +02:00
Micke Nordin 1bad4fe238 fix: Make sodium optional
This commit switches the default signature algorithm to
ecdsa-p256-sha256 instead of Ed25519. This allows us to make sodium
optional again, and we only pull it in to use it for verifying incomming
signatures. If sodium is not installed, we throw on Ed25519 signatures
instead. At least it is easy for most people to make their Nextcloud
install fully RFC compliant by installing sodium.

I also renamed all the Ed25519 function names to be more precis, using
Jwks for the JSON Web Keys, and RFC9421 for the http-signature code,
where it is needed to distinguish from draft-cavage signatures.

Signed-off-by: Micke Nordin <kano@sunet.se>
2026-05-27 11:03:55 +02:00
Micke Nordin 1b4c9b21d2 chore: Add review feedback
Throw when one of the headers are empty

Enumerate all the allowed algorithms in th NATIVE constant

Co-authored-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: Micke Nordin <kano@sunet.se>
2026-05-27 11:03:55 +02:00
Micke Nordin d8cafa1ba5 chore: Fix return values
Use constants instead of 0/1

Also fix PHPDoc to use correct return values.

Co-authored-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: Micke Nordin <kano@sunet.se>
2026-05-27 11:03:55 +02:00
Micke Nordin 166bc2c74b feat(http-sig): occ commands to manage Ed25519 keys
ocm:keys:list      list known keys with their slot and kid
  ocm:keys:stage     generate a pending key, advertise via JWKS
  ocm:keys:activate  promote pending -> active, demote previous active
  ocm:keys:retire    delete the retiring key (kid stops resolving)

Plus the autoloader regen covering the new classes from this branch.

Signed-off-by: Micke Nordin <kano@sunet.se>
2026-05-27 11:03:55 +02:00
Micke Nordin 3b5107bc96 feat(http-sig): OCM Ed25519 keys, JWKS endpoint, http-sig capability
OCM dual-stack integration of RFC 9421 alongside the existing cavage
publicKey path:

- OCMSignatoryManager: Ed25519 active/pending/retiring slot rotation
  backed by numbered pool appkeys, getRemoteKey for inbound JWK lookup
  with per-origin cache + cache-miss refetch, and getLocalEd25519Jwks
  for the JWKS endpoint.
- Rfc9421SignatoryManager: per-call wrapper that swaps in the Ed25519
  signatory and toggles `rfc9421.format`.
- OCMJwksHandler: serves /.well-known/jwks.json (RFC 7517) when signing
  is enabled.
- OCMDiscoveryService: advertises `http-sig` in capabilities when
  signing is enabled, and picks the signature scheme on outbound based
  on the remote's advertised capabilities.
- Application.php: register the JWKS well-known handler.

Signed-off-by: Micke Nordin <kano@sunet.se>
2026-05-27 11:03:55 +02:00
Micke Nordin 3a99cf9a67 feat(identityproof): Ed25519 app keys
Add Manager::generateEd25519AppKey: persist a sodium-generated
Ed25519 keypair (raw 32-byte public, 64-byte secret) under the same
appdata layout the existing RSA path uses. Used by OCMSignatoryManager
for the slotted RFC 9421 signing keys.

Signed-off-by: Micke Nordin <kano@sunet.se>
2026-05-27 11:03:55 +02:00
Micke Nordin 0eb927e617 feat(http-sig): RFC 9421 protocol primitives
Add the RFC 9421 (HTTP Message Signatures) sign/verify path alongside
the existing draft-cavage implementation:

- Algorithm: sodium for Ed25519, JWT::sign for RSA / ECDSA, ecdsaRawToDer
  for the ECDSA wire format. JWK parsing via JWK::parseKey.
- SignatureBase: RFC 9421 §2.5 base construction for the derived
  components OCM uses plus plain HTTP fields.
- ContentDigest: RFC 9530 helpers used as a covered component.
- Rfc9421IncomingSignedRequest / Rfc9421OutgoingSignedRequest:
  request models. Parsing of Signature-Input / Signature delegates
  to gapple\\StructuredFields\\Parser.
- IJwkResolvingSignatoryManager: capability bit signatory managers
  advertise to participate in RFC 9421 verification.
- OcmProfile: OCM-mandated dictionary label.
- SignatureManager: dispatch to RFC 9421 inbound when Signature-Input
  is present, outbound when rfc9421.format is set.

Plus tests for each primitive and a full round-trip across the model.

Signed-off-by: Micke Nordin <kano@sunet.se>
2026-05-27 11:03:55 +02:00
provokateurin 3ce12c83e1 feat(UserManager): Add getters for avatar URLs
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-05-27 06:44:36 +02:00
Anna Larch 29f43d8e7a fix(security): don't propagate ValueError from Crypto::decrypt() fallback
When decrypting a v3 ciphertext with a mismatched secret, the first
attempt throws an Exception (HMAC mismatch). The fallback then calls
decryptWithoutSecret() with an empty string, which causes hash_hkdf()
to throw a ValueError. Since ValueError extends \Error rather than
\Exception, it bypassed the catch block and propagated as an unhandled
error, crashing the whole request.

Wrap the fallback in its own try/catch(\Throwable) and rethrow the
original Exception so callers get a meaningful HMAC mismatch error.

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 21:20:41 +02:00
Anna Larch 6220ae9175 fix(sharing): restore STATUS_ACCEPTED for OC-migrated group share subshares
When an ownCloud-migrated group share (which has no per-user USERGROUP
subshare) is renamed for the first time, DefaultShareProvider::move()
inserted a new USERGROUP row without setting `accepted`. The column
defaulted to 0 (STATUS_PENDING), causing MountProvider to skip the
share on the next login — the shared file disappeared for the recipient.

Fix: set accepted = STATUS_ACCEPTED explicitly on the INSERT in
DefaultShareProvider::move() for the TYPE_GROUP branch.

Secondary fix: SharedMount::moveMount() silently returned true when
updateFileTarget() threw (e.g. group no longer exists on an OC-migrated
instance). Set $result = false in the catch block so View::rename()
propagates the failure instead of silently corrupting VFS state.

An opt-in occ command (sharing:fix-owncloud-group-shares) with --dry-run
support is included to repair existing broken instances. It targets only
TYPE_USERGROUP subshares with accepted=STATUS_PENDING and permissions!=0
(shares that were accepted but broken by the missing column default),
leaving explicitly declined shares (permissions=0) untouched.

AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
2026-05-26 17:28:39 +02:00
provokateurin 0ae5a05c25 fix(DB): Enforce foreign key constraints in SQLite
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-05-26 15:47:37 +02:00
John Molakvoæ 2fb2f31abd Merge pull request #60654 from nextcloud/fix/null-safe-strtolower-getvaluebool
fix(config): add null coalescing fallback in getValueBool before strtolower
2026-05-26 09:32:44 +02:00
Christoph Wurst 29ebfa7db4 Merge pull request #60649 from nextcloud/worktree-fix-content-disposition
fix(http): avoid iconv for header ascii fallback
2026-05-26 09:22:40 +02:00
Nextcloud bot 5f73bf657b fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2026-05-26 00:23:14 +00:00
nextcloud-command fd14234a6a refactor: Apply rector changes
Signed-off-by: GitHub <noreply@github.com>
2026-05-24 14:56:18 +00:00
Christoph Wurst d1d24e65a4 fix(http): avoid iconv for header ascii fallback
iconv transliteration is locale- and config-dependent and fails silently
on some setups. UnicodeString::ascii() from symfony/string uses a built-in
transliteration table backed by symfony/polyfill-intl-normalizer, so it
works on all setups without requiring optional PHP extensions.

Assisted-by: Claude:claude-sonnet-4-6
Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
2026-05-22 14:58:14 +02:00
skjnldsv b86f463915 fix(config): add null coalescing fallback in getValueBool before strtolower
Followup to #59646: guard against null reaching strtolower() in both
AppConfig and UserConfig getValueBool(). Also aligns AppConfig with the
(string) cast added in UserConfig by the original PR.

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
2026-05-22 10:23:50 +02:00
Nextcloud bot 46bc7ebd52 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2026-05-22 00:22:45 +00:00
Andy Scherzinger a118773895 Merge pull request #59168 from philiprenich/fix-ios-browsers
fix: treat all WebKit iOS browseres the same
2026-05-21 10:17:15 +02:00
Benjamin Gaussorgues bb63987d9c Merge pull request #60612 from nextcloud/chore/server_id_entropy
chore(snowflake): add more randomness in server id fallback
2026-05-21 10:16:36 +02:00
Benjamin Gaussorgues eecbe37654 chore(snowflake): add more randomness in server id fallback
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2026-05-21 09:18:04 +02:00
Daniel c0c03fd37f Merge pull request #60546 from nextcloud/local-address-nat64
fix: handle NAT64 addresses in isLocalAddress
2026-05-20 16:10:25 +02:00
Arthur Schiwon b5216aa484 Merge pull request #45027 from remicollet/argon-sodium-threads
fix(argon2): respect max value for hashingThreads
2026-05-20 13:28:53 +02:00
Justin Zobel 5619cc0439 fix: "than" vs "then" typos
Signed-off-by: Justin Zobel <justin.zobel@gmail.com>
2026-05-20 12:39:19 +09:30
Nextcloud bot 9a03d9aee8 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2026-05-20 01:49:26 +00:00
Anna afe61fe63d Merge pull request #60286 from nextcloud/fix/noid/appstore-fetcher-generic-file-exception
fix(AppStore/Fetcher): catch GenericFileException when reading cache file in Fetcher
2026-05-20 02:51:28 +02:00
Remi Collet eb32f1d513 fix: also respect max value for hashingThreads
Co-authored-by: Remi Collet <remi@php.net>
Signed-off-by: Remi Collet <remi@remirepo.net>
2026-05-19 20:44:51 +02:00
Robin Appelman a472a189bb fix: handle NAT64 addresses in isLocalAddress
Signed-off-by: Robin Appelman <robin@icewind.nl>
2026-05-19 17:06:46 +02:00
Anna Larch c4356e1b25 fix(appstore): address review comments on GenericFileException handling
- Attempt delete before logging the warning, so the warning only fires
  when we know recovery will succeed
- Log an error (not silently return) when delete itself fails
- Use catch (\Exception) without variable (PHP 8)
- Replace willReturnArgument(1) with explicit willReturn(true) in test
- Add blank lines between logical blocks in test for readability

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 16:52:52 +02:00
Anna Larch 5113b18739 fix(appstore): catch GenericFileException when reading cache file in Fetcher
When the appstore cache file exists but getContent() throws a
GenericFileException (I/O error or OS-level permission failure), explicitly
delete the file and recreate it before writing fresh data — mirroring the
NotFoundException recovery path. If deletion itself fails, return [] cleanly.

Previously, the unhandled exception caused the entire apps settings page to
crash. The new test covers both the recovery path and deletion failure.

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 16:34:06 +02:00
Ferdinand Thiessen 29fc48e083 fix(OC_Helper): properly calculate quota of shared storages
- resolves https://github.com/nextcloud/server/issues/55659

First we need to properly handle shared storages,
because there the quota is the quota of the user who owns the nodes,
not the user who shared the nodes.

Second if no user can be fetched then we cannot get the global storage
info, thus in this case (public share?) we need to safe-guard.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-05-19 13:27:08 +02:00
Nextcloud bot 6115c25097 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2026-05-19 00:23:11 +00:00
Louis be5aa16bda Merge pull request #60505 from nextcloud/artonge/fix/enable_and_user_limit
feat(users): Check assertion when enabling user
2026-05-18 20:02:36 +02:00
Salvatore Martire f55b3fb542 Merge pull request #59966 from nextcloud/feature/workflow-app-rules
Add runtime operations in WFE
2026-05-18 16:52:50 +02:00
Stephen Cuppett 4082691393 Merge pull request #60344 from cuppett/cuppett/refactor-encryption-wrapper
fix(encryption): Refactor EncryptionWrapper
2026-05-18 10:21:27 -04:00
Josh fff2a542ba chore(FileInfo): fixup code typo
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-05-18 08:40:31 -04:00
Josh 92a28290a3 fix(FileInfo): harden getChecksum()
- `checksum` is already optional/derived metadata in practice
- callers already treat `null`l / `''` as "no checksum"

Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-05-18 08:35:20 -04:00
Louis Chmn 7318171e7c feat(users): Check assertion when enabling user
Signed-off-by: Louis Chmn <louis@chmn.me>
2026-05-18 14:32:02 +02:00
Salvatore Martire 2a9036a5b7 feat(wfe): add runtime operations
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>

# Conflicts:
#	apps/workflowengine/lib/Manager.php
2026-05-18 12:23:49 +02:00
Nextcloud bot 2c47ef43a9 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2026-05-18 00:23:00 +00:00
Josh 965b6a96e4 refactor(legacy): simplify getTheme and clarify legacy theme docs
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-05-16 10:04:37 -04:00