Sessions were stored in an in-memory map, so every server reboot logged the
admin out. Back the session store with the database instead:
- Add a sessions table (token, expires_at, created_at) created via the existing
migrate() (CREATE TABLE IF NOT EXISTS), backwards-compatible with deployed DBs.
- Add CreateSession / SessionValid / DeleteSession / CleanupSessions; expiry is
checked in SQL against datetime('now') (UTC).
- sessionStore is now a thin DB-backed wrapper with the same Create/Valid/Delete
interface; the hourly cleanup goroutine purges expired rows (plus once at
startup). Login, logout, requireAuth, and isLoggedIn are unchanged.
The session cookie was already persistent (MaxAge), so logins now survive both
browser and server restarts until session_hours expiry.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
- 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]>