about summary refs log tree commit diff stats
path: root/bonus
Commit message (Collapse)AuthorAgeFilesLines
* bonus: simplify and fix addurimethodhrdl2025-05-041-11/+15
| | | | | | | | This fixes a number of issues with addurimethod. - Use cat in the absence of PAGER - Avoid unwanted : in scheme and dropped ? from from cgi - Allow replacing previously defined schemes - Rework num_spaces computation based on bptato's suggestion
* Fix typosbptato2025-05-041-1/+1
|
* libfetch-http: update commentbptato2025-04-171-4/+0
| | | | yeah
* http: replace with newhttpbptato2025-04-145-1342/+667
| | | | | I think it works well enough at this point. If it doesn't, somebody will complain :)
* newhttp: drop unbrotlibptato2025-04-132-94/+1
| | | | Actually, it may be fine to leave it out for now.
* newhttp: stop reading when Content-Length is exceededbptato2025-04-101-10/+13
|
* tinfl: small cleanupbptato2025-03-312-11/+6
|
* newhttp: send connected directly after establishing connectionbptato2025-03-261-5/+5
|
* bonus: update makefile, filei docsbptato2025-03-252-6/+5
|
* newhttp: clean up state machine, fix a brotli bugbptato2025-03-241-152/+179
| | | | | | | | | The issue with brotli was that we were calling toOpenArray with a uint, and that doesn't really work in Nim (even though it looks like it does). So I've removed the circular buffer from brotli and made oqoff an int for tinfl (which unlike brotli actually needs a circular buffer).
* newhttp: add brotli supportbptato2025-03-222-4/+96
|
* newhttp: explicitly ignore trailersbptato2025-03-221-15/+35
| | | | | Others don't support them either. (Firefox claims to, but only really decodes Server-Timing for debugging.)
* newhttp: drop libcurl dependencybptato2025-03-212-167/+199
| | | | Now it only does HTTP/1.1, with Connection: close.
* bonus: add new http handler with tinflbptato2025-03-205-2/+1270
| | | | not much else is done yet, but it's a start
* CHA_CONFIG_DIR -> CHA_DIRbptato2024-12-271-1/+1
| | | | | | | It isn't really limited to config. It just happens to be in XDG_CONFIG_HOME because XDG basedirs suck. (W3M_DIR works similarly.)
* Update docs, w3m.tomlbptato2024-12-091-0/+1
|
* git.cgi: misc improvementsbptato2024-11-271-3/+5
|
* urlenc: strip a trailing newline from input, etcbptato2024-11-011-1/+1
| | | | | | | | | * make it so 'echo "$var\n" | urlenc' works as expected * add special query encode set * set default encode set to form data * document encode sets in help message also, remove a redundant percentEncode implementation from gopher2html
* config: refactor, accept more possible config dirsbptato2024-10-283-13/+5
| | | | | | | | | | | | | | | | | | | | | I'm starting to favor dotfiles over XDG basedirs, but there's no reason why we couldn't have both. So now the search path is: 0. if config was set through -C, use that 1. $CHA_CONFIG_DIR is set -> $CHA_CONFIG_DIR/config.toml 2. $XDG_CONFIG_HOME is set -> $XDG_CONFIG_HOME/chawan/config.toml 3. ~/.config/chawan/config.toml exists -> use that 4. ~/.chawan/config.toml exists -> use that Notably, this makes it so the default directory is ~/.chawan *if* you don't have an existing config.toml file. So in that case known_hosts will be placed in ~/.chawan/known_hosts. However, configurations with a config in ~/.config/chawan/config.toml continue to work as expected, as for those the known_hosts file remains inside ~/.config/chawan/. Finally, I've added a default user CGI directory to reduce friction in setting CGI up. (Like known_hosts, it's also relative to whatever config dir you have.)
* Add `nc' tool & adjust finger/spartan to use itbptato2024-10-121-13/+15
| | | | | | | | | Simple netcat clone, useful for portable scripts. Especially because some netcats will close the connection as soon as I close stdin... this one only quits when either stdout or the socket refuses new data. Also, it uses our standard TCP connection routine, meaning it respects ALL_PROXY. (i.e. now spartan works with socks5 too)
* resize: use srgbbptato2024-10-091-2/+2
| | | | | | | | since that's our input color space (Actually, mainstream browsers seem to use linear scaling nevertheless. But apparently that produces surprising results in some cases, and stbir can do srgb, so might as well use it.)
* bonus: add stbir2, readme, makefilebptato2024-10-088-6/+260
|
* filei: misc updatesbptato2024-10-041-2/+14
| | | | | | * encode path URLs * accept directories without trailing slash * sort file names
* bonus: add prototype gallery scriptbptato2024-09-291-0/+78
| | | | see header for usage
* git.cgi: add git blamebptato2024-09-011-11/+63
|
* git.cgi: misc improvementsbptato2024-08-011-21/+27
| | | | | | | * highlight shortened commit hashes (up to 7 chars) * send status * refactor cgi commands * support git branch -a
* git.cgi: add [drop] to stash menubptato2024-07-031-1/+3
|
* git.cgi: use formsbptato2024-06-301-4/+13
| | | | it's safer this way
* git.cgi: add git stash list, switch -> branchbptato2024-06-081-20/+30
| | | | | | | | | * gitcha stash list special processing * gitcha switch no longer opens the branch view; it is now opened by gitcha branch * make gitcha branch UI consistent with the rest of the script. (the idea is that clicking on refs does not modify the repo, only action links like (switch) or (apply).)
* pager: rework D/discard bufferbptato2024-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | | The previous solution had the issue that it switched between "delete buffer, then move back" and "delete buffer, then move forward" depending on whether the buffer was the root of the buffer tree, which made its behavior quite unpredictable. Now the pager (sort of) remembers the direction you are coming from, and D moves in that direction. So e.g.: * Enter, D just moves back to where you were coming from (as before) * Comma, D deletes the previous buffer, then returns to the current buffer If no buffer exists in the target direction, then we alert. Also, new commands are: `d,' `d.'. They do the same thing the non-d-prefixed variations do, but also delete the current buffer. Useful if you're no longer sure where you are coming from, but know where you want to go. (`d,' in particular is equivalent to w3m's `B'.)
* ansi2html: support passing titlesbptato2024-03-291-8/+5
| | | | | | | Use content type attributes so e.g. git.cgi can set the title even with a text/x-ansi content type. (This commit also fixes some bugs in content type attribute handling.)
* git.cgi: fix on older QJS versionsbptato2024-03-291-1/+1
| | | | Array.prototype.at is not present in previous QJS releases.
* config: improve input systembptato2024-03-261-83/+98
| | | | as described in <https://todo.sr.ht/~bptato/chawan/6>
* git.cgi: add "view" link to git switch panelbptato2024-03-251-1/+3
|
* git.cgi: add custom git switchbptato2024-03-241-16/+35
| | | | just a clickable UI for switching branches
* ansi2html: add separate switch for "standalone"bptato2024-03-211-1/+1
| | | | | this way its output can be embedded into documents without a pointless DT declaration
* git.cgi: show command in title for logbptato2024-03-201-0/+3
|
* bonus: add git.cgibptato2024-03-191-0/+64
| | | | just for clickable git log hashes
* trans.cgi: set content type to text/x-ansibptato2024-03-161-2/+2
|
* pager: add "open in editor" keybinding (sE)bptato2024-03-141-1/+9
| | | | | | only for source for now, rendered document is a bit more complicated (also, get rid of useless extern/editor module)
* bonus/w3m.toml: emacs-style page-up/downbptato2024-03-011-4/+6
| | | | this is more or less how it works in w3m
* magnet.cgi: fix quotingbptato2024-02-131-1/+1
|
* magnet.cgi: use urldec from libexec dirbptato2024-02-111-16/+6
|
* Re-design word handling, add e, E, W, B, etc.bptato2024-01-191-1/+1
| | | | | | | | | | | | * Add functions for moving to the beginning/end of words (vi `b', `e'). * As it turns out, there are many possible interpretations of what a word is. Now we have a function for each reasonable interpretation, and the default settings match those of vi (and w3m in w3m.toml). (Exception: it's still broken on line boundaries... TODO) * Remove `bounds` from lineedit, it was horrible API design and mostly useless. In the future, an API similar to what pager now has could be added. * Update docs, and fix some spacing issues with symbols in the tables.
* cha-http-libfetch: fix incorrect usage of strncatbptato2024-01-111-14/+3
| | | | | | | strncat does not work like that :P Luckily, BSD has strlcat which does. (While we're at it, remove the unused PDIE macro.)
* Add urlenc, urldec; fix a URL encoding bug; improve trans.cgibptato2024-01-081-12/+20
| | | | | | | | | | * Fix incorrect internal definition of the fragment percent-encode set * urlenc, urldec: these are simple utility programs mainly for use with shell local CGI scripts. (Sadly the printf + xargs solution is not portable.) * Pass libexec directory as an env var to local CGI scripts * Update trans.cgi to use urldec and add an example for combining it with selections
* bonus: add libfetch HTTP backendbptato2023-12-142-0/+163
| | | | | | | It has roughly zero utility, but maybe it's a good demonstration of local CGI? (TODO: add libfetch FTP too, that might actually be useful.)
* bonus: add magnet.cgibptato2023-12-112-0/+78
|
* Add support for gemini by default, update readmebptato2023-12-106-947/+0
| | | | | No need to leave gemini support in the bonus folder. Still TODO: proxy support.
* Enable finger protocol by defaultbptato2023-12-101-37/+0
| | | | | | * Add a default urimethodmap that points finger: to cha-finger * Install cha-finger to /usr/local/libexec/cha/cgi-bin by default * cha-finger: use ALL_PROXY if given, die if curl is not installed