sebageek / servefile Goto Github PK
View Code? Open in Web Editor NEWserve or receive files from shell via a small HTTP server
serve or receive files from shell via a small HTTP server
Hey,
when using lftp to mirror a directory, lftp is deciding if a file has been modified on the server.
Servefile seems to always return the current time instead of the real modification time of files, such that
This is NOT ACCEPTABLE - FIX ASAP!
When try to use python -m servefile --ssl -l .
i always get Error: SSL is not available, please install pyssl (python-openssl).
After apt install python-openssl
and python -m pip install python-openssl
the error message is the same.
It looks like the python -m pip install pyopenssl
is the working version.
Used the above commands in a container docker run --rm -ti -v $PWD:/work/ python:3.7-slim /bin/bash
* The servefile still can't start because it has only the loopback interface, but the ssl looks good.
Inline with Python 3.10 and earlier, when running the tests with Python 3.11, I get this error:
=============================================================================== FAILURES ===============================================================================
_______________________________________________________________________ test_version_standalone ________________________________________________________________________
run_servefile = <function run_servefile.<locals>._run_servefile at 0x7fe63f744540>
def test_version_standalone(run_servefile):
# test if servefile also works by calling servefile.py directly
> _test_version(run_servefile, standalone=True)
run_servefile = <function run_servefile.<locals>._run_servefile at 0x7fe63f744540>
tests/test_servefile.py:158:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
run_servefile = <function run_servefile.<locals>._run_servefile at 0x7fe63f744540>, standalone = True
def _test_version(run_servefile, standalone):
# we expect the version on stdout (python3.4+) or stderr(python2.6-3.3)
s = run_servefile('--version', standalone=standalone, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
s.wait()
version = s.stdout.readline().decode().strip()
# python2 is deprecated, but we still want our tests to run for it
# CryptographyDeprecationWarnings get in the way for this
if 'CryptographyDeprecationWarning' in version:
s.stdout.readline() # ignore "from x import y" line
version = s.stdout.readline().decode().strip()
# hardcode version as string until servefile is a module
> assert version == 'servefile 0.5.3'
E assert "/var/tmp/portage/www-servers/servefile-0.5.3-r1/work/servefile-0.5.3/servefile/servefile.py:14: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13" == 'servefile 0.5.3'
E - servefile 0.5.3
E + /var/tmp/portage/www-servers/servefile-0.5.3-r1/work/servefile-0.5.3/servefile/servefile.py:14: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
run_servefile = <function run_servefile.<locals>._run_servefile at 0x7fe63f744540>
s = <Popen: returncode: 0 args: ['/var/tmp/portage/www-servers/servefile-0.5.3-r...>
standalone = True
version = ('/var/tmp/portage/www-servers/servefile-0.5.3-r1/work/servefile-0.5.3/servefile/servefile.py:14: '
"DeprecationWarning: 'cgi' is deprecated and slated for removal in Python "
'3.13')
tests/test_servefile.py:149: AssertionError
------------------------------------------------------------------------- Captured stdout call -------------------------------------------------------------------------
running /var/tmp/portage/www-servers/servefile-0.5.3-r1/work/servefile-0.5.3/servefile/servefile.py with args ['--version', '-p', '35751']
It seems that the output from the DeprecationWarning
warning is breaking the test.
Would be cool to have that fixed before the next release. Thanks in advance! ๐
Hi,
Do You have a doc explaining the parameters?
Best regards
Holger
Apparently, resume is not supported. this is a minor feature but since I use this software to move remote backups from staging to local for further inspection, not having resume functionality is a pain .... xD
Any HTTP server however small must have resume support.
Thanks for the app btw.
This is a fun little project maybe. ๐
There should be a optional parameter to specify the html responses.
"OK! Thanks for uploading" is a neat message but it would be better if I was able to specify a path to a html file that is sent instead.
On January 1st 2020 ends the python2 support. It would be cool, if the script is usable with python3.
when download chinese file,give bellow error,down fialed.
ABORTED transmission (Reason: 'latin-1' codec can't encode characters in position 43-44: ordinal not in range(256))
how to fix it!
Add the option to download everything in a listdir or subdirectories as .tar
.
When I share files with people I often want to give the option to look at what they're getting before they download everything, and to maybe only download a subdirectory. As the .tar
s in -t
-mode are autogenerated anyway we could use that code + a query parameter in the url like ?tar=1
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.