Introduce configurable retention options and default selection, store retention when creating manifests, and add a helper to delete box directories to enable expiring/cleanup workflows. Update login and upload styles (new login layout, taller upload window) to support the new UI.feat(boxstore): add retention options and box deletion support Introduce configurable retention options and default selection, store retention when creating manifests, and add a helper to delete box directories to enable expiring/cleanup workflows. Update login and upload styles (new login layout, taller upload window) to support the new UI.
34 lines
890 B
Go
34 lines
890 B
Go
package server
|
|
|
|
import (
|
|
"github.com/gin-contrib/gzip"
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"warpbox/lib/routing"
|
|
)
|
|
|
|
func Run(addr string) error {
|
|
router := gin.Default()
|
|
router.LoadHTMLGlob("templates/*.html")
|
|
|
|
routing.Register(router, routing.Handlers{
|
|
Index: handleIndex,
|
|
ShowBox: handleShowBox,
|
|
BoxLogin: handleBoxLogin,
|
|
BoxLoginPost: handleBoxLoginPost,
|
|
BoxStatus: handleBoxStatus,
|
|
DownloadBox: handleDownloadBox,
|
|
DownloadFile: handleDownloadFile,
|
|
CreateBox: handleCreateBox,
|
|
ManifestFileUpload: handleManifestFileUpload,
|
|
FileStatusUpdate: handleFileStatusUpdate,
|
|
DirectBoxUpload: handleDirectBoxUpload,
|
|
LegacyUpload: handleLegacyUpload,
|
|
})
|
|
|
|
compressed := router.Group("/", gzip.Gzip(gzip.DefaultCompression))
|
|
compressed.Static("/static", "./static")
|
|
|
|
return router.Run(addr)
|
|
}
|