Commit Graph

1216 Commits (jtr/fix-public-exceptions-http-codes)

Author SHA1 Message Date
Côme Chilliet eb54143c2d
fix: Delete legacy OC_Response
Moved the last used method in base.php where it’s called. Ideally we
 would remove it but it’s not clear whether that would be possible any
 time soon or even at all.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-09-29 09:35:32 +07:00
Ferdinand Thiessen 660f3f6fd1
refactor: use logical `&&` `||` instead of weak `and` `or` operators
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-09-27 23:02:18 +07:00
Andy Scherzinger 03f22074d9
Merge pull request #54713 from nextcloud/fix/fix-status.php-cookies
fix(status.php): Fix samesite cookies
2025-09-01 11:48:27 +07:00
Côme Chilliet 22160b9d2b
chore: Add comment to make it clear the bail out for status.php should
not be moved above ini_set calls.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-09-01 10:52:31 +07:00
Joas Schilling 3df6d90a4c
Revert "perf(base): Stop setting up the FS for every basic auth request" 2025-08-28 17:11:31 +07:00
Côme Chilliet 34aaa0cf83
fix(status.php): Fix samesite cookies
This skips less calls for status.php so that ini vars are correctly set
 and the code to set samesite cookies has the correct information when
 Nextcloud is installed in a subpath.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-08-28 16:02:13 +07:00
provokateurin 778c6c0d46 perf(base): Stop setting up the FS for every basic auth request
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-08-28 09:28:11 +07:00
Robin Appelman 21c7ae62e0
Merge pull request #53528 from nextcloud/jtr-maint-refresh-part-1
fix(maintenance): refresh page when turned off (sometimes)
2025-08-11 11:44:35 +07:00
Ferdinand Thiessen 7fe272fd74
fix(Coordinator): ensure the core app is loaded first
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-07-17 16:59:45 +07:00
John Molakvoæ 2b50d9b2c5
Revert "perf(base): Stop setting up the FS for every basic auth request" 2025-07-11 17:07:44 +07:00
John Molakvoæ 6f0255d82a
Merge pull request #53141 from nextcloud/perf/files/setup-fs-basic-auth-request 2025-07-11 15:25:10 +07:00
Daniel Calviño Sánchez 01766b18f8 fix: Fix theming for disabled accounts
The Theming app injects the stylesheets for the different themes in the
"<header>" element of the page, and those stylesheets are then loaded by
the browser from a "Controller" (a plain "Controller", not an
"OCSController"). The stylesheets, in turn, may also get some images
(like the background) also from the "Controller".

When handling a request to "index.php" it is checked whether the user is
logged in and, if not, a login is tried. A disabled user is explicitly
seen as not logged in, so a login is always tried in that case, but
disabled users are also explicitly prevented to log in, so the login
also fails. Due to that trying to get any of the themed stylesheets or
images with a disabled account (to be able to show the "Account
disabled" error page) fails with an HTTP status 401.

To solve that, and to avoid touching this basic logic as much as
possible, the login exception is now ignored (if the user is disabled)
for some specific requests to the Theming app.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2025-07-10 15:19:01 +07:00
provokateurin 0eae0e3c06
perf(base): Stop setting up the FS for every basic auth request
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-07-08 11:38:59 +07:00
Côme Chilliet e8bc35ec0a
fix(ocs): Return a proper error on JSON decoding failures
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-07-01 10:45:31 +07:00
Josh 54142b2b20
fix(maintenanceMode): Refresh web page when turned off (part 1)
Signed-off-by: Josh <josh.t.richards@gmail.com>
2025-06-16 15:41:59 +07:00
Samuel Bizien Filippi a14cade3ac feat(core): add cookie_domain config option
Signed-off-by: Samuel Bizien Filippi <samuel.bizien-filippi@finances.gouv.fr>
2025-06-16 15:33:48 +07:00
Côme Chilliet 78ff8e233f
fix: Switch lazy object to enabled by default on PHP 8.4
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-06-05 20:51:24 +07:00
Côme Chilliet 2eed6d3a89
feat: Add a configuration toggle for lazy objects in DI
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-06-05 20:51:24 +07:00
Ferdinand Thiessen 4cd026ad43
Merge pull request #53157 from nextcloud/chore/refactor-core
refactor(core): migrate core application to `IBootstrap`
2025-06-02 16:51:49 +07:00
Ferdinand Thiessen c21e189850
fix: make core application bootstrapable by coordinator
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-06-02 15:58:54 +07:00
Côme Chilliet 7c251e4f96
fix: Remove useless legacy autoloader
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-05-27 18:06:28 +07:00
Côme Chilliet 9560e00cf3 chore: Remove useless legacy autoloader for tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-05-27 16:15:58 +07:00
Louis a48bc55e2a
Merge pull request #52810 from nextcloud/artonge/feat/do_not_require_samesite_strict_cookie_on_public.php 2025-05-22 10:30:16 +07:00
Louis Chemineau 009d0c550c
fix: Move CSRF check from base to PublicAuth for public.php
This currently prevent directly accessing a ressource when clicking on a link on a third party site. Example, clicking on `https://example.com/public.php/dav/files/pqLWcA269zfzXez/?accept=zip` in a GitHub comment.

Skipping the check is an issue with password protected shares, as it allows third party sites to request the ressource when the user already entered the password, aka CSRF.  So after removing the check from `base.php`, we need to add the it again in the `PublicAuth` plugin.

We also add a redirect to be helpful to the user.

**Warning**: this adds the limitation that clicking on a direct download link for password protected shares will redirect you to the password form, and then to the main share view.

Fix #52482

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-05-21 16:01:36 +07:00
Ferdinand Thiessen 22889d4f1d
chore: deprecate `OC_Helper::isReadOnlyConfigEnabled`
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-05-17 13:18:49 +07:00
Côme Chilliet baae99eaad
Merge pull request #52667 from nextcloud/fix/improve-init-profiling
Improve init profiling
2025-05-14 22:57:55 +07:00
Côme Chilliet 536ccf144c feat(encryption): Migrate from hooks to events
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-05-13 23:37:52 +07:00
Côme Chilliet 20c6d1a7e9
feat: Improve init a bit, and add more profiling steps
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-05-13 16:08:49 +07:00
Julius Knorr 3fc9a99521 perf: Add config options to trigger individual and sample profiling using excimer
Signed-off-by: Julius Knorr <jus@bitgrid.net>
2025-04-22 08:57:02 +07:00
Côme Chilliet 0cf4f3cc71
fix: Replace all usages of OC_User backend method calls by IUserManager
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-04-10 11:29:21 +07:00
Côme Chilliet b2100484c0 fix: Remove some call and references to deprecated OC_Util class
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-04-07 17:05:54 +07:00
Côme Chilliet eb597917f6
Merge pull request #51029 from nextcloud/fix/deprecate-oc-template-and-cleanup
fix: Deprecate OC_Template, add proper template manager instead
2025-03-10 16:20:45 +07:00
Joas Schilling 34bcc53fb9
fix(base.php): Correct order for booting \OC\Server
A recent change had broken authentication with an older
FastCGI Apache2 module, because the IRequest object got
initialised before the fix from self::handleAuthHeaders()
copied the authentication headers into the correct $_SERVER
variables.
Since this part is completely independent from any Nextcloud
code it is now done as a first thing within the init() call.

Additionally similar issues could happen when another class
would boot too early and read other global PHP settings like
ini values and default timezone, so those are now also moved
to the beginning.

Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-03-10 06:59:49 +07:00
Côme Chilliet f033ef7c18 fix: Migrate all uses of OCP\Template to OCP\Template\ITemplateManager
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-03-06 15:49:25 +07:00
Côme Chilliet 71dc34c03c fix: Deprecate OC_Template, add proper template manager instead
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-03-06 15:49:25 +07:00
Stephan Orbaugh 3bc3d03048
Merge pull request #51000 from nextcloud/fix/federatedfilesharing/group-cleanup
fix(FederatedShareProvider): Delete external shares when groups are deleted or users removed from a group
2025-03-03 16:29:10 +07:00
provokateurin dd47daa4a8
fix(Share20): Convert broken hooks to IEventListener
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-03-03 12:49:01 +07:00
DaleBCooper e1e0b68feb Fix A+ rating when checking with Nextcloud Security Scan.
Due to commit 33d7019 session.cookie_secure=true is not set when accessing /status.php.
This results in a degration from A+ to A rating due to missing  __Host prefix for nc_sameSiteCookielax and nc_sameSiteCookiestrict cookies.
2025-03-02 11:33:13 +07:00
Côme Chilliet 34139987d6 fix: Replace OC_App calls by IAppManager
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-02-24 17:48:34 +07:00
Julius Knorr 8c69bf1219
Merge pull request #48738 from nextcloud/perf/log-high-memory-requests
perf: Log requests using high amount of memory as warning
2025-02-13 19:50:32 +07:00
Julius Knorr d31bc88a23
perf: Log requests using high amount of memory as warning
Signed-off-by: Julius Knorr <jus@bitgrid.net>
2025-02-13 13:43:10 +07: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 +07:00
Côme Chilliet b45bc2a462
fix: Use the new countUsersTotal method where it makes sense
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-01-14 12:38:02 +07:00
Git'Fellow 33d7019f58 fix(status): Avoid session creation for status requests
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2024-11-21 15:00:24 +07:00
Ferdinand Thiessen 0cd626a059
fix: Do not check for strict cookie when running webcron
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-11-07 16:34:10 +07:00
Julius Knorr 606241caeb
chore(legacy): Introduce public version ct plass and drop version methods from OC_Util
Signed-off-by: Julius Knorr <jus@bitgrid.net>
2024-09-20 14:53:34 +07: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 +07:00
Ferdinand Thiessen 9e979d42b4
fix(setup-checks): Ensure URL with webroot works
We basically mock the way `URLGenerator::getAbsoluteURL` works,
so we must make sure that the URL might already contain the webroot.
Because `baseURL` and `cliURL` also contain the webroot we need to remove
the webroot from the URL first.

Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Daniel <mail@danielkesselberg.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-09-13 13:06:24 +07:00
Maxence Lange 9100b8757e fix(setup): ignore long session login during installation
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2024-08-27 12:29:42 +07: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 +07:00