Git Product home page Git Product logo

redbean-zipfile's Introduction

redbean-zipfile

build and run

Run make in the project root directory.

redbean-zipfile.com web server has several examples to be further customized:

  • .init.lua is a example of how to handle Redbean's embedded zipfile as a navigable folder structure.

    It also contains code to handle automatically open zipfiles passed as command line parameters.

  • filels.lua

    • if [files ...] are provided as a command line parameter to redbean-zipfile.com, filels.lua will list the allowlist authorized files.

    • If no command line parameters are provided to redbean-zipfile.com, it is a naive listing of all .zip/.cbz/.db/.sqlar in the current working directory;

  • zipls.lua is a naive listing of all contents of a specific zipfile "whole";

  • sqlarls.lua is a naive listing of all contents of a specific "SQLite Archive" "whole";

  • zipcat.lua is a naive viewer of the contents of a specific zipfile file;

  • sqlarls.lua is a naive viewer of the contents of a specific "SQLite Archive" file;

  • datazip.lua is a naive reimplementation of https://datasette.io/ .

    Read more about the amazing ideas behind datasette.io in those articles:

    Command line parameters:

    • serve is mandatory to enable datazip sqlite3 handling;

    • --cors enables cross-origin requests. For more details, see the datasette.io documentation;

    • [files ...] programs datazip's allowlist of files to handle.

    (For example, ./redbean-zipfile.com serve github.db )

    Query string parameters:

    • database is sqlite3 databse file, previously added in the allowlist by the command line parameters;

    • sql is a Structured Query Language query statement;

    • adittional parameters are used as named query statement parameters.

    ( For example, http://127.0.0.1:8080/datazip.lua?database=github.db&sql=select%20*%20from%20licenses )

redbean-zipfile.com Command line parameters:

  • [file] if a single filename is provided in the command line, redbean-zipfile.com .init.lua is setup to open zipls.lua in your browser, as a zip content visualizer.

redbean-zipfile.com /filels.lua Command line parameters:

  • [files ...] if filenames are provided in the command line, filels.lua will only list those.

colophon

This is a proof of concept showing how to serve zipfile and sqlite3 content that might or not be embedded inside redbean's αcτµαlly pδrταblε εxεcµταblε zip file.

This of course means that the performance is awful (compared to the 10⁶ops amazing performance you can get by using redbean the intended way), but it's still less awful that layers of brittle FUSE hacks, or nested web servers that *I* used before.

My current use for this is some massive (both in document size and document count) documentation packages that I want to keep in a file-level random-access container with file-level compression.

redbean-zipfile's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

redbean-zipfile's Issues

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.