Commit graph

19792 commits

Author SHA1 Message Date
Joas Schilling
551e1a799a
Merge pull request #30486 from nextcloud/backport/29780/stable23
[stable23] Run migrations fully when reenabling an app
2022-01-07 08:43:14 +01:00
Joas Schilling
e69d0b0a65 Run migrations fully when reenabling an app
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-04 16:19:35 +00:00
MichaIng
022d0058ca [stable23] Remove iconv from dependencies and tests
which is not used anymore since: https://github.com/nextcloud/server/pull/29470

Signed-off-by: MichaIng <micha@dietpi.com>
2022-01-04 03:06:55 +01:00
Joas Schilling
b947bf3765
Merge pull request #30026 from nextcloud/backport/30013/stable23
[stable23] Don't query the bruteforce attempts when we just deleted them
2021-12-21 09:38:20 +01:00
Azul
26886d753d fix translation source in directEditing templates
The 'Empty file' string is translated in `lib` - not in `core`.

Signed-off-by: Azul <azul@riseup.net>
2021-12-16 18:23:12 +00:00
Christopher Ng
7479edbc1e Migrate profile_config id column to bigint
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2021-12-15 19:30:15 +00:00
MichaIng
a31ee8d9f3
Merge pull request #30236 from nextcloud/backport/30200/stable23
[stable23] Don't check the configvalue for lastLogin which is never null
2021-12-13 15:20:40 +01:00
Joas Schilling
dd2c1c6fb8
Make psalm more happy
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-13 13:49:15 +01:00
Joas Schilling
39d6624ab3
Fix docs to make Psalm happier
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-13 13:49:09 +01:00
Joas Schilling
955c0d4885
Convert strict_search to wildcard property and add psalm docs
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-13 13:49:03 +01:00
Joas Schilling
898c11c3b4
Limit more contact searches
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-13 13:48:55 +01:00
Joas Schilling
daad1ce010
Only limit search in the system address book
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-13 13:48:47 +01:00
Joas Schilling
b5d78d0b7c
Only wildcard search if enumeration is allowed
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-13 13:48:41 +01:00
Joas Schilling
995b45bb62 Don't check the configvalue for lastLogin which is never null
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-13 08:43:13 +00:00
Vincent Petry
1fc27e771c
Merge pull request #30180 from nextcloud/backport/30160/stable23
[stable23] Check resource before closing in encryption wrapper
2021-12-10 08:55:50 +01:00
Vincent Petry
1291abc130 Check resource before closing in encryption wrapper
In case of error there is no guarantee that $source or $target is set or
is a resource when handling an error.

Without this fix, there's a risk that fclose will fail and the actual
exception will not be thrown, making it impossible to find out about the
root cause.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-12-10 00:03:08 +00:00
Christopher Ng
3600b84e6e Fix relation "user_id" already exists migration error
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2021-12-09 23:07:30 +00:00
Côme Chilliet
f889b251b1 Avoid assignment in if clause
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-06 14:22:05 +00:00
Côme Chilliet
3fe20bfbbb Fix typing problems in OC_Image
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-06 14:22:05 +00:00
Côme Chilliet
11b51ddbbe Avoid calling image* methods on boolean
This avoids fatal errors on PHP>=8, and warnings on older versions.
Log should also be clearer.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-06 14:22:05 +00:00
Christoph Wurst
f88f57612b
Merge pull request #30025 from nextcloud/backport/30012/stable23
[stable23] Only check the twofactor state once per request
2021-12-06 14:49:45 +01:00
blizzz
76fa257789
Merge pull request #30036 from nextcloud/backport/30011/stable23
[stable23] Allow to log queries to db, ldap and redis
2021-12-03 11:53:59 +01:00
Robin Appelman
349555478f code checker fixes for instanceOfStorage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-12-02 17:47:06 +00:00
Robin Appelman
c9db02a921 background scan the source storage when a background scan on a storage jail is triggered
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-12-02 17:47:05 +00:00
Robin Appelman
4433732f22 teach psalm about Storage::instanceOfStorage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-12-02 17:47:05 +00:00
Joas Schilling
a361e69d5e Fix log_query config flag
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-02 09:35:52 +00:00
Joas Schilling
5e8fa37852 Allow to log DB, redis and LDAP requests into files
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-02 09:30:44 +00:00
Joas Schilling
761b5ac91e Don't query the bruteforce attempts when we just deleted them
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-01 20:29:47 +00:00
Joas Schilling
febca701ee Only check the twofactor state once per request
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-01 20:29:28 +00:00
blizzz
4caad84389
Merge pull request #29967 from nextcloud/backport/29917/stable23
[stable23] Fix source of translations
2021-11-30 14:55:23 +01:00
Christoph Wurst
3b2122fc11 Include previous execption for repair steps that don't exist
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-11-30 11:56:53 +00:00
Christoph Wurst
3d58f6bd2b Let repair step query exceptions bubble up
And hide the type error caused by a constructor call with missing
arguments.

`new $repairStep();` only works for the rare case that no arguments are
required. Anything else will throw. Then we previously hid the trace of
the more important query exception.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-11-30 11:56:53 +00:00
Christopher Ng
3256de61a1 Fix source of translations
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2021-11-29 18:51:33 +00:00
Christoph Wurst
96aaa5dfa2 Interpolate the log message also for logged exceptions
According to PSR-3 the log message can have placeholders that are
replaced from the context object. Our logger implementation did that for
all PSR-3 logger methods. The only exception was our custom `logException`.

Since PsrLoggerAdapter calls logException when an exception key is
present in the context object, log messages were no longer interpolated.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-11-29 15:48:43 +00:00
Arthur Schiwon
09014ec6d1 Obey col length of 255 to insert and search in accounts_data
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-11-26 17:27:16 +00:00
Arthur Schiwon
c853206e8a add method to shorten a string to given byte size to Utils
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-11-26 17:27:16 +00:00
Carl Schwan
9275a9f28a
Merge pull request #29913 from nextcloud/backport/29906/stable23
[stable23] Use strict comparison to detect usage of redis cluster
2021-11-26 11:16:15 +01:00
Louis Chemineau
3f0cff6667 Use strict comparison to detect usage of redis cluster
Signed-off-by: Louis Chemineau <louis@chmn.me>
2021-11-25 18:57:35 +00:00
Christopher Ng
608cf4a592 Fix inactive profile parameters being returned
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2021-11-25 16:28:34 +00:00
MichaIng
e3de5140b6
Merge pull request #29800 from nextcloud/backport/29632/stable23
[stable23] fix imagecreatetruecolor() error
2021-11-25 17:13:34 +01:00
Joas Schilling
4736bba7f6 Check for invalid characters before trimming
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-25 11:49:54 +00:00
szaimen
ce69760500 fix imagecreatetruecolor() error
Signed-off-by: szaimen <szaimen@e.mail.de>
2021-11-23 14:26:26 +00:00
Vincent Petry
6ffd6b2dee Type hint in IpAddress
Signed-off-by: Vincent Petry <vincent@nextcloud.com>

Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2021-11-23 10:23:02 +00:00
Vincent Petry
e7890cc401 Improve normalizer detecting IPv4 inside of IPv6
The subnet for an IPv4 address inside of IPv6 is now returned in its
IPv4 form.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-11-23 10:23:02 +00:00
Vincent Petry
e98ee218be Fix getting subnet of ipv4 mapped ipv6 addresses
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-11-23 10:23:00 +00:00
Christoph Wurst
0afe44c449 Do not print verbose info about app updates if there are none
This is cosmetical but if you have a large number of apps installed then
you'll see a wall of text during the server and app upgrade when it
tries to update each app via the app store. In may cases nothing will be
updated. For those boring cases we can hide the verbose info, but show
when occ is run with -v. Any actual update will still print a few lines.
Those are the important ones for the admin.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-11-22 02:24:59 +00:00
Vincent Petry
f0661de4e5 Normalize directory entries in Encoding wrapper
Directory entry file names are now normalized in getMetaData(),
getDirectoryContents() and opendir().

This makes the scanner work properly as it assumes pre-normalized names.

In case the names were not normalized, the scanner will now skip the
entries and display a warning when applicable.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-11-19 14:51:38 +00:00
Vincent Petry
516b10de33 Move storage encoding compatibility warning logic
The encoding check for file names is now happening the Scanner, and an
event will be emitted only if the storage doesn't contain the encoding
compatibility wrapper.

The event is listened to by the occ scan command to be able to display a
warning in case of file name mismatches when they have NFD encoding.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-11-19 14:51:38 +00:00
Vincent Petry
106950d493 Normalize file name before existence check in scanner
The scanner would not find a NFD-encoded file name in an
existing file list that is normalized.

This normalizes the file name before scanning.

Fixes issues where scanning repeatedly would make NFD files flicker in
and out of existence in the file cache.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-11-19 14:51:38 +00:00
Daniel Calviño Sánchez
8ff4870026 Allow to serve static WebAssembly and TensorFlow Lite files
Since Talk 13 (and thus Nextcloud 23) WebAssembly (.wasm) and TensorFlow
Lite (.tflite) files need to be loaded from the web server to provide
certain features (like the background blur in the WebUI).

Those files can be treated in a similar way to other static resources,
and there should not be any problem caching or compressing them.
However, as compressed TensorFlow Lite files are only ~12% smaller,
the compression directive depends on the MIME type and there is no
standard MIME type for TensorFlow Lite files it is not worth to compress
them.

Moreover, no directives to compress WebAssembly files were added either,
as it seems that they would override any other compression directives
set in the default server configuration; for reference it could be done
with something like:
<IfModule mod_deflate.c>
  <IfModule mod_filter.c>
    AddOutputFilterByType DEFLATE application/wasm
  </IfModule>
</IfModule>

Depending on the setup "application/wasm" may not be associated with
".wasm" files, so the directive was added just in case, as otherwise
browsers log a warning.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-11-17 14:11:52 +00:00