feat: add admin console, cleanup, and thumbnail workers
- Implement a token-authenticated admin console at `/admin` with overview metrics and file management. - Add a background worker to periodically clean up expired boxes based on `WARPBOX_CLEANUP_EVERY`. - Add a background worker to generate image and video thumbnails based on `WARPBOX_THUMBNAIL_EVERY`. - Update file storage paths to use `@each@` and `@thumb@` prefixes to separate original files from thumbnails. - Add severity fields to startup logs and update configuration templates.
This commit is contained in:
@@ -41,6 +41,7 @@ func Logger(logger *slog.Logger) Middleware {
|
||||
|
||||
logger.Info("http request",
|
||||
"source", "http",
|
||||
"severity", "dev",
|
||||
"code", status,
|
||||
"method", r.Method,
|
||||
"path", r.URL.Path,
|
||||
|
||||
@@ -12,6 +12,9 @@ func Recoverer(logger *slog.Logger) Middleware {
|
||||
defer func() {
|
||||
if recovered := recover(); recovered != nil {
|
||||
logger.Error("panic recovered",
|
||||
"source", "panic",
|
||||
"severity", "error",
|
||||
"code", 5001,
|
||||
"error", recovered,
|
||||
"stack", string(debug.Stack()),
|
||||
"request_id", RequestIDFromContext(r.Context()),
|
||||
|
||||
Reference in New Issue
Block a user