KAPLA-FCGI(1)
π KAPLA-FCGI(1) π
okay bestie, welcome to the Kapla Manual β section 1, the FastCGI responder chapter. Grab a lil snack, weβre serving ERIS blocks and decoded content over HTTP and itβs giving main character energy. β¨
π NAME π
kapla-fcgi β Serve ERIS blocks and content over HTTP by starting a FastCGI responder. Thatβs the whole assignment, no cap. π«Ά
π¦ SYNOPSIS π¦
kapla fcgi [--port=PORT] [--socket=ERIS_UNIX_SOCKET] [OPTION]β¦
Kapla can run a FastCGI responder for serving blocks or decoded content over HTTP. Literally iconic behavior. π
The Kapla FastCGI responder speaks to the Kapla server (see the serve command) and listens for connections from a web server via TCP on the specified port. The web server forwards requests to the Kapla FastCGI responder, and that responder replies with blocks or decoded content from the Kapla server. Clean, simple, slay. πΈ
π WEB SERVER CONFIGURATION π
To use the Kapla FastCGI responder, you need to configure your web server appropriately by forwarding requests to the FastCGI responder and setting the FastCGI parameter KAPLA, which configures how Kapla handles the request. This is the setup part, bestie β do not skip it. π
The KAPLA parameter can be set to the following values:
n2rβ Allow blocks to be de-referenced using RFC 2169 semantics.GETrequests to the endpoint will attempt to de-reference the block specified in the query string (FastCGI parameterQUERY_STRING). The block references must be provided as URNs using theblake2bscheme (e.g.urn:blake2b:H77AGSYKAVTQPUHODJTQA7WZPTWGTTKLRB2GLMF5H53NEKFJ3FUQ). π₯n2r+decodeβ Allow blocks and ERIS content to be decoded using RFC 2169 semantics.GETrequests to the endpoint for URNs with schemesblake2banderiswill be de-referenced/decoded. This one ate. πmountβ Mount the entire universe of possible ERIS read capabilities at the endpoint. The initial segment of thePATH_INFOparameter must be an ERIS read capability. ERIS-FS file-systems are decoded and can be browsed using an auto-generated HTML index. Big βwhole universeβ energy. π
π EXAMPLE WEB SERVER CONFIGURATION: nginx π
Here are example location blocks for the nginx HTTP server. Copy-paste responsibly, bestie. π§
location /uri-res/N2R {
fastcgi_pass localhost:9000;
fastcgi_buffering off;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param KAPLA "n2r+decode";
}
location /eris/ {
fastcgi_pass localhost:9000;
fastcgi_buffering off;
fastcgi_param KAPLA "mount";
fastcgi_split_path_info ^(/eris/)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
The curious reader and admin may be interested in setting up nginx caching for decoded/resolved content. If you do so, please share your configurations and findings! π
Fr fr, sharing configs is community service and itβs lowkey iconic.
π§ EXAMPLE WEB SERVER CONFIGURATION: httpd π§
Here are example location blocks for the OpenBSD httpd server. Yes, httpd bestie, we see you. π
location "/uri-res/N2R" {
fastcgi {
socket tcp localhost 9000
param "KAPLA" "n2r"
}
}
location "/eris/*" {
request strip 1
fastcgi {
socket tcp localhost 9000
param "KAPLA" "mount"
}
}
This makes blocks available at the endpoint /uri-res/N2R and mounts ERIS content at /eris/. Periodt. π
β STANDARDS β
- FastCGI Speficication β
http://www.fastcgi.com/devkit/doc/fcgi-spec.html - RFC 2169 - A Trivial Convention for using HTTP in URN Resolution β
https://datatracker.ietf.org/doc/html/rfc2169 - ERIS over HTTP β
https://eris.codeberg.page/eer/http.xml
π OPTIONS π
-p PORT,--port=PORTβ Port number to listen for FastCGI requests (absent=9000, defaults to9000). The9000is not a drill. π₯-s ERIS_UNIX_SOCKET,--socket=ERIS_UNIX_SOCKETβ Unix socket where the ERIS block store is listening. (absent=$XDG_STATE_HOME/kapla/eris.sock,$HOME/.local/state/kapla/eris.sock,/var/lib/kapla/eris.sockorERIS_UNIX_SOCKETenv). Itβs giving βfind the socket, find the vibes.β π¦
π₯ COMMON OPTIONS π₯
--color=WHENβ Colorize the output.WHENmust be one ofauto,alwaysornever. (absent=auto)--help[=FMT]β Show this help in formatFMT. The valueFMTmust be one ofauto,pager,grofforplain. Withauto, the format ispagerorplainwhenever theTERMenv var isdumbor undefined. (default=auto)-q,--quietβ Be quiet. Takes over-vand--verbosity. Shhh era. π€«-v,--verboseβ Increase verbosity. Repeatable, but more than twice does not bring more. We love a bounded queen. π--verbosity=LEVELβ Be more or less verbose.LEVELmust be one ofquiet,error,warning,infoordebug. Takes over-v. (absent=warningorKAPLA_LOG_LEVELenv)--versionβ Show version information. The βwho am Iβ of it all. β
π EXIT STATUS π
kapla fcgi exits with:
0β on success. We love a happy ending. π123β on indiscriminate errors reported on standard error.124β on command line parsing errors.125β on unexpected internal errors (bugs).
πΈ ENVIRONMENT πΈ
These environment variables affect the execution of kapla fcgi:
ERIS_UNIX_SOCKETβ Unix socket where ERIS block store is listening.KAPLA_LOG_LEVELβ Set the log level.
π SEE ALSO π
httpd(1)kapla(1)kapla-serve(1)
sign-off time, bestie: this was KAPLA-FCGI(1) from the Kapla Manual, version Kapla 0.4.0. No date in the footer, just vibes and FastCGI excellence. mwah ππ«Ά
π¦ where this page comes from
- nixpkgs unstable: ocaml5.5.1-kapla 0.4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms