summaryrefslogtreecommitdiff
path: root/app/api.go
Commit message (Collapse)AuthorAgeFilesLines
* update org nameChristian Cleberg47 hours1-1/+1
|
* fix: harden HTTP transport, server timeouts and panic pathsChristian Cleberg2026-07-151-11/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | Correctness and security findings surfaced by golangci-lint, plus two latent panics found alongside them. - router: http.ListenAndServe has no timeouts at all (gosec G114), so a slow client could hold a connection and its handler open indefinitely. Replace it with an explicit http.Server carrying read/write/idle timeouts. - httpclient: InstallDAThrottle asserted http.DefaultTransport was a *http.Transport and would panic outright if anything had already wrapped it -- which is precisely what that function does. Check the assertion and fall back to a fresh transport. Expose ProxiedTransport so a configured download-proxy can inherit the same throttle and timeouts instead of silently bypassing them. - cache: the Sys() assertion to *syscall.Stat_t is only valid on unix and would panic elsewhere; skip rotation instead. Indexing Headers["Content-Type"][0] panics when the header is absent; use Headers.Get. Cache files are written 0600 rather than 0700, as they are never executed. - cli, api: check error returns, and exit rather than nil-dereference a file handle that failed to open. SHA-1 and math/rand keep //nolint:gosec with reasons: they are cache-key hashes and random-artwork picks, not security primitives.
* fix: remove russian language throughoutChristian Cleberg2026-07-151-1/+1
|
* fix(api): harden random-art retry loopChristian Cleberg2026-07-141-7/+15
| | | | | | | | | | | | | | | Three bugs in Random(): - The retry loop was unbounded. Only the NSFW path incremented attempt, so a run of DeviantArt errors span forever, hammering the API and risking an egress-IP ban. - string(rand.Intn(999)) converts a rune, not a number: string(65) is "A", not "65". Searches were querying garbage. Use strconv.Itoa. - rand.Intn panics on 0, so an empty result set crashed the handler. Skip empty results. The exhausted-retries error now fires when the loop ends rather than falling through to index an empty slice.
* deps: migrate to github.com/zerolabsco/devianter v0.3.1Christian Cleberg2026-07-141-2/+2
| | | | | | | | | | Repoint the import path from git.macaw.me/skunky/devianter, replacing a placeholder v0.0.0 require that had no go.sum entry and did not resolve. v0.3.1 reorders the last two return values of PerformSearch, Group.Get and Group.Gallery from (..., error, Error) to (..., Error, error); adapt the call sites. The two types differ, so the compiler enforces this.
* Add da.opnxng.com + lost-skunk.cc is now in Finlandlost+skunk2025-04-071-0/+0
|
* Переключатель кеша в озу, небольшие ↵lost+skunk2025-02-221-1/+7
| | | | улучшения ксс, фикс нсфв, фикс максимального размера кеша
* v1.3.2v1.3.2lost+skunk2024-09-231-46/+45
|
* отображение ошибокlost+skunk2024-09-041-1/+5
|
* Два API-эндпоинтаlost+skunk2024-09-031-11/+50
|
* instance list updatelost+skunk2024-09-021-0/+34