-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow configuring the location of the appdata_[instanceid]
folder
#36337
Conversation
@kesselb - I hope I did that right? I've never made a commit to a project as big as this. I see some of the other tests are failing. What else do I need to do? |
2ce53a5
to
9cdfd1e
Compare
This comment was marked as resolved.
This comment was marked as resolved.
cea86b9
to
145000e
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
e4e1ca8
to
ce10d86
Compare
Something went wrong with your rebase. Try:
|
33d6508
to
783ad06
Compare
Yeah, I'm not the best with git, yet. I think I fixed it. My latest commit also fixes the issue I was having trouble with as described in my initial comment (being unable to use the root of the new mount as |
783ad06
to
cb5b45e
Compare
1280c4d
to
28c874e
Compare
Signed-off-by: summersab <arthur.summers@gmail.com> Signed-off-by: summersab <18727110+summersab@users.noreply.github.com> Set type of `$rootFolder` Signed-off-by: summersab <arthur.summers@gmail.com> Signed-off-by: summersab <18727110+summersab@users.noreply.github.com> implement test method Signed-off-by: summersab <18727110+summersab@users.noreply.github.com> update `config.sample.php` with `appdataroot` parameter Signed-off-by: summersab <18727110+summersab@users.noreply.github.com> fix caching issue preventing files from being written directly to mount point update method to check mount points and determine if cache scanner should run simplify method to check mount points fix unit test add missing line; cleanup lint perform lint cleanup run cs-fixer replace deprecated methods; fix invalid value for `$mountPoint` in `LocalRootScanner:shouldScanPath` rename appdataroot to appdatadirectory remove inaccurate language from `config.sample.php` Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
47f154e
to
96681f1
Compare
$arguments = [ | ||
'datadir' => $appdatadirectory, | ||
]; | ||
$storage = new LocalRootStorage($arguments); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should just be Local
not LocalRootStorage
$this->config = $systemConfig; | ||
$this->appId = $appId; | ||
$this->folders = new CappedMemoryCache(); | ||
|
||
$this->rootFolder = new LazyRoot(function () use ($rootFolder, $systemConfig) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you creating a new LazyRoot
?
$storageId = $this->storage->getId(); | ||
$mount = Filesystem::getMountManager()->findByStorageId($storageId); | ||
$mountPoint = sizeof($mount) == 1 ? $mount[0]->getMountPoint() : "null"; | ||
|
||
$path = trim($path, '/'); | ||
return $path === '' || str_starts_with($path, 'appdata_') || str_starts_with($path, '__groupfolders'); | ||
return $path === '' || str_starts_with($path, 'appdata_') || str_starts_with($path, '__groupfolders') || str_starts_with($mountPoint, '/appdata_'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to stop the scanner from touching the new appdata mountpoint, you can instead create a storage with a "noop" scanner.
Is there still work that needs to be done here? Seems like this has been idle for quite some time. |
See the unresolved comments above, so yes there is work to be done. |
Closing this pull request due to lack of recent activity and updates. We appreciate your contribution and encourage you to reopen or provide further updates if necessary. |
Wait, you closed an issue due to inactivity, issue that had already started development and people are actively waiting for it? If you want activity I will repost comment here every week so issue is "active". I don't think that's what is expected, and is usually considered spam on GitHub, but after this closing it seems this project has different code of conduct - "spam us if you want the feature". Please be reasonable and keep the issue open until it is finished, reviewed and accepted. It was planned for NC 26, then 27, 28, 29... I have no words... |
For your information: assigning to a milestone is not a sign of planning. All PRs are moved to the next milestone after the branch-off. |
Ok, sorry for misinterpreting the closing comment, it was just for this commit which indeed got stale, not the original issue. Hopefully someone will step up to finish the needed work. |
Allow configuring the location of the
appdata_[instanceid]
folderSummary
This allows administrators to change the location of the
appdata_[instanceid]
folder by specifying anappdataroot
value inconfig.php
. This is especially useful when using shared storage, object storage as primary storage (storingappdata_[instanceid]
in an object store is extremely slow), etc.TODO
Resolved with commit 783ad06
appdataroot
being set, the function should really return$rootFolder
and not$rootFolder->get($folderName)
. The current code will store files in/appdata_[instanceid]/appdata_[instanceid]
when anappdataroot
is provided and/appdata_[instanceid]
in normal operation (i.e. it will create a/appdata_[instanceid]
folder on the mount point instead of writing appdata folders to the mount point itself). Some apps such as OnlyOffice expect theappdata_[instanceid]
folder to be a direct child of system root:https://github.com/ONLYOFFICE/onlyoffice-nextcloud/blob/504884f16ce2b66e45a66579aa3cdf0fd0197330/lib/templatemanager.php#L53
However, I am having permission issues. The system is able to create files and folders at the mount point, but when it tries to read the folders, they don't appear to exist, and errors are thrown. I think it has something to do with theOC\FilesView
attached to the mount point/folder, but I'm not sure. It seems to occur at this function:server/lib/private/Files/Node/Folder.php
Line 161 in 75d7203
If that doesn't make sense, please feel free to ask me to explain in further detail.
Checklist