Code Monkey home page Code Monkey logo

httpy.zip's Introduction

httpy.zip

What is this?

A HTTP server that serves zip files of directories.

Usage

  1. Copy config_example.py to config.py and open it in a text editor.

  2. Edit the route_dirs variable to point to your directory full of totally legal files

    Let's say you have a directory structure like this:

    home/rzr/files
    ├── Memes
    │   └── pepe
    └── pr0n
    

    And you set route_dirs like this:

    route_dirs = {
        '/arr/': '/home/rzr/files'
    }

    You can download a zip of your top level subdirectories:
    http://127.0.0.1:8420/arr/Memes.zip (works)
    http://127.0.0.1:8420/arr/pr0n.zip (works)

    but non-top level subdirectories are not allowed:
    http://127.0.0.1:8420/arr/Memes/pepe.zip (404)

  3. If you want to restrict access to only certain directories/give custom names to the files, point route_dirs to an empty directory and link your directories inside there.

Further setup

You probably want to put this behind a reverse proxy instead of hosting it bare. A sample nginx proxy.d config has been provided to get you started.

FAQ

HTTPS? Authentication?

Use a reverse proxy, see the sample nginx config file.

Why are you running the zip command instead of doing the zipping in Python?

I don't see any advantages to using only Python. Convince me and maybe I'll switch to pure Python.

TODO

  • A way to prevent certain directories from being zipped (perhaps a .nozip file in the directory)

httpy.zip's People

Contributors

udf avatar

Watchers

James Cloos avatar  avatar  avatar

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.