mirror of
https://git.sakamoto.pl/laudom/http.sh.git
synced 2026-01-08 18:31:14 +01:00
2.8 KiB
2.8 KiB
File / Directory structure
(alphabetical order; state for 2024-08-05)
configcontains per-vhost configuration settings.config/master.shgets loaded by default,config/<hostname>[:port]gets loaded based on theHostheader.docsis what you're reading now. Hi!!secretis where user data gets stored. think: user accounts and sessions.srccontains the majority of HTTP.sh's code.response/*are files executed based on computed return code.response/200.shis a bit special, because it handles the general "success" path. Refactor pending.account.shis the middleware for user account managementdependencies.*store the list of required and optional deps, newline delimeteredmail.shhas some crude SMTP code, for sending out mailsmime.shcontains a glue function for handling special cases wherefilecommand doesn't return the proper mimetypemisc.shconsists of functions that didn't really fit anywhere else. Of note,html_encode,url_encode,url_decode,headerand various cookie functions all live there for now.notORM.shis, as I said, not an ORMroute.shdefines a small function for handling adding the routesserver.shis where most of the demons livetemplate.shis where the rest of the demons liveworker.shis 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.shis an incomplete WebSocket implementation
storageis likesecret, but you can generally use it for whatevertemplateswill be moved/removed soon (head.shhas 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.)testsis 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!
srcfor various backend codetemplatesfor HTML in our special templating languageviewsfor individual pages / endpointswebrootfor static files, or .shs scripts that don't use the routerconfig.shhas some general, always-included stuffroutes.shconfigures the router; entries should point intoviews/localcfg.shmay be sourced fromconfig.shand contain only local config (useful for developing stuff with others through git, for instance;localcfg.shshould then be added to.gitignore)