{"id":19523447,"url":"https://github.com/empjustine/redbean-zipfile","last_synced_at":"2025-04-26T09:32:39.897Z","repository":{"id":60479845,"uuid":"526715427","full_name":"empjustine/redbean-zipfile","owner":"empjustine","description":"Serve assets in zipfiles inside or outside of Redbean","archived":false,"fork":false,"pushed_at":"2022-09-01T23:02:15.000Z","size":41,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-04T10:47:20.669Z","etag":null,"topics":["cosmopolitan-libc","lua","redbean","zipfile"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/empjustine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-19T18:35:48.000Z","updated_at":"2025-02-24T19:30:50.000Z","dependencies_parsed_at":"2022-09-30T05:50:24.169Z","dependency_job_id":null,"html_url":"https://github.com/empjustine/redbean-zipfile","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"ProducerMatt/redbean-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/empjustine%2Fredbean-zipfile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/empjustine%2Fredbean-zipfile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/empjustine%2Fredbean-zipfile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/empjustine%2Fredbean-zipfile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/empjustine","download_url":"https://codeload.github.com/empjustine/redbean-zipfile/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250967614,"owners_count":21515630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cosmopolitan-libc","lua","redbean","zipfile"],"created_at":"2024-11-11T00:43:28.229Z","updated_at":"2025-04-26T09:32:39.318Z","avatar_url":"https://github.com/empjustine.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redbean-zipfile\n\n## build and run\n\nRun `make` in the project root directory.\n\n`redbean-zipfile.com` web server has several examples to be further customized:\n\n- `.init.lua` is a example of how to handle Redbean's embedded zipfile as a\n  navigable folder structure.\n\n  It also contains code to handle automatically open zipfiles passed as\n  command line parameters.\n\n- `filels.lua`\n\n  - if `[files ...]` are provided as a command line parameter to\n    `redbean-zipfile.com`, `filels.lua` will list the allowlist authorized\n    files.\n\n  - If no command line parameters are provided to `redbean-zipfile.com`, it is\n    a naive listing of all `.zip`/`.cbz`/`.db`/`.sqlar` in the current working\n    directory;\n\n- `zipls.lua` is a naive listing of all contents of a specific zipfile \"whole\";\n\n- `sqlarls.lua` is a naive listing of all contents of a specific \"SQLite Archive\" \"whole\";\n\n- `zipcat.lua` is a naive viewer of the contents of a specific zipfile file;\n\n- `sqlarls.lua` is a naive viewer of the contents of a specific \"SQLite Archive\" file;\n\n- `datazip.lua` is a naive reimplementation of\n  [https://datasette.io/](https://datasette.io/) .\n\n  Read more about the amazing ideas behind datasette.io in those articles:\n\n  - https://simonwillison.net/2017/Nov/13/datasette/\n\n  - https://simonwillison.net/2018/May/20/datasette-facets/\n\n  - https://simonwillison.net/2018/Oct/4/datasette-ideas/\n\n  - https://architecturenotes.co/datasette-simon-willison/\n\n  ### Command line parameters:\n\n  - `serve` is mandatory to enable datazip sqlite3 handling;\n\n  - `--cors` enables cross-origin requests. For more details, see the\n    [datasette.io documentation](https://docs.datasette.io/en/stable/json_api.html#json-api);\n\n  - `[files ...]` programs datazip's allowlist of `files` to handle.\n\n  (For example, `./redbean-zipfile.com serve github.db` )\n\n  ### Query string parameters:\n\n  - `database` is sqlite3 databse file, previously added in the allowlist by\n    the command line parameters;\n\n  - `sql` is a Structured Query Language query statement;\n\n  - adittional parameters are used as named query statement parameters.\n\n  ( For example,\n  http://127.0.0.1:8080/datazip.lua?database=github.db\u0026sql=select%20*%20from%20licenses )\n\n### `redbean-zipfile.com` Command line parameters:\n\n- `[file]` if a single filename is provided in the command line,\n  `redbean-zipfile.com` `.init.lua` is setup to open `zipls.lua`\n  in your browser, as a zip content visualizer.\n\n### `redbean-zipfile.com` `/filels.lua` Command line parameters:\n\n- `[files ...]` if filenames are provided in the command line, `filels.lua`\n  will only list those.\n\n## colophon\n\nThis is a proof of concept showing how to serve _zipfile_ and _sqlite3_ content\nthat might or not be embedded inside [redbean](https://redbean.dev/)'s\n[αcτµαlly pδrταblε εxεcµταblε](https://justine.lol/ape.html) zip file.\n\nThis of course means that the performance is awful (compared to the 10⁶ops\namazing performance you can get by using redbean the intended way), but it's\nstill less awful that layers of brittle FUSE hacks, or nested web servers that\n\\*I\\* used before.\n\nMy current use for this is some massive (both in document size and document\ncount) documentation packages that I want to keep in a file-level\nrandom-access container with file-level compression.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fempjustine%2Fredbean-zipfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fempjustine%2Fredbean-zipfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fempjustine%2Fredbean-zipfile/lists"}