GithubHelp home page GithubHelp logo

servefile's People

Contributors

bitwave avatar hartwork avatar kmohrf avatar masterofjokers avatar pawelchcki avatar rbu avatar sebageek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

servefile's Issues

Last-Modified header is current time

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

  1. lftp downloads each file on each run again
  2. the modification time is locally set to the current time on the server.

This is NOT ACCEPTABLE - FIX ASAP!

Python 3.7.9: "SSL is not available" after installed pyssl

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.

Error "tests/test_servefile.py::test_version_standalone FAILED" with Python 3.11

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! ๐Ÿ™

Documentation

Hi,
Do You have a doc explaining the parameters?
Best regards
Holger

Feature: Resume

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.

Allow custom html responses

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.

Download as .tar in listview

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 .tars in -t-mode are autogenerated anyway we could use that code + a query parameter in the url like ?tar=1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.