Commit Graph
27 Commits
Author SHA1 Message Date
aykhans d08b6dc222 refactor: migrate Charm libraries to v2
Import paths moved to charm.land/*/v2 and the v1 paths no longer resolve.
Ports View() -> tea.View, AltScreen/MouseMode to View fields, KeyPressMsg,
and the new progress/viewport constructors. Styled output outside Bubble
Tea switched to lipgloss.Print* because v2 downsamples colour at the output
layer. vendorHash refreshed.
2026-08-17 17:21:13 +04:00
aykhans e83e9346a3 perf: drop redundant resp.Reset in worker loops
fasthttp resets the response at the top of every HostClient.Do, so
resetting it in the worker loop only repeats that work once per request.
2026-08-10 00:10:27 +04:00
aykhans 01b5233167 perf: replace status code string map with an indexed table 2026-08-10 00:01:16 +04:00
aykhans 755545d838 perf: cut per-request allocations in the request generator
- Reuse value slices in place instead of clear()+realloc when a map's
  key set is static (skipped when scripts may mutate the maps).
- Use SetBodyString to drop the []byte(Body) copy, build the Cookie
  header with a strings.Builder, and skip QueryArgs when no params.
- Cache the values map when all values are literal, and share one empty
  map when none are configured.
- Reuse a single bytes.Buffer across template renders per worker.
2026-08-02 20:11:56 +04:00
aykhans f4d13d83aa fix(logging): match log levels case-sensitively 2026-07-23 00:15:21 +04:00
aykhans 80a8ba1d59 feat(logging): add runtime log levels, response logging, and progress/log-file controls
- --log-level (comma-separated string: info, error): pick which logs are emitted;
  the level set is resolved once, up front
- Log responses at the info level: full self-contained JSON to a file or stderr,
  a compact "status duration | body" summary in the TUI log box
- Route logs independently of the progress display: the TUI log box when it runs,
  stderr when piped, or a file via --log-file/-w (parent dir validated up front)
- Replace --quiet with --progress (bar | none, default bar): progress and logs are
  now independent — progress=none still shows the log box; quiet == progress=none
  with an empty log level
- Rename the internal "message" concept to "log" (runtimeLog, runtimeLogger, ...)
2026-07-22 23:20:14 +04:00
aykhans dcb0e3171f refactor: split sarin.go into runner.go and worker.go 2026-04-17 16:14:32 +04:00
aykhans 2eebac68c9 feat: add double Ctrl+C hard-kill and split TUI into tui.go
First signal cancels the main context; second releases the terminal
and exits 130, unblocking shutdown when captcha polls or user scripts
ignore context. Also moves the bubbletea models and streamProgress
out of sarin.go into a new tui.go.
2026-04-17 16:03:03 +04:00
aykhans 8577c771e4 feat: add CaptchaDecodeError type and retry transient HTTP errors during captcha polling 2026-04-12 22:03:21 +04:00
aykhans c839b71c9e refactor: rename CaptchaTimeoutError to CaptchaPollTimeoutError and separate HTTP client timeout from poll timeout 2026-04-12 21:09:24 +04:00
aykhans cea692cf1b feat: add json_Object and json_Encode template funcs 2026-04-12 04:42:52 +04:00
aykhans 1bd58a02b7 refactor: tighten captcha poll loop and document solver funcs 2026-04-12 01:10:20 +04:00
aykhans 006029aad1 feat: add captcha solving template funcs for 2Captcha, Anti-Captcha, and CapSolver 2026-04-11 21:29:57 +04:00
aykhans 44c35e6681 perf: reduce memory allocations in request generator 2026-03-22 22:26:03 +04:00
aykhans 026d05f1bf chore: bump Go to 1.26.1 and golangci-lint to v2.11.2; fix typos and lint nolints 2026-03-10 02:32:40 +04:00
aykhans 1f06b43b06 feat(template): add time/crypto helpers and file_Read function; document new template funcs 2026-02-26 21:50:36 +04:00
aykhans 61af28a3d3 Override Methods and Bodies instead of appending in Config.Merge 2026-02-15 16:27:36 +04:00
aykhans d346067e8a Rename Append to Merge, replace strings_Join with slice_Join, and auto-detect non-TTY output
- Rename Append to Merge on Cookies, Headers, and Params types and simplify Parse to use direct append
- Replace strings_Join(sep, ...values) with slice_Join(slice, sep) for consistency with slice-based template functions
- Auto-enable quiet mode when stdout is not a terminal
- Remove ErrCLINoArgs check to allow running sarin without arguments
- Add -it flag to Docker examples in docs
2026-02-15 02:56:32 +04:00
aykhans f0606a0f82 Add Lua and JavaScript scripting documentation 2026-02-14 03:21:52 +04:00
aykhans 3be8ff218c Replace common.ToPtr with Go 1.26 builtin new and add go fix to CI 2026-02-13 18:56:10 +04:00
aykhans c1584eb47b Remove unused functions and unexport internal sentinel error 2026-02-09 00:06:01 +04:00
aykhans 6a713ef241 Build request data through RequestData struct instead of fasthttp directly
Refactor request generators to populate a script.RequestData intermediate struct, then apply it to fasthttp.Request in one step. This eliminates the round-trip conversion (fasthttp → RequestData → fasthttp) when scripts are enabled. Remove the URL field from RequestData and the now-unused fasthttp conversion functions from chain.go.
2026-02-08 03:52:39 +04:00
aykhans 6dafc082ed Introduce structured error types and bump Go/linter versions
Replace ad-hoc fmt.Errorf/errors.New calls with typed error structs across config, sarin, and script packages to enable type-based error handling. Add script-specific error handlers in CLI entry point. Fix variable shadowing bug in Worker for scriptTransformer. Bump Go to 1.25.7 and golangci-lint to v2.8.0.
2026-02-08 02:54:54 +04:00
aykhans 533ced4b54 add scripting js/lua 2026-01-28 14:21:08 +04:00
aykhans 81f08edc8d Add file upload support with body_FormData and file_Base64 functions
- Add FileCache for caching local files and remote URLs in memory
- Update body_FormData to accept variadic key-value pairs with file support
  - Use @ prefix for file paths (local or HTTP/HTTPS URLs)
  - Use @@ to escape literal @ values
- Add file_Base64 function for Base64 encoding files
- Update documentation with new syntax and examples
2026-01-17 20:27:22 +04:00
aykhans 27bc8f2e96 Add URL path templating support with validation and documentation 2026-01-11 19:05:58 +04:00
aykhans 2d7ba34cb8 v1.0.0: here we go again 2026-01-10 17:06:25 +04:00