- 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.
22 lines
450 B
Go
22 lines
450 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"warpbox.dev/backend/libs/web"
|
|
)
|
|
|
|
type homeData struct {
|
|
MaxUploadSize string
|
|
}
|
|
|
|
func (a *App) Home(w http.ResponseWriter, r *http.Request) {
|
|
a.renderer.Render(w, http.StatusOK, "home.html", web.PageData{
|
|
Title: "Upload your files",
|
|
Description: "Upload and share files through a self-hosted Warpbox instance.",
|
|
Data: homeData{
|
|
MaxUploadSize: a.uploadService.MaxUploadSizeLabel(),
|
|
},
|
|
})
|
|
}
|