Commit graph

9761 commits

Author SHA1 Message Date
korelstar
ae92f3301f fix: file quota was not applied in all cases 2020-09-17 07:13:31 +00:00
Roeland Jago Douma
dd9d932ac0 Only disable zip64 if the size is known
Else we might run into the issue that for an external storage where the
size is not known yet we do not use zip64. Which then of course fails on
large zip files.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-09-01 13:46:55 +00:00
Roeland Jago Douma
0eeb1ea115 Only update the filecache entry once the file has been written to S3
If we already update before we have no way to revert if the upload
fails.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-08-31 17:08:44 +00:00
Roeland Jago Douma
e2219b8e4d Don't lose filecache entry on s3 overwrite error
If the object store errors we should not always delete the filecache
entry. As this might lead to people losing access to their files.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-08-31 17:08:41 +00:00
Robin Appelman
76e415a75c ensure home storage is initialized on first setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-09 20:19:05 +02:00
Roeland Jago Douma
d587d5f847 Use the correct mountpoint to calculate
If we use the owners mount point this results in null. And then the rest
of the checks get called with null. Which doesn't work.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-07-09 12:33:38 +00:00
Morris Jobke
1af1d31bb3
Merge pull request #21498 from lmamane/stable17-21285-oneliner
fix #21285 as oneliner
2020-07-07 15:27:21 +02:00
Roeland Jago Douma
a6c1ef73c3
Merge pull request #21669 from nextcloud/revert-21097-backport/21090/stable17
Revert "[stable17] Do not read certificate bundle from data dir by de…
2020-07-06 10:38:36 +02:00
Roeland Jago Douma
ca2f401cf8
Merge pull request #21389 from nextcloud/backport/21380/stable17
[stable17] Increase timeout of the appstore requests
2020-07-04 08:54:57 +02:00
Roeland Jago Douma
7377015d4e
Revert "[stable17] Do not read certificate bundle from data dir by default" 2020-07-03 14:20:55 +02:00
Joas Schilling
a1b1f8014e
Increase timeout of the appstore requests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-07-03 10:12:52 +02:00
Roeland Jago Douma
66e39f4cfa
Merge pull request #21552 from nextcloud/backport/21535/stable17
[stable17] Fix language in share notes email for users
2020-07-02 21:00:25 +02:00
Joas Schilling
5951aeb501 Fix IPv6 remote addresses from X_FORWARDED_FOR headers before validating
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-07-02 10:09:47 +00:00
Joas Schilling
046fdc4045
Fix language in share notes email for users
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-06-24 09:11:25 +02:00
Lionel Elie Mamane
f7f053b101 Return correct loginname in credentials,
even when token is invalid or has no password.

Returning the uid as loginname is wrong, and leads to problems when
these differ. E.g. the getapppassword API was creating app token with
the uid as loginname. In a scenario with external authentication (such
as LDAP), these tokens were then invalidated next time their underlying
password was checked, and systematically ceased to function.

Signed-off-by: Lionel Elie Mamane <lionel@mamane.lu>
2020-06-20 11:48:44 +02:00
Joas Schilling
189b98fb46 Don't log Keys
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-06-19 13:15:48 +00:00
Joas Schilling
0c408a8119
Merge pull request #21158 from nextcloud/backport/21143/stable17-fix-password-changes-in-link-and-mail-shares
[stable17] Fix password changes in link and mail shares
2020-06-08 19:23:56 +02:00
Joas Schilling
503019f502 Prevent harder to share your root
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-06-04 09:06:25 +00:00
Daniel Calviño Sánchez
f6bcabb632 Fix disabling send password by Talk without new password in mail shares
When "send password by Talk" was disabled in a mail share it was
possible to keep the same password as before, as it does not pose any
security issue (unlike keeping it when "send password by Talk" is
enabled, as in that case the password was already disclosed by mail).

However, if a mail share is updated but the password is not set again
only the hashed password will be available. In that case it would not
make sense to send the password by mail, so now the password must be
changed when disabling "send password by Talk".

Note that, even if explicitly setting the same password again along with
the "send password by Talk" property would work, this was also prevented
for simplicity.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-06-01 10:53:23 +02:00
Daniel Calviño Sánchez
4e311747a2 Fix enabling send password by Talk with same password in mail shares
When "send password by Talk" is enabled in a mail share a new password
must be also set. However, when the passwords of the original and the
new share were compared it was not taken into account that the original
password is now hashed, while the new one is not (unless no new password
was sent, in which case the password of the original share was set in
the new share by the controller, but that was already prevented due to
both passwords being literally the same), so it was possible to set the
same password again.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-06-01 10:53:23 +02:00
Daniel Calviño Sánchez
d04000232c Fix enabling send password by Talk with empty password in link shares
When "send password by Talk" is enabled in a link share now a non empty
password is enforced.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-06-01 10:53:23 +02:00
Roeland Jago Douma
913ce60dc3
Merge pull request #21110 from nextcloud/backport/19793/stable17
[stable17] Fix resharing of federated shares that were created out of links
2020-05-28 16:19:50 +02:00
Julius Härtl
f50bf10bec
Link shares have reshare permission if outgoing federated shares are enabled
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-05-26 11:34:05 +02:00
Morris Jobke
4257de3b17 Do not read certificate bundle from data dir by default
Before the resources/config/ca-bundle.crt was only used when the list of custom
certificates was empty and the instance was not installed. But it should also
be used when the list is empty and the instance is installed.

This is inverting the logic to stop if the instance is not installed to use the
default bundle. And it also does this when the list is empty.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-05-25 17:55:55 +00:00
Morris Jobke
27486cfd55
Merge pull request #20966 from nextcloud/backport/20033/stable17
[stable17] Enable fseek for files in S3 storage
2020-05-25 13:47:29 +02:00
Robin Appelman
e471c37b9b
harden seekable http stream a bit against failures
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-05-22 15:31:23 +02:00
Robin Appelman
44ea3b843a
update autoloader
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-05-22 15:31:13 +02:00
Robin Appelman
23560884e6
add basic tests for s3 seeking and add some error handling if reopen return the wrong range
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-05-22 15:31:10 +02:00
Robin Appelman
2ecf23a4dc
make seekable s3 stream generic
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-05-22 15:31:06 +02:00
Lukas Stabe
4611577ffa
Enable fseek for files in S3 storage
Signed-off-by: Lukas Stabe <lukas@stabe.de>
2020-05-22 15:31:02 +02:00
Morris Jobke
2e41b6f83c
Compress the appstore requests by default
In test it reduced the transfered data from 5 MB to 2 MB. This should reduce the load on the appstore significantly.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-05-20 11:19:42 +02:00
Morris Jobke
8b2d609a6a
Cache appstore requests for 60 instead of 5 minutes
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-05-20 11:19:42 +02:00
Roeland Jago Douma
3c7cd001cd
Merge pull request #20925 from nextcloud/backport/20915/stable17
[stable17] Use random_bytes
2020-05-11 21:00:39 +02:00
Roeland Jago Douma
8fabe71710 Use random_bytes
Since we don't care if it is human readbale.
The code is backwards compatible with the old format.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-05-11 12:27:06 +00:00
Robin Appelman
8a027c3fb3 dont try to update storage mtime if we can't get the mtime
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-05-01 16:22:59 +00:00
MichaIng
c9ce1197c4 Fix Argon2 options checks
The minimum for memory cost is 8 KiB per thread. Threads must be checked and set first to allow checking against the correct memory cost mimimum.
Options are now applied the following way:
- If config.php contains the setting with an integer higher or equal to the minimum, it is applied.
- If config.php contains the setting with an integer lower than the minimum, the minimum is applied.
- If config.php does not contain the setting or with no integer value, the PHP default is applied.

Signed-off-by: MichaIng <micha@dietpi.com>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-05-01 09:39:03 +00:00
Tekhnee
00e7d079c8 Adhere to EMailTemplate interface in constructor call.
Email creation appears to have been refactored lately but it looks like custom template-based emails were left out.

Signed-off-by: Tekhnee <info@tekhnee.org>
2020-04-27 09:14:22 +00:00
Roeland Jago Douma
bdcaff0f48
Merge pull request #20513 from nextcloud/backport/20246/stable17
[stable17] Provide the proper language to the mailer
2020-04-20 22:32:41 +02:00
Roeland Jago Douma
1fa8a8e484
Provide the proper language to the mailer
Else we can't properly translate the footer in the recipients e-mail
language.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-04-20 22:21:19 +02:00
Arthur Schiwon
e7754ddb2c fix credentialsManager documentation and ensure userId to be used as string
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-04-16 09:56:25 +00:00
Roeland Jago Douma
20b11b8beb
Merge pull request #20494 from nextcloud/backport/20361/stable17
[stable17] Close the streams in `writeStream` even when there is an exception
2020-04-15 21:12:25 +02:00
Robin Appelman
f72a44525a Close the streams in writeStream even when there is an exception
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-04-15 08:51:39 +00:00
Joas Schilling
58d5e89898 Handle unset owner in sharing
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-04-14 18:37:18 +00:00
Morris Jobke
d29658f046
Merge pull request #20164 from nextcloud/backport/19782/stable17
[stable17] Use global used space in quota wrappen when external storage is included
2020-04-14 13:59:48 +02:00
Robin Appelman
f857acf4ab Dont always use the current users quota when calculating storage info
instead pass the quota as parameter.

Without this fix, when 'quota_include_external_storage' is enabled, the
webui will show the quota configured for the admin for every user
instead of the users quota

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-04-01 12:26:35 +00:00
Roeland Jago Douma
5850d3ec30 Actually check if the owner is not null
Else this can error out on storages that do not have an owner (e.g.
groupfolders).

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-03-27 13:51:55 +00:00
Joas Schilling
6bcd0975d0 Check the user on remote wipe
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-03-25 15:50:27 +00:00
Robin Appelman
7e55adcdf7 Use global used space in quota wrappen when external storage is included
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-03-25 13:19:01 +00:00
Julius Härtl
f10b650381 Remove admin_notifications since it is obsolete since Nextcloud 14
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-03-24 13:57:32 +00:00
Roeland Jago Douma
b0808d06ef Update the target when it isempty after sharing
Hooks that listen to it (audit log) benefit from having the target
properly set.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-03-18 12:39:07 +00:00