Run make in the project root directory.
redbean-zipfile.com web server has several examples to be further customized:
-
.init.luais 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 toredbean-zipfile.com,filels.luawill 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/.sqlarin the current working directory;
-
-
zipls.luais a naive listing of all contents of a specific zipfile "whole"; -
sqlarls.luais a naive listing of all contents of a specific "SQLite Archive" "whole"; -
zipcat.luais a naive viewer of the contents of a specific zipfile file; -
sqlarls.luais a naive viewer of the contents of a specific "SQLite Archive" file; -
datazip.luais a naive reimplementation of https://datasette.io/ .Read more about the amazing ideas behind datasette.io in those articles:
-
serveis mandatory to enable datazip sqlite3 handling; -
--corsenables cross-origin requests. For more details, see the datasette.io documentation; -
[files ...]programs datazip's allowlist offilesto handle.
(For example,
./redbean-zipfile.com serve github.db)-
databaseis sqlite3 databse file, previously added in the allowlist by the command line parameters; -
sqlis 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 )
[file]if a single filename is provided in the command line,redbean-zipfile.com.init.luais setup to openzipls.luain your browser, as a zip content visualizer.
[files ...]if filenames are provided in the command line,filels.luawill only list those.
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.