Commit Graph

136 Commits

Author SHA1 Message Date
Sebastian Lohff b5a9c52ed1 Allow ports for tests to be specified via env
SERVEFILE_DEFAULT_PORT and SERVEFILE_SECONDARY_PORT can be used to
specify ports used in the servefile tests. This can be useful if the
default port 8080 and the secondary port 8081 (for the -p test) are
already in use. To allow automatic choosing of a free port 0 can be
specified to tell the test code to automatically select a free port.
2021-03-11 00:50:07 +01: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 95852ba11d Change project url to GitHub 2020-09-30 01:12:53 +02:00
Sebastian Lohff 14771695c4 Add README.md 2020-09-30 01:12:53 +02:00
Sebastian Lohff 5c78991bc8 Advertise python3.5 support
For now we don't break compability with python3.5, so why not advertise
it!
2020-09-29 22:13:30 +02:00
Sebastian Lohff ef41f65996 Workaround for python2 deprecation in tests
When checking the version the test now gets a
CryptographyDeprecationWarning plus an import code line instead of the
version. As a workaround we now ignore the first two lines when checking
for the version string.
2020-09-07 00:31:10 +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 3d46950d6c Use spaces instead of tabs for setup.py 2020-09-06 23:26:49 +02:00
Sebastian Pipping 864b2161b1 Cover Python 3.7 and 3.8 2020-02-11 22:26:24 +01:00
Sebastian Pipping 8fe46c42a7 setup.py: Migrate to setuptools + polishing 2020-02-11 22:10:22 +01:00
Sebastian Pipping 0819d23f47 tests: Use sys.executable during tests 2020-02-08 01:26:47 +01:00
Sebastian Pipping a7d273f13f tests: Prepare version-specific code for extension 2020-02-08 01:15:27 +01:00
Sebastian Lohff dce8c995f6 Add test requirements to setup.py 2020-02-08 01:13:43 +01: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
MasterofJOKers e5f9b39025 tests: Pass additional tox args to pytest
This allows to run specific tests e.g. via `tox -e py3
tests/test_servefile.py::test_serve_relative_directory`.
2019-02-24 16:00:38 +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
Sebastian Lohff 93e0c3dd7e Initial tests 2019-02-17 21:29:23 +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
Sebastian Lohff 30738981f4 Document lzma/xz support in manpage 2019-02-14 23:25:36 +01:00
Sebastian Lohff 53d803626d
Merge pull request #2 from bitwave/tar-lzma-support
added compression method lzma for tar files
2019-02-14 23:22:58 +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