Commit Graph

1161 Commits (master)

Author SHA1 Message Date
Julius Härtl 9e1d431255
Add config option to disable strict session timeout to be able to use read_and_close
Fixed https://github.com/nextcloud/server/issues/29356

Signed-off-by: Julius Härtl <jus@bitgrid.net>
2 years ago
Julius Härtl 9b4b72826a
Reopen sessions if we need to write to them instead of keeping them open
Sessions are a locking operation until we write close them, so close
them early and reopen later in case we want to write to them

Signed-off-by: Julius Härtl <jus@bitgrid.net>
2 years ago
Christoph Wurst d17e0699f3
Merge pull request #33173 from nextcloud/enhancement/maintenance-mode-http-header
Set special header for 503 maintenance mode
2 years ago
Christoph Wurst 0ed987a8dd
Set special header for 503 maintenance mode
This removes ambiguity with a 503 returned by app code, web server or
similar. Front-end and clients can then handle this state accordingly.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2 years ago
Christoph Wurst a1149b0378
Do not redirect if requested CSS can not be found
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2 years ago
Christoph Wurst 222a9523b5
Fix 404 handling of requested JSON/XML
If front-end or an application requests JSON/XML, there is no point in
redirecting to the default page if that response doesn't exist. In the
worst case that would just cause another request, therefore server load,
traffic and a response that is meaningless to the requester.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2 years ago
Joas Schilling 8e59d49701
Merge pull request #32435 from nextcloud/revert-32278-remove-default-php
Revert "Remove call to already default php.ini values"
2 years ago
Carl Schwan e4378fd18c
Merge pull request #32349 from nextcloud/enh/projects-event
Add event to load additional scripts for projects
2 years ago
Robin Appelman 83f831c263
Merge pull request #32427 from nextcloud/boot-event-ordering
reorder startup events to fix overlapping
2 years ago
Louis 8ed92ad4f7
Merge pull request #32216 from SUNET/master
Respect user settings in php.ini if they are big enough
2 years ago
Joas Schilling a6ca9d592d
Revert "Remove call to already default php.ini values" 2 years ago
Robin Appelman a67bf03ac0
reorder startup events to fix overlapping
current the `request` and `runtime` events overlap with the `init` event which makes it hard to create usefull visualizations.

this reorders things a bit to remove an overlap

Signed-off-by: Robin Appelman <robin@icewind.nl>
2 years ago
Micke Nordin 0ace1831f4
Fix suggestions by @artonage
Signed-off-by: Micke Nordin <kano@sunet.se>
2 years ago
Julius Härtl d3acf8203d
Properly import maintenance script
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2 years ago
Julius Härtl 9a6869943e
Introduce event for loading additional script on projects
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2 years ago
Git'Fellow f110ff9f4d
Remove default values
These values are already the default on supported PHP versions.
I suggest to remove these calls.
2 years ago
Mikael Nordin 30fe91a77f
Simpler version as proposed by @artonage
Co-authored-by: Louis <6653109+artonge@users.noreply.github.com>
Signed-off-by: Micke Nordin <kano@sunet.se>
2 years ago
Micke Nordin 259664468a
Respect user settings in php.ini if they are big enough
In the admin guide:
* https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html

it is mentioned that you can tweek:
* max_input_time
* max_execution_time

in order to enable larger file uploads. However, the current codebase
will hard code these values to one hour, no matter what the user sets in
php.ini.

This patch will allow the user to set these settings in php.ini and they
will be respected, if and only if, they are set to something bigger than
3600 seconds.

Signed-off-by: Micke Nordin <kano@sunet.se>
2 years ago
Carl Schwan 7d272c54d0 Add a built-in profiler inside Nextcloud
The webui is provided by a seperate application named profiler

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2 years ago
Joas Schilling 0acd4b5f82
Merge pull request #31235 from nextcloud/techdebt/noid/extract-request-id
Extract request id handling to dedicated class so it can be injected without DB dependency
2 years ago
Julius Härtl 2ff0c972c9
Merge pull request #31124 from nextcloud/enh/diagnostics-logging
Diagnostics event logging to log
2 years ago
Julius Härtl eede608c0e
Add event logging to app loading
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2 years ago
Côme Chilliet 63d7e7c798
Build OC\Core\Application when running occ or cron to register listeners correctly
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2 years ago
Joas Schilling 07a9f34385
Extract request id handling to dedicated class so it can be injected manually
Signed-off-by: Joas Schilling <coding@schilljs.com>
2 years ago
Pierre Ozoux e6d9ef2e38 Makes untrusted domain error a warning.
It sends a 400 to the client, so I could even argue that it should be an error.

But currently as an admin, I'm quiet surprised that I get a 400 in the UI, and nothing in the log with the default level.

I saw this commit that explains the reason why info. But I disagree.

Feel free to close the PR if you don't agree with it.

Signed-off-by: Pierre Ozoux <pierre@ozoux.net>
2 years ago
Louis Chemineau b46ff973e0 Use less deprecated methods in base.php
Signed-off-by: Louis Chemineau <louis@chmn.me>
2 years ago
Joas Schilling c8bfd8a559
Load core before the update script
Signed-off-by: Joas Schilling <coding@schilljs.com>
2 years ago
John Molakvoæ (skjnldsv) b664aad7ab
Move bundles to /dist
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2 years ago
Valdnet 03889d1297
l10n: Separate words
Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com>
2 years ago
Joas Schilling 03936d7762
Fix basic auth for OAuth token endpoint
Don't try to login when a client is trying to get a OAuth token.
OAuth needs to support basic auth too, so the login is not valid
inside Nextcloud and the Login exception would ruin it.

Signed-off-by: Joas Schilling <coding@schilljs.com>
3 years ago
Daniel Rudolf 4d7430949a
Remove usage of \OC_Util::getDefaultPageUrl() and \OC_Util::redirectToDefaultPage()
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
3 years ago
Gary Kim b78f3a57d1
Migrate HintException to OCP
Signed-off-by: Gary Kim <gary@garykim.dev>
3 years ago
Arthur Schiwon 638c04d6e0
accounts event handler to use eventdispatcher, DI and Accounts API
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
3 years ago
Joas Schilling cebfe4ba0e
Merge pull request #27190 from nextcloud/bugfix/noid/deduplicate-translation
Deduplicate translations and fix double .
3 years ago
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
3 years ago
Joas Schilling b4b2947248
Deduplicate translations and fix double .
Signed-off-by: Joas Schilling <coding@schilljs.com>
3 years ago
Christoph Wurst 6a5d89c1ac
Merge pull request #26758 from J0WI/more-strict
Some more strict_types
3 years ago
Joas Schilling 167efa19d7
Fix psalm errors
Signed-off-by: Joas Schilling <coding@schilljs.com>
3 years ago
J0WI a369933084 Fix ini_set() type
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
3 years ago
Joas Schilling f35d7adf7d
Don't hardcode the product name to Nextcloud but use the theming value
Signed-off-by: Joas Schilling <coding@schilljs.com>
3 years ago
Roeland Jago Douma d4d33e3095
Merge pull request #25238 from nextcloud/enh/noid/apps-defacto-in-root
Apps folder is defacto in root folder and not above
3 years ago
Morris Jobke d84e1f1951
Re-use fetched dependencies in lib/base.php
Reduces calls to DI container by reusing already fetched dependencies.

For status.php it went from 355 to 344.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
3 years ago
Morris Jobke 5b0e69828f
Apps folder is defacto in root folder and not above
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
3 years ago
Roeland Jago Douma d13f2d984f
Merge pull request #25015 from nextcloud/fix/no-double-intl-polyfill
Replace patchwork/utf8 with symfony-polyfill-*
3 years ago
Christoph Wurst 287c26bda3
Replace patchwork/utf8 with symfony-polyfill-*
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
3 years ago
Carlos Ferreira bc1b5d7892
Remove useless ini_set functions 3 years ago
Christoph Wurst d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Daniel Kesselberg 8ebd31d686
Make $vars and $secureRandom required.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
4 years ago
Christoph Wurst 3cf39c573f
Allow lazy app registration
During app installation we run migration steps. Those steps may use
services the app registers or classes from composer. Hence we have to
make sure the app runs through the registration.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Roeland Jago Douma 72a9c35be3
Remove some IRouter methods
This is not the end. IRouter needs to burn.
But it is a start.

🎵 we didn't start the fire 🎵

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
4 years ago
John Molakvoæ 3bacb4780b
Removed config.js 4 years ago
Roeland Jago Douma 48d843858d
Do not setup the default FS on normal routes
This should help with load times hopefully. Only initialize the FS if we
actually ned it.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
4 years ago
Joas Schilling f2541e7a8b
Use auto-wiring on most outer level
Signed-off-by: Joas Schilling <coding@schilljs.com>
4 years ago
Joas Schilling 4bc821edd9
PSR logger for accounts
Signed-off-by: Joas Schilling <coding@schilljs.com>
4 years ago
Christoph Wurst f464ef050b
Fix type errors detected by Psalm
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst d9015a8c94
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Joas Schilling b09620651c
Don't use deprecated getIniWrapper() anymore
Signed-off-by: Joas Schilling <coding@schilljs.com>
4 years ago
Morris Jobke 36ee37ec0a
Migrate OC_Group post_removeFromGroup hook to actual event object
Ref #14552

This adds a BeforeUserRemovedEvent to the LDAP backend because it was missing. It's not really before, but we don't have the before state.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
4 years ago
Joas Schilling 5993bd45f3
Correctly remove usergroup shares on removing group members
Signed-off-by: Joas Schilling <coding@schilljs.com>
4 years ago
Morris Jobke 8d2d051841
Remove hook for initSession
It's not used anyways and allowed to manipulate the state of the session. Also removed the code handling this.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
4 years ago
Christoph Wurst c5d2958ac7
Migrate Settings to new bootstrap mechanism
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst 69571fb536
Add dedicated API for apps' bootstrapping process
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Roeland Jago Douma 6aa6ab3e02
Add lazy events for the Node API
Right now if you want to get events via the Node API you have to have a
real instance of the Root. Which in turns sets up the whole FS.

We should make sure this is done lazy. Else enabling the preview
generator for example makes you setup the whole FS on each and every
authenticated call.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
4 years ago
Christoph Wurst 1584c9ae9c
Add visibility to all methods and position of static keyword
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst 44577e4345
Remove trailing and in between spaces
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst 42625a46be
Remove spaces after method or function call
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Arthur Schiwon e52442e26f
fixes the throttler not checking the user state on postLogin
a listener to the post login events can still reject a login, so that a
user is not necessarily available at the time.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
4 years ago
Roeland Jago Douma 19ca921676
Merge pull request #20241 from nextcloud/fix/license-headers-19
Update the license headers for Nextcloud 19
4 years ago
Christoph Wurst 1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
John Molakvoæ 82b0cd2e7a
Update base.php 4 years ago
John Molakvoæ 7eac19682c
Update base.php 4 years ago
Christoph Wurst b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Jose Quinteiro 6995e98df6 E_ALL already sets E_DEPRECATED
Signed-off-by: Jose Quinteiro <github@quinteiro.org>
4 years ago
Jose Quinteiro 6cf679e04e Set error_logging correctly. Fixes #19847
Don't override the error_logging setting from php.ini unless we're
debugging.

Signed-off-by: Jose Quinteiro <github@quinteiro.org>
4 years ago
Daniel Kesselberg 56efd687ab
Check that username and password are present.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
4 years ago
Julius Härtl d05f131929
Move overwritehost check to isTrustedDomain
Signed-off-by: Julius Härtl <jus@bitgrid.net>
5 years ago
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
Christoph Wurst f6a79338d4
Make sure we create an app's Application class just once
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
Christoph Wurst de6940352a Move settings to an app
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
5 years ago
Joas Schilling e53d5b2dbe
Print plain error when the error page errors too
Signed-off-by: Joas Schilling <coding@schilljs.com>
5 years ago
Greta Doci 5898e87e0f Remove deleted groups from app restrictions fixes #15823
Signed-off-by: Greta Doci <gretadoci@gmail.com>
5 years ago
Christoph Wurst 0cfcccee29
Migrate the maintenance script to a modern module and bundle
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
Joas Schilling de22bd618c
Fix placeholder in disable message
Signed-off-by: Joas Schilling <coding@schilljs.com>
5 years ago
Joas Schilling 752276fd89
Add a listener for the events
Signed-off-by: Joas Schilling <coding@schilljs.com>
5 years ago
Morris Jobke ebbe8aad89
Remove not used appinfo/classpath.php check
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
5 years ago
Joas Schilling 0c77cd21f9
Make sure maintenance mode is always casted to bool
Signed-off-by: Joas Schilling <coding@schilljs.com>
5 years ago
Joas Schilling bb352fb667
Use the defined func()->count() instead of manual counting
Signed-off-by: Joas Schilling <coding@schilljs.com>
6 years ago
Joas Schilling 40d185e928
Revert "Use APCu caching of composer"
This reverts commit 948ab8a4d0.

For details why see https://github.com/nextcloud/server/issues/11290
6 years ago
MartB fe21b10de5 replace setcookie value with '' instead of null.
The php documentation states that an empty string should be used for a cookie when it has no real value.
null leads to the following error: expects parameter 2 to be string, null given

Signed-off-by: Martin Böh <mart.b@outlook.de>
6 years ago
Morris Jobke a9b8fb090c
Fix remnants of refactoring
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
Morris Jobke b0a296e2e1
Do not use HTTP code OC_Response constants anymore
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
Morris Jobke 79d9841bce
Replace hardcoded status headers with calls to http_response_code()
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
Morris Jobke 1399f6bece
Server exception error pages by default with a 500 status code
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
Morris Jobke 8c155cd51c
Server error/hint pages with a 500 error code to avoid it being seen instead of the actual resource
* found while reviewing #7205
* allow to specify a special status code

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
Eric Masseran a34f70ce0a
Change status code when config is write protected
Add hint msg, you can make config file read only

If the config.php is not writable, print an error message: #6893
 - set config writable
 - or set option to keep it read only

Signed-off-by: Eric Masseran <rico.masseran@gmail.com>
6 years ago
jaltek c79dc0e08f
Configurable list for opt out from same site cookie protection
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Roeland Jago Douma 948ab8a4d0
Use APCu caching of composer
Should potentially shave of a few ms when loading classes of apps that
don't ship their own autoloader.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Arthur Schiwon 38a90130ce
move log constants to ILogger
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
6 years ago
Morris Jobke 0d5142be70
Show a link to the docs instead of a button on the untrusted domain page
Before there was a button to "quickly" add the untrusted domain to the config. This button often didn't worked, because the generated URL was often untrusted as well. Thus removing it and providing proper docs seems to be the better approach to handle this rare case.

Also the log should not be spammed by messages for the untrusted domain accesses, because they are user related and not necessarily an administrative issue.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago