Commit Graph

111 Commits

Author SHA1 Message Date
Paweł Chojnacki 6537c054e5 Fix PUT uploads
PUT uploads were broken on python 3.9 and were lacking tests.
2021-07-14 00:11:16 +02:00
Sebastian Lohff 65fcac5c49 Fix encoding handling for file listing with py2
File listings with -l that contained files with umlauts or other special
chars could break the directory listing. Hopefully one of the last
python2 fixes before I drop support for this.
2021-06-08 23:46:30 +02:00
Sebastian Lohff 9fa4ed0026 Quote filenames in Location header on redirect
When we redirect the user to the "correct" file name this name should
end up quoted in the header, else we would end up in an infinite
redirect loop.
2021-06-08 23:46:30 +02:00
Sebastian Lohff e31c8fb016 Fix broken pyopenssl and debian references
servefile used to hint to install pyssl when ssl support was missing.
This is utterly wrong, because the package is named pyopenssl - as
stated in setup.py. Installing pyssl will not only not lead to ssl
support, but also install a random package that we do not want.

Also, since python2 has genereally been deprecated (though it is still
support by servefile for now) we hint for the python3 package of
pyopenssl instead of the python2 version. I thought about building a
version detection and print the right package, depending if the user is
using python2 or 3, but I deemed it not being worth it.

Fixes #7 (GitHub)
2021-02-14 21:07:25 +01:00
Sebastian Lohff 058de2f39c Fix exception on transmission abort with python3
With python3 sys.exc_value does no longer exist, but we can replace it
with sys.exc_info().
2021-01-27 01:31:15 +01:00
Sebastian Lohff 11a7d8bd13 Release v0.5.1 2020-09-30 01:44:57 +02:00
Sebastian Lohff f2594c2adf Release v0.5.0 2020-09-30 01:28:48 +02:00
Sebastian Lohff 19c1b000a4 Make servefile a python package
servefile is now a valid python package. The single servefile.py can
still be used as a script by just putting it into PATH and making it
executable. Additionally when installed via pip a wrapper script is
created, calling the module's main(). python -m servefile works as well.
2020-09-07 00:26:20 +02:00
Sebastian Lohff 2b138446d4 Change shebang to /usr/bin/env python
Using /usr/bin/python might have side-effects, such as the system
python being used even when the script is called from within a
python virtual env. env python should give us the right interpreter.
As we are both python2 and python3 compatible this should cause no
problems.
2020-01-15 00:48:06 +01:00
Sebastian Lohff ccd01e8b6e Fix -4/-6 crash caused by broken filter statement
In python3 filter returns a generator instead of a list. When -4 or
-6 is used or if the host system has either of those address
families disabled len() gets called onto this filter expression
which results into a crash. This commit makes a filter expression
out of this statement and also adds a test for ipv4-only downloading.
2020-01-15 00:48:06 +01:00
MasterofJOKers 907013522c Make `targetDir` absolute by default
When serving a `../` as directory (with `-l`), servefile creates an
endless 301-redirect loop. Having an absolute path fixes this. Since
this error might come up any time again, we're setting `targetDir` to
its absolute path right from the beginning and never have to worry about
it later on.
2020-01-15 00:07:07 +01:00
Sebastian Lohff 6e27ecfe8c Python3 SSL socket handling 2019-02-24 13:59:12 +01:00
Sebastian Lohff 0e33743293 Fix imports and unicode handling for Python3 2019-02-17 23:14:54 +01:00
MasterofJOKers 08ac08718b List view allows sorting by "Last Modified", "Name", "Size"
This is implemented in JavaScript, because for implementing it in
Python, the concept of creating the directory listing view would have to
be changed.
2019-02-17 20:19:22 +01:00
bitwave aeb8588198 added compression method lzma for tar files 2018-04-25 19:08:58 +02:00
Sebastian Lohff a0b8ae4932 Moved to v0.4.4 2015-11-10 21:12:49 +01:00
Sebastian Lohff cd7eee21be Fixed directory traversal bug with direcotry listing 2015-11-10 20:51:18 +01:00
Sebastian Lohff 11ad07cc76 Replaced posixpath calls with os.path 2015-11-10 20:51:01 +01:00
Sebastian Lohff 0c781c2b73 Send correct headers on range/HEAD request 2015-08-03 05:41:51 +02:00
Sebastian Lohff cb4ebb017f Only catch ValueError, not all exceptions 2015-08-03 05:33:57 +02:00
Sebastian Lohff 42949c1403 Swallow traces when client aborts transmission 2015-03-18 00:22:21 +01:00
Sebastian Lohff 46757ff89b Mute SSL exceptions on connection shutdown
Happens most frequently with SSL errors being sent by the
client
2015-03-17 23:47:51 +01:00
Sebastian Lohff 659383bf30 Issue v3 certificate with --ssl 2015-03-17 23:38:46 +01:00
Sebastian Lohff 9201b62f18 Use TLS1.2 / TLS1 with --ssl if available 2015-03-17 23:32:20 +01:00
Sebastian Lohff 6b85d23752 Moved to v0.4.3 2013-12-28 02:31:19 +01:00
Sebastian Lohff 320839d856 Display user/password in url-list when authentication is used 2013-12-28 00:19:10 +01:00
Sebastian Lohff 80c9d9fe0a Connection: close headers to disable http-keep-alive
Some Connection: close headers are needed so clients know that
servefile does not support keepalive connections.
2012-11-13 03:01:05 +01:00
Sebastian Lohff 72b561ace7 Fixed connection keep-alive bug for basic auth 2012-11-13 02:56:50 +01:00
Sebastian Lohff d54b3f5b8d Nicer display of OSError exception messages 2012-11-12 19:47:16 +01:00
Robert Buchholz affa42dae8 Do not swallow exceptions that can be helpful in error messages 2012-11-12 19:46:03 +01:00
Sebastian Pipping 2886d1fb07 Hide ../ in listing of the (virtual) root directory 2012-10-29 19:12:48 +01:00
Sebastian Lohff 6a38212242 Merge branch 'spingpatches'
Conflicts:
	servefile
2012-10-25 03:08:40 +02:00
Sebastian Pipping dece73be04 Make sorting case-insensitive so that "aaa" and "AAA" end up next to each other 2012-10-25 01:35:34 +02:00
Sebastian Pipping 0df9c56214 Make all directories go on top in listings 2012-10-25 01:31:41 +02:00
Sebastian Pipping 4452d86498 Extract method DirListingHandler._appendToListing (so we can re-use it) 2012-10-24 01:01:42 +02:00
Sebastian Lohff 8c4439cc2b Moved to v0.4.2 2012-06-27 01:44:49 +02:00
Sebastian Lohff 602dba42f9 Enhanced regexes for *bsd compability 2012-06-27 01:44:34 +02:00
Sebastian Lohff d628770d73 Startup parameter fixups 2012-06-26 02:40:41 +02:00
Sebastian Lohff 12169eafe4 Added keyword argument to function for clarification 2012-06-26 02:19:04 +02:00
Sebastian Lohff 18775c5c72 Improved the dirlisting's display of sizes 2012-06-26 02:18:18 +02:00
Sebastian Lohff c5cb5f45a7 Added link to seba-geek.de to dirlisting bottom 2012-06-26 02:16:20 +02:00
Sebastian Lohff 8a32b02eed Added 404 message to dirlisting 2012-06-26 02:16:02 +02:00
Sebastian Lohff fbbbeb3fd2 Code cleanup
List of bugs and improvemends provided by Sebastian Pipping
2012-06-26 02:13:24 +02:00
Sebastian Lohff 5374315e76 Only allow directories for directorylisting 2012-06-25 20:45:37 +02:00
Sebastian Lohff 8a040fbb75 Enhanced error message for broken SSL keyfiles 2012-06-25 20:33:21 +02:00
Sebastian Lohff 2ce2a9c228 Better error messages when socket could not be opened 2012-06-25 20:03:34 +02:00
Sebastian Lohff f48838f63c Fixed bug where --tar produced filenames with duplicate extension 2012-06-25 19:30:18 +02:00
Sebastian Lohff 8274849c8a Moved to new print function and python3 support 2012-06-25 19:23:50 +02:00
Sebastian Lohff df6e6f403a Fixed documentation for --realm option 2012-06-25 13:05:43 +02:00
Sebastian Lohff 2e1af7785b Fixed minor punctuation mistake 2012-06-25 12:39:56 +02:00