Uh oh!
There was an error while loading. Please reload this page.
add uploads_path param - #38587
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
daf4334 to
20159b2Comparetanganellilore
commented
Jun 2, 2023
Recommit with correct approach suggested in last comment of #38506 from @icewind1991. Path now it's splitted from |
kesselb
commented
Jun 2, 2023
I don't think we suggested introducing another configuration option. The feature you are looking for is already there. Would you mind explaining why you need to separate uploads and cache? Did you run into problems? |
tanganellilore
commented
Jun 2, 2023
My only concern is to have a clear segmentation of folder/mountpoint/disk associated. Moreover we can decide to use a different mount point in different path, associated to different disk (and size). But this is an idea/features, and I notice only after my PR and reading code that |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
489089d to
0490ba1Comparekesselb
commented
Jun 6, 2023
Does it work? If cache_path === uploads_path the expected /uploads/ subfolder is created in the cache_path block. But if you define a different uploads_path (not inside the cache_path) who is going to create the uploads subfolder for the user? |
kesselb
commented
Jun 6, 2023
/** * Get the cache mount for a user * * @param IUser $user * @param IStorageFactory $loader * @return \OCP\Files\Mount\IMountPoint[] */publicfunctiongetMountsForUser(IUser$user, IStorageFactory$loader) {
$cacheBaseDir = $this->config->getSystemValueString('cache_path', '');
$uploadsBaseDir = $this->config->getSystemValueString('uploads_path', '');
if ($cacheBaseDir === '' && $uploadsBaseDir === '') {
return [];
}
$cacheDir = rtrim($cacheBaseDir, '/') . '/' . $user->getUID();
if (!file_exists($cacheDir)) {
mkdir($cacheDir, 0770, true);
}
if ($uploadsBaseDir === '') {
$uploadsDir = $cacheDir . '/uploads';
} else {
$uploadsDir = rtrim($uploadsBaseDir, '/') . '/' . $user->getUID();
}
if (!file_exists($uploadsDir)) {
mkdir($uploadsDir, 0770, true);
}
return [
newMountPoint('\OC\Files\Storage\Local', '/' . $user->getUID() . '/cache', ['datadir' => $cacheDir], $loader, null, null, self::class),
newMountPoint('\OC\Files\Storage\Local', '/' . $user->getUID() . '/uploads', ['datadir' => $uploadsDir], $loader, null, null, self::class)
];
}I guess this version should cover the old case and new case. |
Thanks @kesselb for highlight it. You are correct, I missing the removal of creation uploads user path in the cache if, and creation of it on upload if. Everything working in my previous commit, because uplaod function check and create uploads folder if not exists. Now should be fixed, if |
bd243b3 to
60ceacaComparetanganellilore
commented
Aug 25, 2023
@kesselb Any news on this PR? |
Signed-off-by: Lorenzo Tanganelli <lorenzo.tanganelli@hotmail.it>
kesselb
commented
Jun 18, 2024
Hi @tanganellilore, Sorry, I apparently missed your ping last year. #38633 was merged, and therefore we have unit tests now for the component.
Please ping me again if the linter and nodb tests are happy, I will trigger another review then. Note some tests (e.g., cypress) are failing for forks, don't worry. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
skjnldsv
commented
Aug 14, 2024
@susnux@juliushaertl can I get your opinion on this? |
| /** | ||
| * Override where Nextcloud stores uploaded user files while uploading (chunks). Useful in situations | ||
| * where the default `<user_id>/uploads` is on network disk like NFS. | ||
| * Defaults to the value of '' if unset. |
There was a problem hiding this comment.
| * Defaults to the value of '' if unset. | |
| * Defaults to `cache_path` if set, otherwise '' |
juliusknorr
commented
Aug 14, 2024
I think this is reasonable, though I currently lack insight on what we actually use the cache folder for. Tend to agree with @kesselb that two separate config values seem to much. Needs a rebase and resolving the conflict. |
tanganellilore
commented
Aug 14, 2024
Cache folder is used for chunk upload if i remeber well. See issue linkedin to this MR. I think that i can do rebase, but before tell me if this will be merged |
kesselb
commented
Aug 14, 2024
skjnldsv
commented
Aug 14, 2024
Would be nice yeah! We're about to start the 31 release schedule. Maybe have this merged soon to be safe? I would also like some tests for this |
tanganellilore
commented
Oct 1, 2024
Why closed? |
susnux
commented
Oct 11, 2024
Because it was marked as stale. If you still want to get this feature in and actively develop it then please just reopen the PR :) |

Summary
Alternative solution instead usage of symlink proposed here: #38506.
In this solution I'm not use the symlink but directly new virtual mount to configuration passed.
TODO
Checklist