Commit graph

1151 commits

Author SHA1 Message Date
Joas Schilling
e101a3dcca 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 11:30:00 +00:00
Côme Chilliet
0c310dc946 fix: Fix default values for ini var in lib/base.php
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-30 10:11:15 +00:00
Arthur Schiwon
3304b0371b fix(autoloader): no apcu no side effects
apcu lead to side effects especially with app management and (soft)
inter-dependencies, and lead also to 500 server errors. While we could
add management to clear apcu cache in many cases (may stil leave edge
cases) the performance benefit is marginally as also class maps are
already cached in opcache. Hence, the simple and effective way to go is
to not use apcu for autoloading.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-09-08 18:30:40 +00:00
Alexander Piskun
89cca0cd7c new name of AppEcosystem is AppAPI
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2023-09-07 05:32:20 +00:00
Andrey Borysenko
c2a8280743 Fix psalm ci (stub). Wrap server container with try-catch
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
2023-08-11 01:37:01 +02:00
Alexander Piskun
ebf21bed51 added Application Ecosystem V2 login handler
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2023-08-11 01:37:01 +02:00
Joas Schilling
227497705e
fix(apps): Fix loading info.xml file
Ref: https://bugs.php.net/bug.php?id=62577

Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-20 10:45:58 +02:00
Simon L
c5b43a4302 allow to specify upgrade.cli-upgrade-link in order to link to the correct documentation
Signed-off-by: Simon L <szaimen@e.mail.de>
2023-06-12 11:36:29 +00:00
Simon L
d293293cda Fixed bug which 'overwritewebroot' does not work with 'overwritecondaddr'.
Signed-off-by: Takahiro Nagai <78393959+takahiro-blab@users.noreply.github.com>
Signed-off-by: Simon L <szaimen@e.mail.de>
2023-05-16 11:39:39 +02:00
Simon L
84b88c01c7 adjust wording
Signed-off-by: Simon L <szaimen@e.mail.de>
2023-05-09 11:19:48 +02:00
Simon L
6e5a307757 adjust wording for update hint when files of a specific app are not there
Signed-off-by: Simon L <szaimen@e.mail.de>
2023-05-09 10:56:02 +02:00
Arthur Schiwon
bb4b34ff69 Read mtime of version.php only once
- in most cases it would read again in \OC_Util::loadVersion anyway
- remove some unused use statements

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-04-21 14:10:47 +00:00
Arthur Schiwon
7519949f37 add the server roots and version info hash to apcu prefix
fixes collissions when more than one instance is running on the same
system

For the memcaches we use a more complex prefix, where version and
instance ID are incorporated. We do not have this data at hand at this
point of time. But we can get the mtime of the version.php file
relatively cheap.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-04-21 14:10:46 +00:00
Côme Chilliet
b294edad80
Merge branch 'master' into enh/type-iconfig-getter-calls
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2023-04-20 16:52:38 +02:00
Christoph Wurst
a06898a2d0 fix(security)!: Use consistent HTTP status for strict cookie checks
Before: 503/412
Now: 412 + json body explaining the error

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-04-17 16:06:37 +00:00
Maxence Lange
fc29b0d1b7 app type extended_authentication
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2023-04-12 09:34:49 -01:00
Côme Chilliet
426c0341ff
Use typed version of IConfig::getSystemValue as much as possible
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-05 12:50:08 +02:00
Julius Härtl
c3a39cbc75
Merge pull request #37305 from nextcloud/fix/security/log-failing-strict-cookie-check
fix(security): Log failing strict cookie check
2023-03-21 19:05:39 +01:00
Joas Schilling
705165d3d1
fix(session): Fix DAVx5 sync problems by partial reverting session changes
Temporary disabled the short cut again to solve issues with CalDAV/CardDAV
clients like DAVx5 that use cookies and need a session. See
https://github.com/nextcloud/server/issues/37277#issuecomment-1476366147
and the other comments for further information.

Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-03-20 16:30:42 +01:00
Christoph Wurst
0e6fccf9e1
fix(security): Log failing strict cookie check
The error is silent otherwise and makes it very hard to debug on a
production system.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-03-20 16:26:41 +01:00
Julius Härtl
bbc6eee803
fix: Avoid log spam on 404 routes not using GET
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-03-03 09:40:43 +01:00
Joas Schilling
98ed72b3ed
Revert "fix(performance): Do not set up filesystem on every call" 2023-02-21 07:36:43 +01:00
Anna Larch
5d4efb4d5f
Do not set up filesystem on every call
Also remove old Oc_FileChunking logis that produced GC- collectable chunks

Signed-off-by: Anna Larch <anna@nextcloud.com>
2023-02-17 19:18:37 +01:00
Julien Veyssier
6431c5a559
extend the reference API for the new link picker
- add 2 interfaces for discoverable and searchable reference providers
- new OCS route to get info on discoverable/searchable reference providers
- new abstract ADiscoverableReferenceProvider that only implements jsonSerialize
- listen to RenderReferenceEvent to inject provider list with initial state

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2023-01-27 11:10:55 +01:00
Julius Härtl
842f4d530f
fix(session): Always setup the session if a session cookie is passed
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-12-22 11:33:23 +01:00
Julius Härtl
6abb37317f
Do not setup a session when not required on WebDAV requests
If basic auth is used on WebDAV endpoints, we will not setup a session
by default but instead set a test cookie. Clients which handle session
cookies properly will send back the cookie then on the second request
and a session will be initialized which can be resued for
authentication.

Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-12-21 21:17:16 +01:00
Côme Chilliet
a529aa79d8 Strong type singletons from lib/base.php
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-19 09:10:41 +00:00
Côme Chilliet
e1d324f7eb Migrate lib/base.php to LoggerInterface
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-19 09:10:40 +00:00
Côme Chilliet
26d75add8f Put back cast to string now that timelimit is an int
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-19 09:10:40 +00:00
Côme Chilliet
7372da6c6d Fixing more psalm errors from lib/base.php
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-19 09:10:40 +00:00
Côme Chilliet
444811b0fe Use Server::get some more
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-19 09:10:40 +00:00
Côme Chilliet
cf508c1e47 Use strict typing in base.php
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-19 09:10:40 +00:00
Julius Härtl
be4c061b75
Set apcu prefix for composer
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-12-07 22:32:06 +01:00
Christoph Wurst
052dcdebe8
Refactor the ErrorHandler into a dynamic class
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2022-11-02 09:49:37 +01:00
Julius Härtl
11bedf1c3b
Use proper error pages instead of always redirecting
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-10-21 15:12:21 +02:00
Simon L
f97f13b136
Merge pull request #33737 from andyxheli/patch-4
Makes untrusted domain error on info
2022-10-01 18:06:44 +02:00
Arthur Schiwon
9b7ef2962e
remove listeners to OC_Filesystem::(write|rename) old style hooks
- the events are not emitted anymore
- OC_Filesystem::isBlacklisted() is not called from anywhere else

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-09-26 21:07:08 +02:00
Julius Härtl
80f6a5834a
Refactor cache handling
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-08-31 16:24:35 +02:00
Andy Xheli
12c8123873
Makes untrusted domain error on info
Signed-off-by: Andy Xheli <axheli@axtsolutions.com>

Since e6d9ef2e38 was applied logs get filled up with Trusted domain error. "X.X.X.X tried to access using "X.X.X.X" as host alot of users missed important errors do toe6d9ef2e38   please see https://github.com/nextcloud/server/issues/32599

This should fix. 
https://github.com/nextcloud/server/issues/32599#event-7281164903


Signed-off-by: Andy Xheli <axheli@axtsolutions.com>
2022-08-29 13:27:12 -05:00
Julius Härtl
1b43fbe06c
Move setting of gc_maxlifetime to initSession
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-08-17 12:10:27 +02:00
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>
2022-08-17 12:10:27 +02:00
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>
2022-08-17 12:10:26 +02:00
Christoph Wurst
d17e0699f3
Merge pull request #33173 from nextcloud/enhancement/maintenance-mode-http-header
Set special header for 503 maintenance mode
2022-08-10 09:16:02 +02:00
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>
2022-08-08 14:26:11 +02:00
Christoph Wurst
a1149b0378
Do not redirect if requested CSS can not be found
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2022-08-08 14:09:58 +02:00
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>
2022-07-08 19:14:05 +02:00
Joas Schilling
8e59d49701
Merge pull request #32435 from nextcloud/revert-32278-remove-default-php
Revert "Remove call to already default php.ini values"
2022-06-03 14:16:24 +02:00
Carl Schwan
e4378fd18c
Merge pull request #32349 from nextcloud/enh/projects-event
Add event to load additional scripts for projects
2022-05-27 18:36:40 +02:00
Robin Appelman
83f831c263
Merge pull request #32427 from nextcloud/boot-event-ordering
reorder startup events to fix overlapping
2022-05-17 11:55:00 +00:00
Louis
8ed92ad4f7
Merge pull request #32216 from SUNET/master
Respect user settings in php.ini if they are big enough
2022-05-17 10:14:56 +02:00