diff options
author | bptato <nincsnevem662@gmail.com> | 2024-02-14 16:03:53 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-02-14 16:04:32 +0100 |
commit | 84ebec210b89e5925917dc6d6bab31007250e9af (patch) | |
tree | e62be83a61e1c3f78220b8cde5d19c4cceb8fb26 /doc | |
parent | 5abd3740cf9a9edd283acf63f22dfcf4afab9606 (diff) | |
download | chawan-84ebec210b89e5925917dc6d6bab31007250e9af.tar.gz |
Update docs
Diffstat (limited to 'doc')
-rw-r--r-- | doc/localcgi.md | 29 | ||||
-rw-r--r-- | doc/mime.types.md | 2 | ||||
-rw-r--r-- | doc/urimethodmap.md | 15 |
3 files changed, 25 insertions, 21 deletions
diff --git a/doc/localcgi.md b/doc/localcgi.md index 1a0d9021..f5891207 100644 --- a/doc/localcgi.md +++ b/doc/localcgi.md @@ -20,11 +20,12 @@ Further notes on processing CGI paths: * The URL must be opaque, so you must not add a double slash after the scheme. e.g. `cgi-bin://script-name` will NOT work, only `cgi-bin:script-name`. * Paths beginning with `/cgi-bin/` or `/$LIB/` are stripped of this segment - automatically. So e.g. `file:///cgi-bin/script-name` becomes + automatically. So e.g. `cgi-bin:/cgi-bin/script-name` becomes `cgi-bin:script-name`. -* If `extern.w3m-cgi-compat` is true, file: URLs are converted to cgi-bin: URLs - if the path name starts with `/cgi-bin/`, `/$LIB/`, or the path of a local - CGI script. +* If `external.w3m-cgi-compat` is true, file: URLs are converted to cgi-bin: + URLs if the path name starts with `/cgi-bin/`, `/$LIB/`, or the path of + a local CGI script. Note: this is unsafe, please do not use it unless you + must. * Absolute paths are accepted as e.g. `cgi-bin:/path/to/cgi/dir/script-name`. Note however, that this only works if `/path/to/cgi/dir` has already been specified as a CGI directory in `external.cgi-dir`. @@ -32,7 +33,7 @@ Further notes on processing CGI paths: Note that this is different from w3m's cgi-bin functionality, in that we use a custom scheme for local CGI instead of interpreting all requests to a designated path as a CGI request. (This incompatibility is bridged over when -`external.cgi-dir` is true.) +`external.w3m-cgi-compat` is true.) ## Headers @@ -136,8 +137,8 @@ For requests originating from a urimethodmap rewrite, Chawan will also set the parsed URL's parts as environment variables. Use of these is highly encouraged, to avoid exploits originating from double-parsing of URLs. -Let example://username:password@host.org:1234/path/name.html?example be the -original URL. Then: +e.g. if example://username:password@example.org:1234/path/name.html?example +is the original URL, then: * `MAPPED_URI_SCHEME=` the scheme of the original URL, in this case `example`. * `MAPPED_URI_USERNAME=` the username part, in this case `username`. If no @@ -190,16 +191,24 @@ redirects stderr to /dev/null. ### My script is returning a "no local-CGI directory configured" error message. -Configure a local-CGI directory using `external.cgi-dir`. +Currently, the default setting includes a cgi-bin directory at +`$(which cha)/../libexec/chawan/cgi-bin`, which usually looks something like +`/usr/local/libexec/chawan/cgi-bin`. You only get the above message if you +intentionally set the cgi-dir setting to an empty array. (This will likely break +everything else too, so do not.) + +To change the default local-CGI directory, use the `external.cgi-dir` option. e.g. you could add this to your config.toml: ```toml [external] -cgi-dir = "/usr/local/libexec/chawan/cgi-bin" +cgi-dir = ["~/cgi-bin", "${%CHA_LIBEXEC_DIR}/cgi-bin"] ``` -and then put your script in `/usr/local/libexec/chawan/cgi-bin`. +and then put your script in `$HOME/cgi-bin`. Note the second element in the +array; if you don't add it, the default CGI scripts (including http, https, +etc...) will not work. ### My script is returning a "Failed to execute script" error message. diff --git a/doc/mime.types.md b/doc/mime.types.md index 7d078b31..61542401 100644 --- a/doc/mime.types.md +++ b/doc/mime.types.md @@ -44,7 +44,7 @@ Chawan only uses mime.types files for finding mailcap entries; buffers use an internal mime.types file for content type detection instead. The default mime.types file only includes file formats that buffers can handle, -which is rather limited (at the time of writing, 5 file formats). Therefore it +which is rather limited (at the time of writing, 7 file formats). Therefore it is highly recommended to configure at least one external mime.types file if you use mailcap. <!-- MANON diff --git a/doc/urimethodmap.md b/doc/urimethodmap.md index a57f36b7..a2047eb2 100644 --- a/doc/urimethodmap.md +++ b/doc/urimethodmap.md @@ -98,20 +98,15 @@ urimethodmap = "urimethodmap" ### In urimethodmap -#### gmifetch - -For the following example, it is recommended to set a text/gemini handler -in your mailcap file. See <!-- MANOFF -->[mailcap](mailcap.md)<!-- MANON --> -<!-- MANON **cha-mailcap**(5) MANOFF --> for details. +#### magnet.cgi ``` -# Use the `gmifetch` CGI program to retrieve files through the gemini protocol. -gemini: /cgi-bin/gmifetch?%s +# Use the `magnet.cgi` CGI shell script to pass magnet links to Transmission. +magnet: /cgi-bin/magnet.cgi?%s ``` -`gmifetch` can be found in the `bonus/` directory. But you could write a -local CGI wrapper for any other gemini document downloader, and it would -work just fine. +`magnet.cgi` can be found in the `bonus/` directory. You can also write a +local CGI wrapper to pass the links to your BitTorrent client of choice. #### dict |