mirror of
https://git.sakamoto.pl/laudom/http.sh.git
synced 2025-09-17 15:33:44 +02:00
2.8 KiB
2.8 KiB
File / Directory structure
(alphabetical order; state for 2024-08-05)
config
contains per-vhost configuration settings.config/master.sh
gets loaded by default,config/<hostname>[:port]
gets loaded based on theHost
header.docs
is what you're reading now. Hi!!secret
is where user data gets stored. think: user accounts and sessions.src
contains the majority of HTTP.sh's code.response/*
are files executed based on computed return code.response/200.sh
is a bit special, because it handles the general "success" path. Refactor pending.account.sh
is the middleware for user account managementdependencies.*
store the list of required and optional deps, newline delimeteredmail.sh
has some crude SMTP code, for sending out mailsmime.sh
contains a glue function for handling special cases wherefile
command doesn't return the proper mimetypemisc.sh
consists of functions that didn't really fit anywhere else. Of note,html_encode
,url_encode
,url_decode
,header
and various cookie functions all live there for now.notORM.sh
is, as I said, not an ORMroute.sh
defines a small function for handling adding the routesserver.sh
is where most of the demons livetemplate.sh
is where the rest of the demons liveworker.sh
is the literal embodiment of "we have cron at home"; workers are just background jobs that run every n minutes; you can also start and stop them on will! fancyws.sh
is an incomplete WebSocket implementation
storage
is likesecret
, but you can generally use it for whatevertemplates
will be moved/removed soon (head.sh
has nothing to do with the current templating system; it has some handlers for remaking things you put intometa[]
array into HTML<head>
fields. Should not be used, at least not in its current form.)tests
is where all the tests live!
The actually important files are:
http.sh
- run this and see what happenstst.sh
- the test suite
suggested skeleton structure in app/
FYI: this is merely a suggestion. ./http.sh init
will create some of those directories for you,
but it's fine to move things around. A lot of it can be changed within config/master.sh
, even the
directory name itself!
src
for various backend codetemplates
for HTML in our special templating languageviews
for individual pages / endpointswebroot
for static files, or .shs scripts that don't use the routerconfig.sh
has some general, always-included stuffroutes.sh
configures the router; entries should point intoviews/
localcfg.sh
may be sourced fromconfig.sh
and contain only local config (useful for developing stuff with others through git, for instance;localcfg.sh
should then be added to.gitignore
)