8 Commits
Author SHA1 Message Date
lucio cc26953d5e Add POST /api/links REST endpoint for short-link creation
Programmatic short-link creation that shares the same bearer key as the
MCP endpoint. Registered only when [mcp].enabled is true and api_key is
set, so a misconfigured server never exposes the route unauthenticated;
unauthenticated visitors hitting /api/links get a plain 404.

- POST /api/links accepts {"url","slug?"}, returns 201/200 with the
  same snake_case payload shape as the MCP create_link tool.
- Constant-time Bearer / X-API-Key auth (reuses mcpAPIKeyAuth helper).
- 4 KB body cap, DisallowUnknownFields, URL auto-scheme, dedupe on URL.
- 13 unit tests cover auth, validation, dedupe, and duplicate-slug.
2026-06-08 21:17:39 -07:00
lucioandClaude Opus 4.8 87477556e2 Redesign admin Pastes page as Xiaohongshu-style cards with previews
- Replace the pastes table with a masonry card grid: each card shows the
  paste's first image as a thumbnail, a short plain-text summary, meta badges,
  and Copy link / Edit / QR / Delete actions.
- Clicking anywhere on a card (except the action buttons) opens an in-page
  preview modal with the rendered paste in an iframe; it can be expanded to the
  main content area or closed (Esc/backdrop/button). Keyboard accessible.
- Generate and cache 512px (long side) JPEG thumbnails for uploaded images on
  first request (GET /uploads/thumb/{filename}); also generated at upload time
  and invalidated on resize/delete. WebP falls back to the original.
- Sync the public paste pages (bin_view, bin_token) to the dark theme so they
  match the rest of the app and the preview iframe.
- Relax framing headers to same-origin (X-Frame-Options SAMEORIGIN,
  frame-ancestors 'self') so the same-origin preview iframe can load; cross-site
  framing stays blocked.
- Document the new thumbnail route in the README routes table.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-05 00:23:51 -07:00
lucio 4ca04bf8ed Add authenticated MCP endpoint 2026-05-22 01:14:51 -07:00
lucioandClaude Opus 4.6 1b91014d1c Preserve original upload filenames, share upload JS, polish UI, update docs
- Adds an "uploads" SQLite table (filename → original_name) so the user's
  original filename is preserved and used in Content-Disposition headers and
  the admin listing instead of the on-disk hex name.
- Extracts shared upload logic to static/upload.js (window.GlimmerUpload),
  deduplicating ~80 lines between the uploads page and the paste editor.
- Adds size hints on upload buttons, an extension chip + original name in the
  uploads table, and a .ext-chip style.
- Updates CLAUDE.md and README.md (route table, schema, features, project
  structure) to reflect the new endpoint and behaviour.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-05-21 01:43:38 -07:00
lucio 70c6deea57 readme update 2026-04-08 01:14:02 -07:00
lucioandClaude Opus 4.6 a22c4939c2 Replace client-side QR with server-side endpoint for admin dashboard
The JS QR library (qr.min.js) produced unscannable codes. Replaced with
a /admin/qr/{slug} endpoint using the same server-side rsc.io/qr that
already works on the home page.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-02 03:41:00 -07:00
lucioandClaude Opus 4.6 1bfad9ed7c Rename project to Glimmer for luci.ooo
Rebrand from "urlshort" to "Glimmer" across the entire codebase:
Go module/imports, build targets, HTML templates, deploy scripts
(including renaming service files), config, and README.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-02 03:00:08 -07:00
lucioandClaude Sonnet 4.6 60a09fa878 Initial commit: URL shortener + pastebin with dark admin UI and deploy scripts
Features:
- URL shortener with QR codes, click tracking, deduplication, rate limiting
- Pastebin with Markdown rendering, access tokens, raw view
- Admin dashboard: dark theme, stats bar, Quick Links tiles with favicons,
  card-based layout, format/token badges, empty states
- CSRF protection, bcrypt auth, in-memory sessions, security headers
- Pure-Go SQLite (no CGo), single self-contained binary

Deploy:
- deploy/install.sh: auto-detects systemd vs SysV init
- deploy/urlshort.service: hardened systemd unit
- deploy/urlshort.init: SysV init script for older Ubuntu

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-02 03:00:08 -07:00