No description
Find a file
sdomi ea129b8350 notORM: fix mangling the r array, leading to unexplainable logic issues
ideally we should figure out a consistent prefix for variables, or at least
stop using single-letter names... TBD
2025-09-15 02:07:58 +02:00
.resources template: add datestamp rendering mode 2025-03-06 00:33:18 +01:00
docs docs: mention bump util and future plans 2025-09-14 22:00:59 +02:00
secret + USUŃ KONTO 2020-11-06 00:36:08 +01:00
src notORM: fix mangling the r array, leading to unexplainable logic issues 2025-09-15 02:07:58 +02:00
storage fix secret .gitignore 2021-09-09 18:35:45 +02:00
templates Switch to using #!/usr/bin/env bash 2021-09-22 14:52:03 +02:00
tests tests: add a test for notORM's autoincrement 2025-05-18 17:33:14 +02:00
.dockerignore + docker-compose and other goodies 2021-11-10 23:57:47 +01:00
.gitignore * added socat-only operation mode 2021-05-16 11:10:39 +02:00
.gitlab-ci.yml * fix CI???? 2021-03-09 18:57:10 +01:00
docker-compose.yml + docker-compose and other goodies 2021-11-10 23:57:47 +01:00
Dockerfile docker: hopefully fix 2025-04-02 22:37:33 +02:00
http.sh util/bump: new util 2025-09-14 21:52:25 +02:00
LICENSE.md relicense to BSD 3-Clause 2024-12-23 19:36:03 +01:00
README.md docs, http.sh: document util invocation 2025-09-14 21:42:52 +02:00
tst.sh tst: small QoL invocation fixes 2025-03-04 02:36:06 +01:00

HTTP.sh

the coolest web framework (in Bash) to date.

We now have an IRC channel! Join #http.sh @ irc.libera.chat

Documentation

We have some guides and general documentation in the docs directory. Among them:

Dependencies

Absolutely necessary:

  • Bash (5.x, not interested in backwards compat)
  • either Ncat (not openbsd-nc, not netcat, not nc) or socat, or a combo of both
  • GNU grep/sed

Full list of dependencies: required, optional.

Known faults

  • if ncat fails to bind to [::], change the bind to 127.0.0.1 or 0 in config/master.sh
  • $post_multipart doesn't keep original names - could be fixed by parsing individual headers from the multipart request instead of skipping them all
  • websocket impl isn't properly finished
  • fails with an empty response, instead of throwing 400/500

Variables that we think are cool!

(this data may be slightly outdated. Full docs TODO.)

  • get_data - holds data from GET parameters
    • /?test=asdf -> ${get_data[test]} == "asdf"
  • params - holds parsed data from URL router
    • /profile/test (assuming profile/:name) -> ${params[name]} == "test"
  • post_data - same as above, but for urlencoded POST params
    • test=asdf -> ${post_data[test]} == "asdf"
  • post_multipart - contains paths to uploaded files from multipart/form-data POST requests. WARNING: it doesn't hold field names yet, it relies on upload order for identification
    • first file (in upload order) -> cat ${post_multipart[0]}
    • second file -> cat ${post_multipart[1]}
  • r - misc request data
    • authorization
    • content_boundary
    • content_boundary
    • content_length
    • content_type
    • headers
    • host
    • host_portless
    • ip
    • post
    • proto
    • status
    • uri
    • url
    • user_agent
    • view
    • websocket_key
  • cfg - server and app config - see config/master.sh for more details

Fun stuff

  • To prevent running malicious scripts, by default only scripts with extension .shs can be run by the server, but this can be changed in the config.
  • ${cfg[index]} ignores the above - see config/master.sh
  • Trans rights!
  • SHS stands for Shell Server.