Commit Graph

356 Commits

Author SHA1 Message Date
Côme Chilliet
e4244c5fc8 fix(encryption): Improve type strictness on decryption check
Otherwise decrypting a falsy value like '0' would be seen as a
 decryption failure.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-02-23 14:49:03 +01:00
provokateurin
f12cecb684 feat(rector): Enable SafeDeclareStrictTypesRector
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-02-09 10:59:31 +01:00
Carl Schwan
ae73f7aaf5 refactor(setup-manager): Use ISetupManager instead of SetupManager
Keep using the OC API in the mount manager and OC_Utils, but the rest is
now using the public API.

Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-01-27 15:19:19 +01:00
Ferdinand Thiessen
108858daef refactor(encryption): migrate to Vue 3 and Typescript and script setup
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-01-13 22:49:18 +01:00
Stephan Orbaugh
fbff470d4c Merge pull request #56419 from nextcloud/fix/provide-non-interactive-mode-to-run-encryption
fix: support -n option to encrypt-all command to allow to run in non-interactive mode
2025-11-27 11:46:05 +01:00
yemkareems
26e2ff9dca fix: removed the -n option from options, added the check and made default answer to both questions true to support -n run directly
Signed-off-by: yemkareems <yemkareems@gmail.com>
2025-11-19 15:52:47 +05:30
yemkareems
d420b3f157 fix: added the interactive condition to the password question and in non-interactive mode sent the password directly
Signed-off-by: yemkareems <yemkareems@gmail.com>
2025-11-14 16:05:14 +05:30
Stephan Orbaugh
e7d02a6e5f Merge pull request #56189 from nextcloud/fix/do-not-test-encryption-on-grant
fix(encryption): Add the script to test encryption status only on logged in pages
2025-11-13 16:54:05 +01:00
Côme Chilliet
71688e3b8e Merge pull request #56167 from nextcloud/fix/fix-encryption-with-user-keys
fix(encryption): Fix user key support with basic auth
2025-11-13 11:51:59 +01:00
Côme Chilliet
928a45c677 fix(encryption): Fix user key support with basic auth
When using basic authentication the user is not logged in yet when
 KeyManager constructor gets called, so we need to delay the check for
 the loggedin user uid.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-11-10 18:11:01 +01:00
Hamza
f1cdf6885e feat: add occ command to scan and selete orphaned keys
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
2025-11-04 16:56:35 +01:00
Côme Chilliet
ca8b04f331 fix(encryption): Add the script to test encryption status only on logged in pages
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-11-04 14:52:58 +01:00
Carl Schwan
a3442be054 refactor: fix psalm issues from encryption commands
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-01 16:07:41 +02:00
provokateurin
d59338b377 refactor: Apply rector Nextcloud 26 set
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-09-28 11:45:52 +02:00
Ferdinand Thiessen
7cc3c1f669 fix(encryption): do not setup filesystem without permissions
If the current request does not have permissions for the filesystem we
must not try to setup the filesystem.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-09-20 22:23:12 +02:00
Côme Chilliet
8330f149b0 chore(encryption): Remove unused attribute $uid in KeyManager::getFileKey
It’s a private API in the application, no need to keep an unused
 attribute.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-09-09 11:46:28 +02:00
Côme Chilliet
bfcb2690f4 chore: Improve wording of logged error in apps/encryption/lib/KeyManager.php
Co-authored-by: Louis <louis@chmn.me>
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2025-09-09 11:46:19 +02:00
Côme Chilliet
bc5e29f9f2 fix(tests): Fix type issues and other problems with encryption tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-09-09 11:46:18 +02:00
Côme Chilliet
94254db001 chore(encryption): Cleanup typing in EncryptAll/DecryptAll
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-09-09 11:46:18 +02:00
Côme Chilliet
b74c7538ac fix(encryption): Do not depend upon user in session unless really necessary
Should fix a bunch of stuff when encryption listener is triggered by events from occ commands or background jobs

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-09-09 11:46:17 +02:00
Côme Chilliet
f95fef9938 chore(encryption): Adapt tests to code changes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-08-04 11:53:19 +02:00
Côme Chilliet
d711d68701 fix(encryption): Ignore shared files in encrypt-all command
Copying and renaming a share will not encrypt it anyway. It will get
 encrypted when the owner’s files get encrypted.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-08-04 10:42:04 +02:00
provokateurin
5bd626bd40 chore: Fix all method calls with too many arguments
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-07-22 12:34:49 +02:00
Côme Chilliet
4427050f84 fix(encryption): Correctly handle file opening and copying failures
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-07-03 15:19:34 +02:00
Côme Chilliet
1285ebc3cf fix(encryption): Catch exceptions in encrypt-all command and continue
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-07-03 15:19:34 +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
Côme Chilliet
f6365e76a1 fix(encryption): Do not register user key related event listeners
when master key is enabled.
Also added a safeguard in PassphraseService.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-06-16 15:52:41 +02:00
Robin Appelman
b0b8159d6a fix: throw a better error if we can't get the encrypted header size
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-05-09 22:33:45 +02:00
Ferdinand Thiessen
a3c2600386 fix(encryption): init keys also when logged in using cookie auth
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-04-02 00:06:10 +02:00
Ferdinand Thiessen
313d2219fd fix(encryption): Listen for user login and logout to set encryption key
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-03-06 17:22:51 +01:00
provokateurin
e8426996f5 fix(psalm): Fix some newly detected issues
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-21 12:37:59 +02:00
provokateurin
381077028a refactor(apps): Use constructor property promotion when possible
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-21 12:37:59 +02:00
Ferdinand Thiessen
f3aa004b1c refactor(encryption): Migrate away from Hooks to typed events
Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Louis <louis@chmn.me>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-10-15 18:33:06 +02:00
Côme Chilliet
1580c8612b chore(apps): Apply new rector configuration to autouse classes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-10-15 10:40:25 +02:00
provokateurin
51d9d63a01 chore: Use more gender neutral language
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-14 13:59:24 +02:00
Côme Chilliet
1a4978c4ea chore: Apply rector configuration to apps folder
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-09-20 17:51:00 +02:00
provokateurin
9836e9b164 chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +02:00
Daniel Kesselberg
af6de04e9e style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +02:00
Faraz Samapoor
6b795da540 Uses early returns.
To improve code readability.

Signed-off-by: Faraz Samapoor <fsa@adlas.at>
2024-08-16 09:33:16 +02:00
Faraz Samapoor
fc8b886295 Refactors encryption app commands.
To improve code readability.

Signed-off-by: Faraz Samapoor <fsa@adlas.at>
2024-08-16 09:33:16 +02:00
provokateurin
4016aace04 refactor(encryption): Replace security annotations with respective attributes
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-07-27 21:32:47 +02:00
Louis Chemineau
39fd19f1d6 refactor(encryption): Migrate app.php to Application.php
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-07-01 13:45:09 +02:00
Côme Chilliet
885604ce2d fix: add default value for new flag $useDecryptAll on getFileKey
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-06-06 10:23:03 +02:00
Côme Chilliet
95cd524771 fix: Autodetect legacy filekey instead of trusting the header for legacy header
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-06-04 17:20:20 +02:00
Andy Scherzinger
5b7dcc1427 chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-29 08:58:16 +02:00
Côme Chilliet
ec5133b739 fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-02 14:16:21 +02:00
Joas Schilling
aa5f037af7 chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-23 10:36:13 +01:00
Hamid Dehnavi
d64bbc8bd3 Convert isset ternary to null coalescing operator
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
2023-09-28 12:18:41 +03:30
Robin Appelman
e4f85226c5 extend fix-key-location to handle cases from broken cross-storage moves
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-08-31 19:46:47 +02:00
Côme Chilliet
3e176f58af Improve typing as suggested by review
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-08 09:14:16 +02:00