silverwind / droppy

**ARCHIVED** Self-hosted file storage
BSD 2-Clause "Simplified" License
1.62k stars 194 forks source link

Symlinks Fail for Directories #437

Open anaxareian opened 4 years ago

anaxareian commented 4 years ago

I found and installed droppy years ago, and I was so happy with it, I never bothered to upgrade it.

In moving to a new VPS, I decided to upgrade, and although I like the ability to search, I really miss the ability to symlink directories and not just files in the droppy client interface.

Will I break the world if I try and add this back by passing 'followSymlinks: true" to the rrdir factory method?

This feature made it very easy to have different web apps work seamlessly together by sharing their file system space via a symlink. I was shocked when I saw that it was claimed symlinks still worked, until I realized I should test them with a file. That worked like a charm, but then left me sad, feeling quite confident that it was not simply an error on my part leading to symlink directories showing up as executable files.

Interestingly enough, if the correct URL for the directory as a symlink is typed into the browser, and then a file added to that always empty in the droppy client directory, the file dropped will be uploaded to the symlinked directory. Unfortunately, I was not able to find anyway to actually see the contents of a symlinked directory.

os: debian 10 4.19.0-10-amd64 x86_64 droppy: 12.2.0 node: v12.18.3 npm: 6.14.6

droppy-directory-symlink-listing

The log after clicking on the "binary" file of the symlinked directorty:

Sep 15 00:43:27 lifeshar droppy[7835]: 2020-09-15 00:43:27 [INFO] 73.43.41.173:47484 GET /!/token [200] [17ms] Sep 15 00:43:37 lifeshar droppy[7835]: 2020-09-15 00:43:37 [ERROR] Path provided was not a file! Sep 15 00:43:37 lifeshar droppy[7835]: at isStatFile (/usr/local/lib/node_modules/droppy/node_modules/isbinaryfile/lib/index.js:150:15) Sep 15 00:43:37 lifeshar droppy[7835]: at Object. (/usr/local/lib/node_modules/droppy/node_modules/isbinaryfile/lib/index.js:22:13) Sep 15 00:43:37 lifeshar droppy[7835]: at Generator.next () Sep 15 00:43:37 lifeshar droppy[7835]: at fulfilled (/usr/local/lib/node_modules/droppy/node_modules/isbinaryfile/lib/index.js:5:58)

anaxareian commented 4 years ago

I did some testing on versions.

Droppy works absolutely fine for me until version 12.0.0. Then the problems above appear.

In addition to the problems above, I found I could not actually delete regular files with the later droppys, either. Although, I was able to delete the symlink file, deleting regular files would fail. (This could be a permissions issue as well, as I played with permissions a lot to try and get things to work, and I did not record my initial permission state before doing so. My bad!)

Here's the log messages for that action:

Sep 17 16:27:27 lifeshar droppy[11530]: 2020-09-17 16:27:27 [INFO] 73.39.81.181:44788 Deleting: /tmp/contacts-google.vcf Sep 17 16:27:27 lifeshar droppy[11530]: 2020-09-17 16:27:27 [ERROR] TypeError [ERR_INVALID_CALLBACK]: Callback must be a function Sep 17 16:27:27 lifeshar droppy[11530]: at makeCallback (fs.js:136:11) Sep 17 16:27:27 lifeshar droppy[11530]: at Object.rmdir (fs.js:671:14) Sep 17 16:27:27 lifeshar droppy[11530]: at Object.utils.rm (/usr/local/lib/node_modules/droppy/server/utils.js:38:6) Sep 17 16:27:27 lifeshar droppy[11530]: at EventEmitter.filetree.unlink (/usr/local/lib/node_modules/droppy/server/filetree.js:205:9) Sep 17 16:27:27 lifeshar droppy[11530]: at fs.stat (/usr/local/lib/node_modules/droppy/server/filetree.js:196:16) Sep 17 16:27:27 lifeshar droppy[11530]: at FSReqWrap.oncomplete (fs.js:154:5)

anaxareian commented 4 years ago

FWIW: I am not getting updates of changes in the directory with version 11.1.0. I remember this happening with my previous version which was all the way back at: 6.9.4. LOL! If it's not broken don't fix it!

Actually, I appreciate all the work you've done, but it worked well enough for me, I never checked to see what you had been doing to improve it. :D Thanks for the great work!