Versions in this module Expand all Collapse all v1 v1.0.0 Feb 3, 2026 Changes in this version + func GenerateStateToken() string + func GetClientIP(r *http.Request) string + func GetClientIPFromString(remoteAddr string, headers http.Header) string + func HashPassword(password string) string + func VerifyPassword(password, hash string) bool + type APIToken struct + CreatedAt time.Time + Description string + ExpiresAt time.Time + LastUsed time.Time + Name string + Permissions []string + Token string + type ActivityItem struct + Message string + Time string + Type string + type Admin struct + CreatedAt time.Time + Email string + ExternalID string + ID int64 + IsPrimary bool + LastLoginAt *time.Time + Source string + TOTPEnabled bool + UpdatedAt time.Time + Username string + type AdminInvite struct + CreatedAt time.Time + CreatedBy int64 + ExpiresAt time.Time + ID string + UsedAt *time.Time + UsedBy *int64 + Username string + type AdminPageData struct + AdminPath string + CSRFToken string + Config *config.Config + Description string + Error string + Extra map[string]interface{} + NewToken string + Page string + SchedulerRunning bool + SchedulerTasks map[string]*SchedulerTaskInfo + Stats *DashboardStats + Success string + Title string + Tokens []*APIToken + type AdminService struct + func NewAdminService(db *database.DB) *AdminService + func (s *AdminService) AcceptInvite(ctx context.Context, token, username, email, password string) (*Admin, error) + func (s *AdminService) AuthenticateAdmin(ctx context.Context, identifier, password string) (*Admin, error) + func (s *AdminService) CanAdminModifyAdmin(ctx context.Context, modifierID, targetID int64) (bool, error) + func (s *AdminService) CanAdminViewAdmin(ctx context.Context, viewerID, targetID int64) (bool, error) + func (s *AdminService) CreateAdmin(ctx context.Context, username, email, password string, isPrimary bool) (*Admin, error) + func (s *AdminService) CreateInvite(ctx context.Context, createdBy int64, username string, expiresIn time.Duration) (string, error) + func (s *AdminService) CreateSetupToken(ctx context.Context) (string, error) + func (s *AdminService) DeleteAdmin(ctx context.Context, adminID, requestingAdminID int64) error + func (s *AdminService) GenerateAPIToken(ctx context.Context, adminID int64) (string, error) + func (s *AdminService) GetAdminByEmail(ctx context.Context, email string) (*Admin, error) + func (s *AdminService) GetAdminByID(ctx context.Context, id int64) (*Admin, error) + func (s *AdminService) GetAdminByUsername(ctx context.Context, username string) (*Admin, error) + func (s *AdminService) GetAdminsForAdmin(ctx context.Context, requestingAdminID int64) ([]*Admin, error) + func (s *AdminService) GetAuditLogs(ctx context.Context, limit, offset int) ([]*AuditLogEntry, error) + func (s *AdminService) GetOnlineAdmins(ctx context.Context) ([]string, error) + func (s *AdminService) GetPrimaryAdmin(ctx context.Context) (*Admin, error) + func (s *AdminService) GetTotalAdminCount(ctx context.Context) (int, error) + func (s *AdminService) HasAnyAdmin(ctx context.Context) (bool, error) + func (s *AdminService) ResetPrimaryAdminCredentials(ctx context.Context) error + func (s *AdminService) UseSetupToken(ctx context.Context, token string) error + func (s *AdminService) ValidateAPIToken(ctx context.Context, token string) (*Admin, error) + func (s *AdminService) ValidateInvite(ctx context.Context, token string) (*AdminInvite, error) + func (s *AdminService) ValidateSetupToken(ctx context.Context, token string) (bool, error) + type AdminSession struct + CreatedAt time.Time + ExpiresAt time.Time + ID string + IP string + UserAgent string + UserID string + Username string + type AlertItem struct + Message string + Type string + type AuditLogEntry struct + Action string + Details string + ID int64 + IPAddress string + Resource string + Timestamp time.Time + UserAgent string + UserID *int64 + type AuthManager struct + func NewAuthManager(cfg *config.Config) *AuthManager + func (am *AuthManager) Authenticate(username, password string) bool + func (am *AuthManager) ClearSessionCookie(w http.ResponseWriter) + func (am *AuthManager) CreateAPIToken(name, description string, permissions []string, validDays int) *APIToken + func (am *AuthManager) CreateSession(username, ip, userAgent string) *AdminSession + func (am *AuthManager) DeleteSession(sessionID string) + func (am *AuthManager) GetSession(sessionID string) (*AdminSession, bool) + func (am *AuthManager) GetSessionFromRequest(r *http.Request) (*AdminSession, bool) + func (am *AuthManager) GetTokenFromRequest(r *http.Request) string + func (am *AuthManager) ListAPITokens() []*APIToken + func (am *AuthManager) RefreshSession(sessionID string) bool + func (am *AuthManager) RevokeAPIToken(token string) bool + func (am *AuthManager) SetDatabase(db *database.DB) + func (am *AuthManager) SetSessionCookie(w http.ResponseWriter, session *AdminSession) + func (am *AuthManager) ValidateAPIToken(token string) (*APIToken, bool) + type ClusterManager interface + GenerateJoinToken func(ctx context.Context) (string, error) + GetNodes func(ctx context.Context) ([]ClusterNode, error) + Hostname func() string + IsClusterMode func() bool + IsPrimary func() bool + LeaveCluster func(ctx context.Context) error + Mode func() string + NodeID func() string + type ClusterNode struct + Address string + Hostname string + ID string + IsPrimary bool + JoinedAt time.Time + LastSeen time.Time + Port int + Status string + Version string + type DashboardStats struct + Alerts []AlertItem + CPUPercent float64 + DiskPercent float64 + EnginesEnabled int + Errors24h int64 + GoVersion string + MemAlloc string + MemPercent float64 + MemTotal string + NumCPU int + NumGoroutines int + RecentActivity []ActivityItem + Requests24h int64 + SSLEnabled bool + ScheduledTasks []ScheduledTask + ServerMode string + Status string + TorEnabled bool + Uptime string + Version string + type EngineRegistry interface + Count func() int + GetAll func() []interface{} + GetEnabled func() []interface{} + type ExternalAdmin struct + CachedAt time.Time + Email string + ExternalID string + Groups []string + ID int64 + IsAdmin bool + LastLoginAt *time.Time + ProviderID string + ProviderType string + Username string + type ExternalAuthService struct + func NewExternalAuthService(db *database.DB, cfg *config.Config) *ExternalAuthService + func (s *ExternalAuthService) CheckAdminGroupMembership(providerType, providerID string, groups []string) bool + func (s *ExternalAuthService) ExchangeOIDCCode(ctx context.Context, providerID, code string) (*OIDCTokenResponse, error) + func (s *ExternalAuthService) GetCachedExternalAdmin(ctx context.Context, providerType, providerID, externalID string) (*ExternalAdmin, error) + func (s *ExternalAuthService) GetEnabledLDAPProviders() []config.LDAPConfig + func (s *ExternalAuthService) GetEnabledOIDCProviders() []config.OIDCProviderConfig + func (s *ExternalAuthService) GetExternalAdmin(ctx context.Context, providerType, providerID, externalID string) (*ExternalAdmin, error) + func (s *ExternalAuthService) GetOIDCAuthURL(providerID, state string) (string, error) + func (s *ExternalAuthService) GetOIDCUserInfo(ctx context.Context, providerID, accessToken string) (*OIDCUserInfo, error) + func (s *ExternalAuthService) SyncExternalAdmin(ctx context.Context, providerType, providerID string, userInfo *OIDCUserInfo) (*ExternalAdmin, error) + type Handler struct + func NewHandler(cfg *config.Config, renderer Renderer) *Handler + func (h *Handler) AuthManager() *AuthManager + func (h *Handler) RegisterRoutes(mux *http.ServeMux) + func (h *Handler) SetAdminService(svc *AdminService) + func (h *Handler) SetClusterManager(cm ClusterManager) + func (h *Handler) SetConfigPath(path string) + func (h *Handler) SetConfigSync(cs *config.ConfigSync) + func (h *Handler) SetDatabase(db *database.DB) + func (h *Handler) SetRegistry(registry EngineRegistry) + func (h *Handler) SetReloadCallback(cb ReloadCallback) + func (h *Handler) SetScheduler(sm SchedulerManager) + func (h *Handler) SetTorManager(tm TorManager) + type OIDCTokenResponse struct + AccessToken string + ExpiresIn int + IDToken string + RefreshToken string + TokenType string + type OIDCUserInfo struct + Email string + EmailVerified bool + Groups []string + Name string + Sub string + type ReloadCallback func() error + type Renderer interface + Render func(w io.Writer, name string, data interface{}) error + type ScheduledTask struct + Name string + NextRun string + type SchedulerManager interface + Disable func(id string) error + Enable func(id string) error + GetTask func(id string) (*SchedulerTaskInfo, error) + GetTasks func() []*SchedulerTaskInfo + IsRunning func() bool + RunNow func(id string) error + type SchedulerTaskInfo struct + Description string + Enabled bool + FailCount int64 + ID string + LastError string + LastRun time.Time + LastStatus string + MaxRetries int + Name string + NextRetry time.Time + NextRun time.Time + RetryCount int + RunCount int64 + Schedule string + Skippable bool + TaskType string + type TorManager interface + CancelVanity func() + ExportKeys func() ([]byte, error) + GenerateVanity func(prefix string) error + GetOnionAddress func() string + GetTorStatus func() map[string]interface{} + GetVanityProgress func() *VanityProgress + ImportKeys func(privateKey []byte) (string, error) + IsRunning func() bool + RegenerateAddress func() (string, error) + Restart func() error + Start func() error + Stop func() error + type VanityProgress struct + Address string + Attempts int64 + Error string + Found bool + Prefix string + Running bool + StartTime time.Time