Commit graph

192 commits

Author SHA1 Message Date
Enjeck C
5d2f7918e9 fix: Make some strings in CodeIntegrity.php translatable
Signed-off-by: Enjeck C <patrathewhiz@gmail.com>
2025-08-26 22:03:58 +02:00
MichaIng
d10a87f85f feat(settings): simplify OPcache checks
For the overall OPcache size check, we currently compare used memory with free memory. However, `opcache.memory_consumption` is split into `used_memory`, `free_memory` and `wasted_memory`. When cached files change on disk, old entries are not replaced or removed, but remain as wasted memory, until the cache is actually full, and if their percentage is above `opcache.max_wasted_percentage`, which is 5% by default. When this happens, the engine is restarted, resetting the cache completely, like a `opcache_reset()` call.

As long as we do not consider wasted cache, recommendations based on free memory can be false. To solve this, we could count wasted memory as free memory, if it is above `opcache.max_wasted_percentage`, as the engine will be restarted as soon as needed, freeing up this wasted space. On the other hand, wasted memory below the threshold permanently blocks the OPcache, which supports counting it as used memory. Depending on the situation, instead of raising OPcache size, it could be also advised to reduce `opcache.max_wasted_percentage`. But too frequent cache resets break its purpose as well.

In my opinion, the matter is too complex to consider wasted cache correctly, and do precise recommendations, but we should focus on reducing false positives instead. What we know for sure is: if the cache is full (`$status['cache_full'] === true`), and the limit for cached keys has not been reached, the OPcache was too small to maintain free space, with wasted memory below the configured threshold, where it consumes memory permanently. Recommending to raise the OPcache size in this case, is hence as accurate as it gets. Even if 5% wasted cache could be freed, 95% used memory is still above the previous threshold for the setup check warning. And if `opcache.max_wasted_percentage` is above 5%, then the admin must have decided to change the default, deciding that system memory consumption has lower priority than preventing OPcache engine restarts.

`cache_full` can be true as well if the limit for cached keys has been reached, hence we need to merge both checks. In this case `num_cached_keys` equals `max_cached_keys` exactly, hence it is easy to differentiale whether `opcache.max_accelerated_files` or `opcache.memory_consumption` needs to be raised to address the `cache_full` state.

In practice, this change relaxes the checks: the respective limit needs to be reached 100% instead of 90%, to trigger a warning, eliminating also false alarms if a large share of the cache is consumed by wasted memory, which would be automatically freed once cache is 100% full.

Additionally, the recommendation for raising `opcache.max_accelerated_files` now says "a value higher than `max_cached_keys`", instead of "higher than `opcache.max_accelerated_files`". The actual limit, reflected by `max_cached_keys` from `opcache_get_status()`, [is a next higher value from a set of prime numbers](https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.max-accelerated-files). E.g. if `opcache.max_accelerated_files` is set to 10,000 (PHP default), the effective limit is 16,229 OPcache keys. Recommending "higher than 10000" could hence lead to a settings change without effect. For an effective change, the new value needs to be "higher than 16229" instead, which is what the setup check will show in this situation, with this change applied.

Signed-off-by: MichaIng <micha@dietpi.com>
2025-07-13 22:51:17 +02:00
Ferdinand Thiessen
4ebebae3bf fix(settings): use correct scope for translations
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-07-03 12:23:55 +02:00
rakekniven
4300c27333 chore(18n): More natural english - fix plural typo
Signed-off-by: rakekniven <2069590+rakekniven@users.noreply.github.com>
2025-05-26 10:10:15 +02:00
Joas Schilling
beefa6f411 fix(l10n): Fix one more plural
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-05-26 10:07:11 +02:00
Marcel Klehr
c50592ecdb fix: Correct translation method use
Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2025-05-26 10:07:03 +02:00
rakekniven
b6898dde7f fix(SetupChecks): Update TaskProcessingPickupSpeed
Signed-off-by: rakekniven <2069590+rakekniven@users.noreply.github.com>
2025-05-26 10:06:50 +02:00
rakekniven
d6a26bb4be chore(18n): More natural english
Reported at Transifex.

Signed-off-by: rakekniven <2069590+rakekniven@users.noreply.github.com>
2025-05-26 10:06:37 +02:00
Marcel Klehr
4a01d24295 feat(SetupChecks): Add check for TaskProcessing pickup speed
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2025-05-24 08:52:14 +00:00
Ferdinand Thiessen
ff172e178e fix(webauthn): do not require bcmath or gmp - not needed anymore
The extensions are not required anymore but only recommended for
performance. See also:
https://github.com/web-auth/webauthn-framework/issues/213

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-04-01 19:10:11 +02:00
Andy Scherzinger
7381387d24
Merge pull request #51091 from nextcloud/backport/51069/stable31
[stable31] Fix SQL query so that it is ansi safe fixing #51067
2025-03-04 21:47:29 +01:00
Johan Bernhardsson
ddebea24c2 fix: Change SQL query so that it is ansi safe
Signed-off-by: Johan Bernhardsson <johan.bernhardsson@redpill-linpro.com>
2025-02-27 09:01:17 +00:00
Joas Schilling
1a60bca362 fix(l10n): Improve english source strings
- No leading/trailing whitespace
- Use asci single quote

Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-02-26 13:08:49 +00:00
Joas Schilling
bfb3bd7d87 fix(setupcheck): Update setup check for PHP version to be more accurate
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-02-10 18:47:59 +00:00
Côme Chilliet
98b8912d74 fix(settings): Fix setup check when mail_smptmode is set to "null"
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-01-30 08:35:14 +00:00
Josh
5a8242feea fix(settings): Add some context to the PHP memory limit error
Signed-off-by: Josh <josh.t.richards@gmail.com>
2025-01-26 20:48:16 +00:00
Josh
92c603b082 fix(SetupChecks): Pass webfinger if a handler is there
Signed-off-by: Josh <josh.t.richards@gmail.com>
2025-01-26 14:37:05 +00:00
Git'Fellow
cd147cd1a3
fix(setupchecks): Binary data can have problems with serialize
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2025-01-09 23:42:07 +01:00
Josh
35cb5d84ca perf(settings): Speed up InternetConnectivity setup check
Specify default protocol (https://) rather than let default handling test both http:// and https://

Signed-off-by: Josh <josh.t.richards@gmail.com>
2025-01-07 16:49:28 -05:00
Joas Schilling
1bcc381e28
fix(setupcheck): Make the Memcache setupcheck use the cache
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-12-02 09:18:07 +01:00
skjnldsv
52020b5ea6 fix(settings): psalm PhpMaxFileSize setup check warning
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
2024-11-19 18:27:35 +00:00
skjnldsv
4a88848109 feat(settings): add big file upload setup checks
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
2024-11-19 16:43:41 +01:00
Ferdinand Thiessen
a3e80e4195
feat: Update supported PostgreSQL versions
12 is now EOL but 17 was released and should be supported and tested.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-11-13 02:50:13 +01:00
Benjamin Gaussorgues
46abfc6d50
Merge pull request #48792 from nextcloud/chore/update_mysql_setup_check_i18n 2024-11-05 10:06:29 +01:00
rakekniven
25d1628e30
chore(i18n): Fix grammar
Reported at Transifex

Signed-off-by: rakekniven <2069590+rakekniven@users.noreply.github.com>
2024-11-03 16:34:57 +01:00
Benjamin Gaussorgues
a40f21b4db chore(setupchecks): update translation for MySQL row format check
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2024-10-30 09:56:02 +01:00
Benjamin Gaussorgues
7e99fd31ea
Merge pull request #48547 from nextcloud/feat/row_format_check 2024-10-18 11:59:58 +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
Benjamin Gaussorgues
f70f70e0db
feat(setupchecks): add row format setup check for MySQL databases
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2024-10-08 17:13:30 +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
Josh Richards
e019eae347 fix(setupChecks): Having transactional file locking disabled is not supported
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
2024-09-19 12:50:59 +02:00
Ferdinand Thiessen
7fbd518452
feat: Make CheckServerResponseTrait public and provide as OCP\SetupCheck\CheckServerResponseTrait
This trait is used by other apps for creating setup checks,
so we should provide it instead apps using private API.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-09-16 14:58:21 +02:00
Joas Schilling
c7c031dbd2
fix(a11y): Add OTF font loading check
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-09-16 09:59:21 +02:00
Ferdinand Thiessen
be1cd7a308
refactor(settings): CheckServerResponseTrait always expect absolute path
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>
2024-09-13 13:09:40 +02: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 +02:00
Côme Chilliet
c224b8ced4
fix(setupchecks): Test overwrite.cli url first, then generated one, and
trusted domains as last fallback.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-09-05 11:54:45 +02:00
Daniel Kesselberg
4ce4d7b9b3
fix: add option to remove the webroot for setup checks and don't check trusted_domains.
1) The checks for well-known urls should always run against the root domain and therefore the option to remove the webroot.

2) For trusted domains, the available protocol is unknown, and thus some guesswork would be needed to make that work. I've decided for now to not consider them anymore to reduce false-positives.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-09-05 10:30:36 +02:00
Julius Härtl
f3419c5f57
feat(settings): Add setup check for apcu cache expunge
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2024-08-27 10:45:32 +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
Ferdinand Thiessen
0563757ea4 fix(SetupCheck): Properly check public access to data directory
When checking for public (web) access to the data directory the status is not enough
as you might have a webserver that forwards to e.g. a login page.
So instead check that the content of the file matches.

For this the `.ncdata` file (renamed from `.ocdata`¹) has minimal text content
to allow checking.

¹The file was renamed from the legacy `.ocdata`, there is a repair step to remove the old one.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-08-08 22:08:42 +02:00
Git'Fellow
4488714148
Merge pull request #46353 from nextcloud/skipOPcacheCLI
fix(setupchecks): Skip checking for OPcache settings if running checks from CLI
2024-08-01 20:02:25 +02:00
Joas Schilling
047479ccf9
feat(security): Add public API to allow validating IP Ranges and checking for "in range"
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2024-07-19 16:28:03 +02:00
Benjamin Gaussorgues
202e5b1e95
feat(security): restrict admin actions to IP ranges
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2024-07-19 16:28:03 +02:00
Anna Larch
2201bce7d3 fix(caldav): lower scheduling table size warning
Signed-off-by: Anna Larch <anna@nextcloud.com>
2024-07-17 11:20:49 +02:00
Git'Fellow
fa84f52c3f
fix: typo
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2024-07-08 15:11:35 +02:00
Git'Fellow
372c9d2ee6
fix: check both CLI and value
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2024-07-08 15:09:29 +02:00
Git'Fellow
39f052407a
fix(setupchecks): Skip checking for OPcache if running from CLI
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2024-07-08 10:43:20 +02:00
Ferdinand Thiessen
8fc498fb82
fix(IntegrityCheck): Ensure the check is run if no results are available
If there are no cached results the current implementation was also returning an empty array,
but this was the same as when there was a successful run.
So to distinguish this we return `null` if there are *no* results.
In this case we need to rerun the integrity checker.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-07-03 11:37:49 +02:00
Daniel
02983f3317
Merge pull request #46190 from nextcloud/bug/45047/skip-check-when-disk-free-space-disabled
fix(setupchecks): skip check when disk_free_space is disabled
2024-06-29 15:59:17 +02:00
Daniel Kesselberg
fd9fd1b6fb
fix(setupchecks): skip check when disk_free_space is disabled
Make it easier to discover that the check failed because disk_free_space is disabled.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-06-28 13:06:49 +02:00