Documentation
¶
Overview ¶
Package admin provides an owner-only web UI for managing the hold service. It includes OAuth-based authentication, crew management, settings configuration, and usage metrics. The admin panel is embedded directly in the hold service binary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminConfig ¶
type AdminConfig struct {
// Enabled controls whether the admin panel is accessible
Enabled bool
// PublicURL is the hold's public URL (for DID resolution, AppView communication)
PublicURL string
// ConfigPath is the path to the YAML config file (empty = env-only mode)
ConfigPath string
}
AdminConfig holds admin panel configuration
func DefaultAdminConfig ¶
func DefaultAdminConfig() AdminConfig
DefaultAdminConfig returns sensible defaults
type AdminSession ¶
type AdminSession struct {
DID string
Handle string
CSRFToken string
CreatedAt time.Time
UserAgent string
IPPrefix string
}
AdminSession represents an authenticated admin session. UserAgent and IPPrefix are captured at login and rechecked on every request — a stolen token replayed from a different browser or network prefix is rejected and the session is torn down. Binding at /24 (IPv4) / /64 (IPv6) tolerates DHCP renewals within a prefix without inviting cross-network replay.
type AdminUI ¶
type AdminUI struct {
// contains filtered or unexported fields
}
AdminUI manages the admin web interface
func NewAdminUI ¶
func NewAdminUI(ctx context.Context, holdPDS *pds.HoldPDS, quotaMgr *quota.Manager, garbageCollector *gc.GarbageCollector, cfg AdminConfig) (*AdminUI, error)
NewAdminUI creates a new admin UI instance
func (*AdminUI) RegisterRoutes ¶
RegisterRoutes registers all admin routes with the router
type CrewMemberView ¶
type CrewMemberView struct {
RKey string
DID string
Handle string
Role string
Permissions []string
Tier string
TierLimit string
CurrentUsage int64
UsageHuman string
UsagePercent int
AddedAt time.Time
}
CrewMemberView represents a crew member for display (populated row)
type DashboardStats ¶
DashboardStats contains dashboard statistics
type PageData ¶
type PageData struct {
Title string
ActivePage string
User *AdminSession
HoldDID string
Flash *Flash
// CSRFToken is the per-session token that forms and htmx must echo back
// on state-mutating requests. Threaded to <body hx-headers=...> at the
// layout level; plain forms emit it via {{ csrfInput .CSRFToken }}.
CSRFToken string
}
PageData contains common data for all admin pages
type RelayCrawlResultView ¶
RelayCrawlResultView is the data for a single relay crawl result row.
type RelayStatusView ¶
type RelayStatusView struct {
Name string
URL string
Online bool
Error string
HasRequestCrawl bool
RequestCrawlStatus int
HasListReposByCollection bool
RepoStatus *atproto.RepoStatus
HostStatus *atproto.HostStatus
CurrentRev string
}
RelayStatusView is the HTMX partial data returned after probing a relay.
type StorageStats ¶
type StorageStats struct {
TotalBlobs int `json:"totalBlobs"`
TotalSize int64 `json:"totalSize"`
TotalHuman string `json:"totalHuman"`
UniqueDigests int `json:"uniqueDigests"`
}
StorageStats contains storage statistics
type TierOption ¶
TierOption represents a tier choice in forms