paranerd / simpledrive

With simpleDrive you can access your data like you would in a regular file manager without the need to have them with you all the time or send them out into the web. simpleDrive puts you in charge of your own data - the way it's meant to be!
GNU Affero General Public License v3.0
5 stars 1 forks source link

Bugs and Feature Request #2

Open gxgani opened 8 years ago

gxgani commented 8 years ago

Bugs:

  1. Clicking anImage results in "Cannot create Symlink" error (Lightbox is not displaying the image)
  2. Right Click image -> Galery (a typo here) results in blank loading state. (URL: files?v=files&d=&r=null )
  3. Clicking an Image in grid view after the lightbox results in indefinite loading.
  4. Is Multi select implemented? Was able to select when there only image files but with multiple files, unable.

Feature Request:

  1. Ability to copy direct URL (as in domain/$userdir)

PS: I primarily use it for uploading/sharing documents, screenshots etc using a program called "Dropshare" (Similar to puush but with our own server). So what it does is, upload an image, copy the relative url path and copies it to clipboard.

Will update this as I continue using the project.

paranerd commented 8 years ago

Fixed 1, 2 and 3 You can select multiple files by clicking the thumbnail/icon or Ctrl+A or the little square next to "Name" (selects all elements in current folder)

As for the feature request: Right-click --> Share --> Public --> Generates a publicly accessible link But if I understand you correctly, you want the path to be returned after upload?

paranerd commented 8 years ago

Just out of curiosity: How did you learn about simpleDrive? ;-)

gxgani commented 8 years ago

I actually wanted direct link. For example, dropshare uploads image to /docs/gani, so I want to url to be domain.com/docs/gani but I completely understand that shareable link should via api.

I literally searched the s**t out of github. I've tried out so many of them, but I wanted a simple and standalone project not docker/nodejs. I liked yours and definitely this could do the job! (Btw, keep it up)

paranerd commented 8 years ago

Yea, that kinda needs to run via the API because Dropshare would need to provide authentication via credentials/token... Thx, glad to hear! ;-)

paranerd commented 8 years ago

You know, there's a simpleDrive-app with sharing capabilities?

gxgani commented 8 years ago

Right now, I don't mind. Your project seems to scan the "folder" for new files not just files uploaded via simpleDrive (hoping that its how its intended to work) unlike others.

This is dropshare (https://getdropsha.re/)

gxgani commented 8 years ago

There seems to be a bug in loading. I mean, if you're fast enough, the indefinite loading image just stays there until I do a refresh. The MP3 player does not seem to function properly.

Feature Request: Move? There's a copy, why not move? :)

paranerd commented 8 years ago

Released 2.11.0. Fixed the indefinite loading issue when clicking very fast through images.

What's the problem with the audio player? Anyways please check 2.11.0 as I reworked the whole loading mechanism, so the problem might already be fixed ;-)

You can move files by dragging them over the respective folder (either in the list of files or in the navigation bar on top)... I could add an option to "cut" files, if you'd prefer?!

gxgani commented 8 years ago

May I know what file is this?

The new build does not seem to load images properly. It took huge amount of time to load first and then does not load at all.

paranerd commented 8 years ago

The symlink was for testing purposes, forgot to delete it before committing, sorry! The new loader shrinks images to just fit screen size to save bandwidth. Furthermore images can now be properly cached by the browser to prevent multiple loading of the same image.

I tested it on a Raspberry Pi 2 running Ubuntu Server, worked like a charm.

gxgani commented 8 years ago

https://zippy.gfycat.com/BlondCreativeGermanpinscher.webm

paranerd commented 8 years ago

You need to have php5-gd installed on the server for the shrinking to work...

In file.class.php try commenting this part in the function read()

    else if ($source[0]['type'] == 'image' && $width && $height) {
        $delete_flag = true;
        $destination = $this->shrink_image($width, $height, $path['abs'], null);
    }

to just load the full image and see if this is the problem.

gxgani commented 8 years ago

I have gd installed

[www-data@toast ~]$ yum list installed | grep php
ajenti-v-php-fpm.noarch
php-common.i686       5.6.20-1.el6.remi   @remi-php56                           
php-fpm.i686          5.6.20-1.el6.remi   @remi-php56                           
php-gd.i686           5.6.20-1.el6.remi   @remi-php56                           
php-mysqlnd.i686      5.6.20-1.el6.remi   @remi-php56                           
php-pdo.i686          5.6.20-1.el6.remi   @remi-php56                           
php-pecl-jsonc.i686   1.3.9-1.el6.remi.5.6
                                          @remi-php56                           
php-pecl-zip.i686     1.13.2-1.el6.remi.5.6
                                          @remi-php56                           
php-xml.i686          5.6.20-1.el6.remi   @remi-php56   

Tried commenting out the section, didn't work. The image gets downloaded but the indefinite loading is still present.

paranerd commented 8 years ago

Gets downloaded means it gets displayed in the browser? Can you switch images in the lightbox?

gxgani commented 8 years ago

By download I meant, I see that browser downloading the image(network indicator) On Apr 25, 2016 4:15 PM, "paranerd" notifications@github.com wrote:

Gets downloaded means it gets displayed in the browser? Can you switch images in the lightbox?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/paranerd/simpledrive/issues/2#issuecomment-214261548

paranerd commented 8 years ago

I've been tweaking the whole system, will upload later, maybe that already fixed it.

paranerd commented 8 years ago

Just an idea: Try commenting out header("Content-Length: " . filesize($destination)); in file.class.php --> function read()

That line caused problems with image loading in the android app as well...

gxgani commented 8 years ago

I assume it was "header("Content-Length: " . $this->size($destination));" (1376), It didn't help either.

I see the image loading, but it's too damn slow.

gxgani commented 8 years ago

Nvm, the previous comment worked.

gxgani commented 8 years ago

The issue with music files which I had reported earlier, these are the insights.

paranerd commented 8 years ago

I'm still testing and will have that fixed in the next commit. Thx for pointing out!

gxgani commented 8 years ago

You're doing an amazing job btw. ;) Cheers.

paranerd commented 8 years ago

Very nice to hear, thx ;-)!

paranerd commented 8 years ago

Updated to 2.12.0. That should, among other things, fix the audio-loading-issue ;-)

gxgani commented 8 years ago

Audio playback is flawless as of now but the image preview still seems to have issues. What does it actually happen on click of the image? In my observation, there's loading bar where it seems to do server side actions and after say 2-4seconds later, the image is downloaded and then previewed.

paranerd commented 8 years ago

The client sends a request to the server containing screen width and height. The server shrinks the image to that size to save bandwidth. Did you try to comment out the following block in the read() function in file.class.php?

    else if ($width && $height) {
        $destination = $this->shrink_image($width, $height, $path['abs'], null);
    }

That prevents shrinking and just sends the image full size.

gxgani commented 8 years ago

At first I thought it was the shrink command was stressing the CPU and caused the slow load of the image but it's actually, it's the browser how it finally loads the image.

Firefox (beta 46) waits for the complete image for some reason (doesn't happen in imgur/etc) and image appears in the lightbox where as in Chrome, you can see the loading.

Secondly, could we have a column for file "type"? I usually have my files sorted by the kind/type.

paranerd commented 8 years ago

What do you mean "you can see the loading"? As for the order-by-type-issue: working on it, releasing later ;-)

gxgani commented 8 years ago

Frame by frame from top to bottom? That's the best I could come up with lol.

paranerd commented 8 years ago

I think I got it to work now... Server sends packages with each 200kb to the client, so the image builds up "frame by frame"^^ if the connection is too slow to load it at once.

Check out 2.13.0, it also contains the option to order-by-type ;-)

paranerd commented 8 years ago

Icon-font changed... maybe you got the old one cached again?

paranerd commented 8 years ago

Typo where? o.O

paranerd commented 8 years ago

Found the error. Should fix both issues ;-)

gxgani commented 8 years ago

Suggestion:

Bugs:

Feature Request:

PS: Great job as usual. Glad to be your tester ;)

paranerd commented 8 years ago

Suggestions: (1) In the "Share"-Dialog you can tick "Public" (and optionally provide a password) which will provide you with a public link (2) Moving the admin-general section to the user would not be a good idea, since user-count, setting the upload-limit and enabling/disabling SSL should only be maintained by the admin (3) What do you mean "clearable"?^^ Do you want to disable it completely or just hide it each time it appears? (you can do that by clicking "Esc") (4) Update notification on android? Shouldn't android itself provide that?! o.O (5) SimpleDrive is designed to be fully customizable, so you can just add your own colors in assets/css/themes/color/ ;-). Which color do you have in mind? (6) You're right, that might be a little more intuitive. Added "Info" to the menu; logo now leads to the files-page ;-)

Bugs: (1) I'm using a great library that handles the zooming perfectly. If I can't find one that does that AND plays gifs, I'm afraid that feature is not gonna make the cut :disappointed: (2) Might look into that... Not sure how, though, because simpleDrive is not (and is not intended to be) a fully equipped media player, so I don't know what to fill an entire screen with besides seekbar, play/pause, skip and title xD (maybe I'll implement a small overlay at the bottom of the file-list?!)

Feature: (1) By that you mean that you won't have to login after you shutdown the browser?

Your testing greatly helps improving the software, so thank you as well :smiley: !

gxgani commented 8 years ago

Features:

  1. While sharing, sometimes I get the error "No Target" and secondly the shared link seems to include the "root directory" which in my case is "www". So when I shared an image it's http://domain.xyz/www/public?r=hash Also, it does not seem to include "https://"
  2. Cool. But I still feel showing the application version, upload limit (internal) is inappropriate to the users.
  3. Didn't know you can ignore it with escape, how about a "X" at top-corners of the banner?
  4. Update notification of the simpleDrive web application not the apk itself ;)
  5. How about implementing a color picker/material colors etc.
  6. Great.

Bugs:

  1. OH NOESSS. How am I suppose to play my cool memes! (How about including an another library just to play the gif on loop?)
  2. Right now it invokes my default player (powerAMP) and I couldn't find it's native UI controls on the notification bar as well(dunno, but usually I do) But a minimalistic seek bar with play/pause should suffice.

Feature:

  1. I assume login session have a timeout? Adding a "Remember Me" check box to the login page could keep me logged in until I log out.(Not indefinite, say 2 weeks+, I am not sure how cloudflare's Remember me works, but I'm logged out the other day or couple'o days later)
paranerd commented 8 years ago

Features: (1a) "No target" occurrs when the selected file is somehow unselected. When exactly does that happen? (1b) Probably something went not quite right during the setup. Just edit your config.json and remove the "www" from "installdir" :smiley: (1c) Fixed the https:// issue (2) Yes, I don't think, the individual user should have access to managing the upload limit :wink: . Version can be checked under the newly added "Info", that's in the general tab just as an... well... info^^ (3) Added the "x" (4) Added the update notification (5) I could certainly add more colors to the palette :wink: , but it still requires extra .css-files. Which color(s) would you prefer?

Bugs: (1) Spent the entire day to get those godforsaken gifs work with the ImageViewer :laughing: ... Check it out and tell me if it fits your needs :wink: (2) Will look into that.

Feature: (1) This is actually already implemented, but only lasts 24 hours. I expanded that to a week.

paranerd commented 8 years ago

Just released 3.6.0 for android containing the option to seek audio :wink:

gxgani commented 8 years ago

Hey, after a long time I went ahead and installed the current version and now I'm unable to get past through internal server error at login.

2016/06/17 02:53:58 [error] 17413#0: *4085 FastCGI sent in stderr: "PHP message: PHP Notice:  Undefined index: admin in /home/user/www/index.php on line 26" while reading response header from upstream, client: my-ip, server: site.com, request: "GET /files?v=files&d=&r=null HTTP/1.1", upstream: "fastcgi://unix:/var/run/ajenti-v-php-fcgi-cobalt60-php-fcgi-0.sock:", host: "site.com"
2016/06/17 02:53:59 [error] 17413#0: *4085 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to a member function bind_param() on boolean in /home/user/www/php/database.class.php on line 155" while reading response header from upstream, client: my-ip, server: site.com, request: "POST /api/users/loadview HTTP/1.1", upstream: "fastcgi://unix:/var/run/ajenti-v-php-fcgi-cobalt60-php-fcgi-0.sock:", host: "site.com", referrer: "https://site.com/files?v=files&d=&r=null"
2016/06/17 02:53:59 [error] 17413#0: *4087 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to a member function bind_param() on boolean in /home/user/www/php/database.class.php on line 155" while reading response header from upstream, client: my-ip, server: site.com, request: "POST /api/users/loadview HTTP/1.1", upstream: "fastcgi://unix:/var/run/ajenti-v-php-fcgi-cobalt60-php-fcgi-0.sock:", host: "site.com", referrer: "https://site.com/files?v=files&d=&r=null"
2016/06/17 02:54:04 [error] 17413#0: *4087 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to a member function bind_param() on boolean in /home/user/www/php/database.class.php on line 155" while reading response header from upstream, client: my-ip, server: site.com, request: "POST /api/core/login HTTP/1.1", upstream: "fastcgi://unix:/var/run/ajenti-v-php-fcgi-cobalt60-php-fcgi-0.sock:", host: "site.com", referrer: "https://site.com/login"
2016/06/17 02:54:08 [error] 17413#0: *4087 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to a member function bind_param() on boolean in /home/user/www/php/database.class.php on line 155" while reading response header from upstream, client: my-ip, server: site.com, request: "POST /api/core/login HTTP/1.1", upstream: "fastcgi://unix:/var/run/ajenti-v-php-fcgi-cobalt60-php-fcgi-0.sock:", host: "site.com", referrer: "https://site.com/login"
2016/06/17 02:54:12 [error] 17413#0: *4095 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to a member function bind_param() on boolean in /home/user/www/php/database.class.php on line 155" while reading response header from upstream, client: my-ip, server: site.com, request: "POST /api/core/login HTTP/1.1", upstream: "fastcgi://unix:/var/run/ajenti-v-php-fcgi-cobalt60-php-fcgi-0.sock:", host: "site.com", referrer: "https://site.com/login"
2016/06/17 02:56:54 [error] 16557#0: *3 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to a member function bind_param() on boolean in /home/user/www/php/database.class.php on line 155" while reading response header from upstream, client: my-ip, server: site.com, request: "POST /api/core/login HTTP/1.1", upstream: "fastcgi://unix:/var/run/ajenti-v-php-fcgi-cobalt60-php-fcgi-0.sock:", host: "site.com", referrer: "https://site.com/login"
paranerd commented 8 years ago

Hey there, That error occurs because I changed a lot under the hood since your last update. In the user database, I removed the "mode" to the now easier to maintain boolean "admin" (to identify an admin user).

You could re-run the setup, or simply add a tinyint(1) "admin" column to the "accounts" table in your simpledrive database and everything should be up and running again ;-).

Cheers! Am 17.06.2016 03:06 schrieb "GaNi" notifications@github.com:

Hey, after a long time I went ahead and installed the current version and now I'm unable to get past through internal server error.


message: PHP Notice: Undefined index: admin in /home/user/www/index.php on
line 26" while reading response header from upstream, client: my-ip,
server: site.com, request: "GET /files?v=files&d=&r=null HTTP/1.1",
upstream:
"fastcgi://unix:/var/run/ajenti-v-php-fcgi-cobalt60-php-fcgi-0.sock:",
host: "site.com"
2016/06/17 02:53:59 [error] 17413#0: *4085 FastCGI sent in stderr: "PHP
message: PHP Fatal error: Call to a member function bind_param() on boolean
in /home/user/www/php/database.class.php on line 155" while reading
response header from upstream, client: my-ip, server: site.com, request:
"POST /api/users/loadview HTTP/1.1", upstream:
"fastcgi://unix:/var/run/ajenti-v-php-fcgi-cobalt60-php-fcgi-0.sock:",
host: "site.com", referrer: "https://site.com/files?v=files&d=&r=null"
2016/06/17 02:53:59 [error] 17413#0: *4087 FastCGI sent in stderr: "PHP
message: PHP Fatal error: Call to a member function bind_param() on boolean
in /home/user/www/php/database.class.php on line 155" while reading
response header from upstream, client: my-ip, server: site.com, request:
"POST /api/users/loadview HTTP/1.1", upstream:
"fastcgi://unix:/var/run/ajenti-v-php-fcgi-cobalt60-php-fcgi-0.sock:",
host: "site.com", referrer: "https://site.com/files?v=files&d=&r=null"
2016/06/17 02:54:04 [error] 17413#0: *4087 FastCGI sent in stderr: "PHP
message: PHP Fatal error: Call to a member function bind_param() on boolean
in /home/user/www/php/database.class.php on line 155" while reading
response header from upstream, client: my-ip, server: site.com, request:
"POST /api/core/login HTTP/1.1", upstream:
"fastcgi://unix:/var/run/ajenti-v-php-fcgi-cobalt60-php-fcgi-0.sock:",
host: "site.com", referrer: "https://site.com/login"
2016/06/17 02:54:08 [error] 17413#0: *4087 FastCGI sent in stderr: "PHP
message: PHP Fatal error: Call to a member function bind_param() on boolean
in /home/user/www/php/database.class.php on line 155" while reading
response header from upstream, client: my-ip, server: site.com, request:
"POST /api/core/login HTTP/1.1", upstream:
"fastcgi://unix:/var/run/ajenti-v-php-fcgi-cobalt60-php-fcgi-0.sock:",
host: "site.com", referrer: "https://site.com/login"
2016/06/17 02:54:12 [error] 17413#0: *4095 FastCGI sent in stderr: "PHP
message: PHP Fatal error: Call to a member function bind_param() on boolean
in /home/user/www/php/database.class.php on line 155" while reading
response header from upstream, client: my-ip, server: site.com, request:
"POST /api/core/login HTTP/1.1", upstream:
"fastcgi://unix:/var/run/ajenti-v-php-fcgi-cobalt60-php-fcgi-0.sock:",
host: "site.com", referrer: "https://site.com/login"
2016/06/17 02:56:54 [error] 16557#0: *3 FastCGI sent in stderr: "PHP
message: PHP Fatal error: Call to a member function bind_param() on boolean
in /home/user/www/php/database.class.php on line 155" while reading
response header from upstream, client: my-ip, server: site.com, request:
"POST /api/core/login HTTP/1.1", upstream:
"fastcgi://unix:/var/run/ajenti-v-php-fcgi-cobalt60-php-fcgi-0.sock:",
host: "site.com", referrer: "https://site.com/login"

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/paranerd/simpledrive/issues/2#issuecomment-226656119,
or mute the thread
https://github.com/notifications/unsubscribe/ADVLArGFj3s61TKvVM0B6SXXOziwsMDNks5qMfL4gaJpZM4INgCz
.
gxgani commented 8 years ago

Added the column, it's back up. Thanks. Secondly, there seems to be something wrong with filename column text length. (running on 1280x800) and they seem to be trimmed. I get the full names when I zoom out (3x). Bad length in css?

paranerd commented 8 years ago

There is another column right where the text ends that would show the owner of a file shared with you. I moved that column 5% to the right and enlarged the width available for the filename also by 5%. If it is still too long, hovering over with the mouse will show the full name (just noticed that didn't work anymore, but will be in the next update!)

Thank you for pointing out ;-)! Am 17.06.2016 06:17 schrieb "GaNi" notifications@github.com:

Added the column, it's back up. Thanks. Secondly, there seems to be something wrong with filename column text length. (running on 1280x800) and they seem to be trimmed. I get the full names when I zoom out (3x). Bad length in css?

https://camo2.githubusercontent.com/bdd14bfe1197f996e74a5a26f558959ab17eaa17/687474703a2f2f692e696d6775722e636f6d2f5779744d474e742e706e67

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/paranerd/simpledrive/issues/2#issuecomment-226676836, or mute the thread https://github.com/notifications/unsubscribe/ADVLAhJgTA2nwAGD2fIfba48Fyh-VNXdks5qMh_VgaJpZM4INgCz .

gxgani commented 8 years ago

Is there a way I could add a custom right-click option to copy the direct url (I know it's meant to be shared via api but I'm a single user without any intention of adding multiple user)

Also, is it possible to implement nginx/apache url rewriting to have the final url user friendly (currently outputting site.com/files?v=files&d=&r=null)

paranerd commented 8 years ago

If I would provide a direct URL to your files, anyone who could access them. The sharing option provides security, because you make available only the files you choose and you can protect them with an individual password.

As for the rewriting. Sadly this is as "pretty" as it gets :-/. Spent quite some time figuring this one out That's due to the fact that I can not know where the enduser places the simpleDrive-installation on their Server, so using URL rewriting even more would cause lots of paths to break.

Sorry for the inconvenience...

gxgani commented 8 years ago

I completely understand, but I was trying to repurpose simpledrive as a file manager for private use. But if there was a "hack" to obtain the the direct url, would you be able to provide it? I don't mind doing it every update.

I also think sharing of files need rework (and I think it's also broken, getting 404s - public). One option could also include right click - copy shared link.

paranerd commented 8 years ago

A hack would require several file changes in api.php, files.class.php, files.php and files.js... You would probably have to apply those with every single update... What do you need those direct links for again?^^

paranerd commented 8 years ago

Just tried sharing - worked fine o.O When exactly do you get those 404-errors?

gxgani commented 8 years ago

I was using http://puush.me/ application to share screenshots but limited storage, downtime, privacy etc I moved on to private server. There are numerous apps that allows to take screenshot, screenrecord(dropshare for mac) and upload via sftp. I required something that could allow me to manage the files and be secure.

gxgani commented 8 years ago

This did not occur previously but when I share and use the generated link I get a 404 saying "The requested site could not be found... Return to login"

paranerd commented 8 years ago

Ready for the "hack"? Here comes ;-)

In the php/files.class.php in build_file() add

$direct = $_SERVER['SERVER_NAME'] . substr($path['abs'], strpos($path['abs'], $_SERVER['DOCUMENT_ROOT']) + strlen($_SERVER['DOCUMENT_ROOT']));

above $parent

Then add

'direct'    =>  $direct,

in the $file-array just above 'filename'

The path now gets delivered to the client.

In views/files.php add

<div id="cItemDirect" class="mItem hidden" onclick="ViewManager.showDirectLink();"><div class="menuThumb icon_share"></div>Direct</div>

to the "contextmenu"-div

In assets/js/files.js add

showDirectLink = function() {
    Helper.notify('Direct link', "<input style='width: 90%;' value='" + FileManager.getFirstSelected().item.direct + "'></input>", false);
},

to the ViewManager and

    showDirectLink: showDirectLink

to the return statement of ViewManager

Lastly, delete the .htaccess from your user-directory.

I cannot stress the security issues enough! But it's your server ;-)