You are not logged in.

#176 2013-05-13 17:18:03

dodo3773
Member
Registered: 2011-03-17
Posts: 818

Re: quickserve - easy ad-hoc file sharing

Such a good app. Made my life easier. Thanks for this. Is the old version still available anywhere (the python2 one without the additional dependency (I understand the new one is more secure, the dependency is really small, adds additional functionality, was rewritten for python3,  etc.. but I like the old one))?

Edit: Nevermind. Disregard this message. I found it.

Last edited by dodo3773 (2013-05-13 17:29:09)

Offline

#177 2013-05-13 18:30:02

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: quickserve - easy ad-hoc file sharing

Thanks for the feedback. I'm really happy with the new version, both as a user and a maintainer and it's nice that others appreciate it too.


@dodo3773
The sources for the old version will eventually disappear (~6 months with my current cleanup script). If you only want one package, all you need is python3-threaded servers. With that installed,  you can run

python3 -m ThreadedServers.Quickserve ...

which is all the new quickserve executable does anyway. Dependencies shouldn't be an issue though, because the old version depended on python2-xynehttpserver. There may be more modules in python3-threaded servers, but the installed package only takes up 381.00 KiB. If you haven't compared the code then trust me when I say that the new version is much better in terms of correctness and maintainability/extensibility.

Of course, if you want the old version just because of python 2 then go for it. Just make sure that you keep a copy of the sources somewhere.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#178 2013-05-13 18:46:16

dodo3773
Member
Registered: 2011-03-17
Posts: 818

Re: quickserve - easy ad-hoc file sharing

Xyne wrote:

Thanks for the feedback. I'm really happy with the new version, both as a user and a maintainer and it's nice that others appreciate it too.


@dodo3773
The sources for the old version will eventually disappear (~6 months with my current cleanup script). If you only want one package, all you need is python3-threaded servers. With that installed,  you can run

python3 -m ThreadedServers.Quickserve ...

which is all the new quickserve executable does anyway. Dependencies shouldn't be an issue though, because the old version depended on python2-xynehttpserver. There may be more modules in python3-threaded servers, but the installed package only takes up 381.00 KiB. If you haven't compared the code then trust me when I say that the new version is much better in terms of correctness and maintainability/extensibility.

Of course, if you want the old version just because of python 2 then go for it. Just make sure that you keep a copy of the sources somewhere.

I found it. Yes it is because of python2. Going to keep it with my portable python2 stuff. Thanks.

Offline

#179 2013-08-24 19:34:14

MAC!EK
Member
Registered: 2005-09-27
Posts: 267

Re: quickserve - easy ad-hoc file sharing

Hi Xyne

I'm not sure if this is the right place. But I think I encountered a bug in quicserve.
I had it running for about 2 hours then tried to upload something but the connection was reset. I checked the quickserve ouput and found this:

$ quickserve --auth user pass -p 9999 --upload ./ 
MulticastQuickserveServer
  PID              4055
  Address          all interfaces
  Port             9999
  Multicast        False
  Filelist         None
  Filterlist       None
  MOTD             None
  Upload Directory None
  Paths            None
  Static Peers     None

Press ctrl+C to exit.
[2013-08-24 16:24:23 CEST] INFO: 127.0.0.1 "GET / HTTP/1.1" 401 -
[2013-08-24 16:24:26 CEST] INFO: 127.0.0.1 "GET / HTTP/1.1" 200 -
<cut>
[2013-08-24 18:54:41 CEST] INFO: 95.51.142.205 "GET / HTTP/1.1" 401 -
----------------------------------------
Exception happened during processing of request from ('95.51.142.205', 1185)
Traceback (most recent call last):
  File "/usr/lib/python3.3/socketserver.py", line 610, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.3/site-packages/ThreadedServers/HTTPS.py", line 231, in finish_request
    http.server.HTTPServer.finish_request(self, request, client_address)
  File "/usr/lib/python3.3/socketserver.py", line 345, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.3/site-packages/ThreadedServers/HTTPS.py", line 314, in __init__
    http.server.BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
  File "/usr/lib/python3.3/socketserver.py", line 666, in __init__
    self.handle()
  File "/usr/lib/python3.3/http/server.py", line 400, in handle
    self.handle_one_request()
  File "/usr/lib/python3.3/http/server.py", line 388, in handle_one_request
    method()
  File "/usr/lib/python3.3/site-packages/ThreadedServers/HTTPS.py", line 652, in do_GET
    self.server.clean_house()
  File "/usr/lib/python3.3/site-packages/ThreadedServers/Quickserve.py", line 292, in clean_house
    super().clean_house()
  File "/usr/lib/python3.3/site-packages/ThreadedServers/HTTPS.py", line 248, in clean_house
    del self.server.opaques[k]
AttributeError: 'MulticastQuickserveServer' object has no attribute 'server'
----------------------------------------
----------------------------------------
Exception happened during processing of request from ('95.51.142.205', 1189)
Traceback (most recent call last):
  File "/usr/lib/python3.3/socketserver.py", line 610, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.3/site-packages/ThreadedServers/HTTPS.py", line 231, in finish_request
    http.server.HTTPServer.finish_request(self, request, client_address)
  File "/usr/lib/python3.3/socketserver.py", line 345, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.3/site-packages/ThreadedServers/HTTPS.py", line 314, in __init__
    http.server.BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
  File "/usr/lib/python3.3/socketserver.py", line 666, in __init__
    self.handle()
  File "/usr/lib/python3.3/http/server.py", line 400, in handle
    self.handle_one_request()
  File "/usr/lib/python3.3/http/server.py", line 388, in handle_one_request
    method()
  File "/usr/lib/python3.3/site-packages/ThreadedServers/HTTPS.py", line 652, in do_GET
    self.server.clean_house()
  File "/usr/lib/python3.3/site-packages/ThreadedServers/Quickserve.py", line 292, in clean_house
    super().clean_house()
  File "/usr/lib/python3.3/site-packages/ThreadedServers/HTTPS.py", line 248, in clean_house
    del self.server.opaques[k]
AttributeError: 'MulticastQuickserveServer' object has no attribute 'server'
----------------------------------------

I'm not sure this is a bug, also I'm not able to reproduce it. This is on version 2013.5-1

Last edited by MAC!EK (2013-08-24 19:36:07)

Offline

#180 2013-08-25 19:59:18

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: quickserve - easy ad-hoc file sharing

Merged MAC!EK's post from here.

edit:
The bug should now be fixed with python3-threaded_servers>=2013.8.

Last edited by Xyne (2013-08-25 20:09:36)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#181 2013-09-27 08:07:05

dodo3773
Member
Registered: 2011-03-17
Posts: 818

Re: quickserve - easy ad-hoc file sharing

I have a feature request (I looked through the --help options but couldn't see one for this): When I quickserve a folder it gives me all the useful info except my local ip address. For my use case I am yelling across a hall saying my ip on the lan and the other person is downloading files from me. If I do ifconfig I can find out simple enough but I think it would be a nice feature for quickserve. Maybe something like:

MulticastQuickserveServer
  PID              7367
  Address          all interfaces
  LAN  192.168.1.2
  Port             8000
  Multicast        False
  Filelist         None
  Filterlist       None
  MOTD             None
  Upload Directory None
  Paths           
    Downloads
      /home/dodo3773/Downloads
  Static Peers     None

Press ctrl+C to exit.

Just a thought. Or if this is already an option please let me know.

Offline

#182 2013-09-28 06:57:04

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: quickserve - easy ad-hoc file sharing

@dodo3773
The info now includes all bound interfaces and addresses. Upgrade to python3-threaded_servers 2013.9.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#183 2013-09-28 07:07:33

dodo3773
Member
Registered: 2011-03-17
Posts: 818

Re: quickserve - easy ad-hoc file sharing

Xyne wrote:

@dodo3773
The info now includes all bound interfaces and addresses. Upgrade to python3-threaded_servers 2013.9.

Awesome. Thanks Xyne. I really like the way you implemented it too (lo eth0 etc..).

Offline

#184 2013-11-26 20:15:16

dodo3773
Member
Registered: 2011-03-17
Posts: 818

Re: quickserve - easy ad-hoc file sharing

Just found out that there is an upload for quickserve too. Never need a flash drive to share on lan again. Very nice. Works great. After playing around with it I am wondering is there a way to do like a drag and drop for files / directories as opposed to an upload button? That would be a nice feature. Example:  http://www.dropzonejs.com/ (first one I could find on google search (I'm sure you probably know what I mean though anyways)). What do you think Xyne?

Offline

#185 2013-11-27 00:20:32

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: quickserve - easy ad-hoc file sharing

@dodo3773
I like the idea. I had a look at the backend to see if I could easily add an option for dropzone.js, but it would actually be complicated to integrate it for a few reasons.

However, the upload handler was already compatible with it and Quickserve can already serve static HTML pages, so I wrote one to use Dropzone.js. Download the archive here, extract it, then run quickserve with something like

quickserve --upload /path/to/upload/dir /path/to/quickdrop/dir

Navigate to quickdrop.htm and then drag'n'drop all you like.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#186 2013-11-27 00:58:57

dodo3773
Member
Registered: 2011-03-17
Posts: 818

Re: quickserve - easy ad-hoc file sharing

Nice thanks. I read the README and it says that it's possible to use --index option to display page automatically but when I point it to quickdrop/quickdrop.htm it still presents me with choose files button instead of quickdrop. Have you tested this --index part on this specifically? Wondering if maybe I am doing something wrong.

Edit: But if manually going to quickdrop.htm it works fine.

Edit2: Getting this in output:

[2013-11-26 17:01:35 PST] ERROR: 192.168.10.3 code 404, message Not Found
[2013-11-26 17:01:35 PST] INFO: 192.168.10.3 "GET /dropzone.js HTTP/1.1" 404 -
[2013-11-26 17:01:35 PST] ERROR: 192.168.10.3 code 404, message Not Found
[2013-11-26 17:01:35 PST] INFO: 192.168.10.3 "GET /css/dropzone.css HTTP/1.1" 404 -

Last edited by dodo3773 (2013-11-27 01:02:27)

Offline

#187 2013-11-27 01:32:23

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: quickserve - easy ad-hoc file sharing

There was a bug in the index path generator. It should work with python3-threaded_servers-2013.11.27.1-1.

Note that you shouldn't pass the file path to the "--index" option. You should only pass the basename of the file, e.g.

quickserve --upload /path/to/upload/dir /path/to/quickdrop/dir --index dropbox.htm

will display the quickdrop page as soon as you navigate to the quickdrop directory.

Basically, when you pass the index option, Quickserver will check for the named file inside every directory requested and serve the matching file in that directory if present. It's usually a good idea to use a generic name such as "index.htm" and then rename the files you want to serve accordingly.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#188 2013-11-27 01:51:27

dodo3773
Member
Registered: 2011-03-17
Posts: 818

Re: quickserve - easy ad-hoc file sharing

Well unless I put part of the path like the ending folder quickdrop/index.htm then it starts in the directory instead of loading the page. I'll test new version though as soon as it hits aur and post back.

Offline

#189 2013-11-27 02:45:42

dodo3773
Member
Registered: 2011-03-17
Posts: 818

Re: quickserve - easy ad-hoc file sharing

Okay I grabbed the PKGBUILD off of your website and built the new one. Still having the same issues. I do get a screen just not the one I am expecting. Here is a screenshot to show you what I am talking about:

http://i.imgur.com/XgWbnEQ.png

The error messages are the same (not found) and the --index index.htm not finding file is the same too.

Version installed for python3-threaded_servers is 2013.11.27.1-1    Let me know if there is anything you need me to test or try out on my end.

This is the command for the screenshot above:

quickserve --upload /home/dodo3773/Desktop /home/dodo3773/Documents/Scripts/quickdrop/ --index quickdrop/index.htm

When not using quickdrop/index.htm and just using --index index.htm it just takes me to the quickdrop folder where if I manually navigate to the folder and then click it it works fine.

Last edited by dodo3773 (2013-11-27 02:55:43)

Offline

#190 2013-11-27 08:32:38

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: quickserve - easy ad-hoc file sharing

You've misunderstood how it works. Whenever you request a directory, it takes the argument of the "--index" option and joins it to the request path. E.g. "--index index.htm" will try to return "/index.htm" when you navigate to "/', "/foo/index.htm" when you navigate to "foo/", etc.

When you pass a relative path as you are doing, it starts looking in other directories. "--index quickdrop/index.htm" will try to return "/quickdrop/index.htm" when you navigate to "/', "/quickdrop/quickdrop/index.htm" when you navigate to "/quickdrop/", etc.

That doesn't work because the required files are specified as relative paths in quickdrop.htm. If you have the quickdrop files in "/quickdrop/" on the server but load the file in "/" with your index command, then it will look for "Dropzone.js" in "/" too.

It seems that you only want the quickdrop page on the server. In that case, you can just run

quickserve --upload /home/dodo3773/Desktop /home/dodo3773/Documents/Scripts/quickdrop/* --index quickdrop.htm

Obviously you should change the argument of the index command if you have renamed quickdrop.htm, but if you only want to serve one single directory then there's no reason to rename the file.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#191 2013-11-27 20:28:39

dodo3773
Member
Registered: 2011-03-17
Posts: 818

Re: quickserve - easy ad-hoc file sharing

Oh awesome. Thanks Xyne. I did misunderstand. The * at the end of Scripts/quickdrop/* works great and now I see all the files getting loaded in the quickserve output. Also, you were right I just wanted the upload part. I share files on the lan and only turn the server on when I want to share something. So, now I can make an alias for like quickupload or something. Working great now. Thank you Xyne.

Offline

#192 2014-01-02 20:39:54

dodo3773
Member
Registered: 2011-03-17
Posts: 818

Re: quickserve - easy ad-hoc file sharing

Okay I have got a new idea. For my use case I start quickserve and someone either uploads or downloads a file from me on my lan. I do not seem to have an easy way to know when the file is done though. I usually yell across the hall is the file done yet and when it is I turn it off. Is there a way I can show in the output or similar when a file is done? Not sure if maybe it already tells me and I just don't know how to read it or?

Offline

#193 2014-01-05 17:53:08

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: quickserve - easy ad-hoc file sharing

The console output from the server reports uploaded files:

[2014-01-02 20:39:54 UTC] INFO: 127.0.0.1 uploaded 0ad-data-a15-1-any.pkg.tar.xz (487.44 MiB)
[2014-01-02 20:39:54 UTC] INFO: 127.0.0.1 total upload: 487.44 MiB

The message appears when the upload is done.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#194 2014-01-05 20:29:50

dodo3773
Member
Registered: 2011-03-17
Posts: 818

Re: quickserve - easy ad-hoc file sharing

Xyne wrote:

The console output from the server reports uploaded files:

[2014-01-02 20:39:54 UTC] INFO: 127.0.0.1 uploaded 0ad-data-a15-1-any.pkg.tar.xz (487.44 MiB)
[2014-01-02 20:39:54 UTC] INFO: 127.0.0.1 total upload: 487.44 MiB

The message appears when the upload is done.

Ah gotcha. I see it now. But if using it as a server the other way I just see:

[2014-01-05 12:21:21 PST] INFO: 192.168.10.4 "GET /path/to/file HTTP/1.1" 200 -

With no indication of when it is complete. This may be very difficult to implement. I am not really sure if it is even possible since it would mean one would have to know the file size of the downloading files on the other machine (right?).

Okay new idea: What about colors? Different colors for different stuff would be kind of cool like the total upload thing above and 404 or 200 codes. Just a thought. Okay well thanks for the quick response Xyne; still loving the software.

Offline

#195 2014-01-05 22:40:59

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: quickserve - easy ad-hoc file sharing

File transfer sizes and local file paths are now logged. The lines are a quite long though so I may add an option to enable them later. Update python3-threaded_servers to test it.

Colorized output would be nice but I would need to investigate how to implement it. I am not sure that Python's logging module supports it. Somewhere the code must be able to detect the output channel and strip the color codes when writing to non-terminals. Beyond that, many of the messages are handled by Python's default HTTP server. Adding colors would require hooking into that and would likely increase the complexity beyond what it is worth. If someone has some concrete implementation suggestions then I will consider them, but otherwise I doubt that I will try to do this on my own any time soon.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#196 2014-01-05 22:57:51

dodo3773
Member
Registered: 2011-03-17
Posts: 818

Re: quickserve - easy ad-hoc file sharing

Thanks. Working great. As to the colors thing if it means extra dependencies and added complexity etc.. than maybe it's not such a good idea.

Offline

#197 2014-02-06 17:41:02

purzel
Member
Registered: 2012-01-05
Posts: 54

Re: quickserve - easy ad-hoc file sharing

Hi! Quickserve works great! I'm currently using it on my Raspberry Pi to host some photos.

Since Owncloud ist quite slow on the raspberry I prefer to use quickserve.

Since I want to share differnet photos to different people I was wondering if it is possible to allow access to different folders by different logins?

At the moment I'm hosting differnet instances of quickserve on different ports wich is quite a bit cumbersome.

cheers!

Offline

#198 2014-02-07 00:02:12

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: quickserve - easy ad-hoc file sharing

Per-directory authorizations are not currently supported but I've added it to the TODO list. I have no idea when (or even if) I'll get to it, but it's something that has crossed my mind before too.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#199 2014-03-18 17:55:48

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: quickserve - easy ad-hoc file sharing

Are there any concerns about using quickserve for sharing (actually uploading) over Internet? I know there are extra networking issues (eg. port forwarding [?]) that need to be addressed, but is there anything quickserve-specific I need to consider? Thanks.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#200 2014-03-18 21:25:53

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: quickserve - easy ad-hoc file sharing

There are no security holes that I am aware of, but I am not a security expert. Beyond that, the code would obviously inherit any vulnerabilities present in the Python HTTP server package.

That stated, I believe it is safe provided that you use a dedicated upload directory and properly configure client authorization. The best is to use SSL with client certificates. I tend to use SSL with HTTP Digest authorization.

Obviously if you do something stupid like run it as root with the system root directory as the upload directory and overwriting enabled, bad things™ will likely happen. tongue


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB