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:
@@ -94,12 +94,12 @@ func applyAttr(entry map[string]any, attr slog.Attr) {
|
||||
func severity(level slog.Level) string {
|
||||
switch {
|
||||
case level >= slog.LevelError:
|
||||
return "high"
|
||||
return "error"
|
||||
case level >= slog.LevelWarn:
|
||||
return "medium"
|
||||
return "warn"
|
||||
case level <= slog.LevelDebug:
|
||||
return "low"
|
||||
return "dev"
|
||||
default:
|
||||
return "info"
|
||||
return "dev"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user