* Apply `topics` push option in post-receive hook
The `topics` value was parsed into the push-options map but never read
by the hook, silently discarding any topics passed via `git push -o
topics=...`. Mirror the existing `title`/`description` handling and
reuse the `gisttopics` validator.
* Docs
Signed-off-by: Thomas Miceli <tho.miceli@gmail.com>
---------
Signed-off-by: Thomas Miceli <tho.miceli@gmail.com>
Co-authored-by: Thomas Miceli <tho.miceli@gmail.com>
Adds an HTTP REST API under /api/v1 with bearer-token auth, served
alongside the existing web UI. The API exposes seven endpoints:
GET /api/v1/user
GET /api/v1/gists
POST /api/v1/gists
GET /api/v1/gists/:uuid
PATCH /api/v1/gists/:uuid
DELETE /api/v1/gists/:uuid
GET /api/v1/gists/:uuid/files/:filename/raw
Auth reuses the existing AccessToken model (extended with a new
ScopeUser permission for /user) and accepts both 'Authorization: Bearer
og_...' and the legacy 'Token og_...' header.
The API is gated by a new 'api-enabled' admin setting (default off) so
deployments must explicitly opt in from Admin Panel → Configuration.
When disabled, requests get a 503 with an actionable hint, and the
access-token settings page shows a banner pointing admins straight to
the toggle.
An embedded OpenAPI 3.1 spec is served at GET /api/v1/openapi.yaml;
import it into Postman / Insomnia / Bruno / openapi-generator for
interactive testing or client generation.
Other UX polish bundled in:
- Settings access-token form now exposes the new User scope and uses
the existing locale.Tr lookups (translations backfilled for zh-CN).
- Language switcher distinguishes 简体中文 vs 繁體中文 instead of both
appearing as '中文'.
- Settings page header tabs translated for zh-CN.
- POST /gists cleans up the on-disk repo when commit/create fails
(previously orphaned).
- visibility=public list excludes private/unlisted gists (regression
guard added).
- Content-Disposition filename in raw responses is RFC-escaped.
Docs: docs/usage/api.md walks through enabling the API, creating a
token, the seven endpoints with curl examples, error codes and v1
limitations.
* ✨ feat(search): search all feature
- add Description field to Gist struct and index it
- extend SearchGistMetadata with Description and Content
- update Bleve and Meilisearch to index and search Description
- modify ParseSearchQueryStr to parse description: and content: keywords
- update templates and i18n for new search options
* Fix test
* Set content by default
Signed-off-by: Thomas Miceli <tho.miceli@gmail.com>
* Config to define default searchable fields
Signed-off-by: Thomas Miceli <tho.miceli@gmail.com>
---------
Signed-off-by: Thomas Miceli <tho.miceli@gmail.com>
Co-authored-by: Thomas Miceli <tho.miceli@gmail.com>