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:
23
backend/templates/pages/admin_login.html
Normal file
23
backend/templates/pages/admin_login.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{{define "admin_login.html"}}{{template "base" .}}{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<section class="download-view" aria-labelledby="admin-login-title">
|
||||
<form class="card download-card" action="/admin/login" method="post">
|
||||
<div class="card-content">
|
||||
<div class="file-emblem" aria-hidden="true">
|
||||
<svg viewBox="0 0 24 24" role="img" focusable="false"><path d="M12 17a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" /><path d="M19 11V8A7 7 0 0 0 5 8v3" /><path d="M5 11h14v10H5z" /></svg>
|
||||
</div>
|
||||
<h1 id="admin-login-title">Admin login</h1>
|
||||
<p class="download-subtitle">Use the token from <code>WARPBOX_ADMIN_TOKEN</code>.</p>
|
||||
{{if .Data.Error}}<p class="form-error">{{.Data.Error}}</p>{{end}}
|
||||
<div class="unlock-form">
|
||||
<label>
|
||||
<span>Admin token</span>
|
||||
<input type="password" name="token" autocomplete="current-password" required>
|
||||
</label>
|
||||
<button class="button button-primary" type="submit">Sign in</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user