api/ui: Allow per-scratch TTL down to 1m #5

Merged
Ghost merged 1 commits from api-ui-per-scratch-ttl into develop 2026-09-01 16:22:31 -05:00

What

Optional per-scratch TTL on POST /api/scratch and an upload UI control (1m through server max).

Why

Operators and users need shorter (or longer, up to 24h) expirations than the server default for individual scratches.
#4

Test

  • Multipart form ttl and raw-body query ttl (Go duration strings).
  • Omit/empty keeps limits.default_ttl.
  • Bounds: min 1m, max 24h (config.MaxScratchTTL); invalid/out-of-range → 400.
  • /api/config exposes max_ttl (keeps default_ttl); UI select wires FormData ttl.
  • Local: go test -timeout 60s -shuffle=on ./... passed.
  • CI: Go Tests / Build / gofmt green on this PR.
## What Optional per-scratch TTL on `POST /api/scratch` and an upload UI control (1m through server max). ## Why Operators and users need shorter (or longer, up to 24h) expirations than the server default for individual scratches. https://git.s1d3sw1ped.com/s1d3sw1ped/scratchbox/issues/4 ## Test - Multipart form `ttl` and raw-body query `ttl` (Go duration strings). - Omit/empty keeps `limits.default_ttl`. - Bounds: min 1m, max 24h (`config.MaxScratchTTL`); invalid/out-of-range → 400. - `/api/config` exposes `max_ttl` (keeps `default_ttl`); UI select wires `FormData` `ttl`. - Local: `go test -timeout 60s -shuffle=on ./...` passed. - CI: Go Tests / Build / gofmt green on this PR.

Triage (Linus):

Matches the issue scope. Optional ttl (multipart form / raw query), 1m–24h, omit keeps default. UI select wired. Tests cover min/max/omit/invalid. README notes the field. CI green (gofmt, build, go tests). mergeable.

Commit body is thin (URL only) — PR description carries the why. Acceptable for this size.

No Fixes #4 in the merge text; issue will stay open unless you close it. Close #4 when you land this (work is done).

Next action: Eva merge to develop (delete head), then promote to default when you want it on master. Do not leave #4 dangling.

Triage (Linus): Matches the issue scope. Optional `ttl` (multipart form / raw query), 1m–24h, omit keeps default. UI select wired. Tests cover min/max/omit/invalid. README notes the field. CI green (gofmt, build, go tests). mergeable. Commit body is thin (URL only) — PR description carries the why. Acceptable for this size. No `Fixes #4` in the merge text; issue will stay open unless you close it. Close https://git.s1d3sw1ped.com/s1d3sw1ped/scratchbox/issues/4 when you land this (work is done). Next action: Eva merge to develop (delete head), then promote to default when you want it on master. Do not leave #4 dangling.
Ghost added 1 commit 2026-09-01 16:21:27 -05:00
api/ui: Allow per-scratch TTL down to 1m
Format / gofmt (push) Successful in 26s
Format / gofmt (pull_request) Successful in 26s
CI / Build (push) Successful in 33s
CI / Build (pull_request) Successful in 33s
CI / Go Tests (push) Successful in 35s
CI / Go Tests (pull_request) Successful in 35s
ed95ce8295
#4
Ghost force-pushed api-ui-per-scratch-ttl from de465d6818 to ed95ce8295 2026-09-01 16:21:27 -05:00 Compare
Ghost merged commit 8edd6550d6 into develop 2026-09-01 16:22:31 -05:00
Sign in to join this conversation.