Versions in this module Expand all Collapse all v1 v1.12.1 Apr 19, 2026 v1.12.0 Apr 12, 2026 v1.11.2 Apr 11, 2026 v1.11.1 Apr 11, 2026 v1.11.0 Mar 21, 2026 v1.10.2 Mar 8, 2026 Changes in this version + const AppKeyPairKey + const DOTokenKey + const DatabaseURLKey + const DefaultCookieName + const HashSaltKey + const HetznerTokenKey + const RegistryProviderSettingsKey + var ErrInvalidPassword = errors.New("invalid password") + var ErrResourceNotFound = errors.New("provisioned resource not found") + var ErrSessionExpired = errors.New("session expired") + var ErrSessionNotFound = errors.New("session not found") + var ErrUserExists = errors.New("user already exists") + var ErrUserNotFound = errors.New("user not found") + func APIKeysPageHandler(appState *AppState) http.HandlerFunc + func BatchDeleteJobsHandler(appState *AppState) http.HandlerFunc + func CSRFProtection(secretKey []byte, sessionCookieName string) func(http.Handler) http.Handler + func CSRFTokenFromContext(ctx context.Context) string + func ChangePasswordHandler(appState *AppState) http.HandlerFunc + func CreateAPIKeyHandler(appState *AppState) http.HandlerFunc + func DashboardHandler(appState *AppState) http.HandlerFunc + func DeleteAllFilteredJobsHandler(appState *AppState) http.HandlerFunc + func DeleteJobHandler(appState *AppState) http.HandlerFunc + func DeleteWorkerHandler(appState *AppState) http.HandlerFunc + func DownloadJobResultsHandler(appState *AppState) http.HandlerFunc + func DownloadSSHKeyHandler(appState *AppState, keyType string) http.HandlerFunc + func JobsPageHandler(appState *AppState) http.HandlerFunc + func LoginPageHandler(appState *AppState) http.HandlerFunc + func LoginSubmitHandler(appState *AppState) http.HandlerFunc + func LogoutHandler(appState *AppState) http.HandlerFunc + func ProvisionWorkerHandler(appState *AppState) http.HandlerFunc + func RevokeAPIKeyHandler(appState *AppState) http.HandlerFunc + func Routes(r chi.Router, appState *AppState, riverUIHandler http.Handler) + func SaveProviderTokenHandler(appState *AppState) http.HandlerFunc + func SessionAuth(store IStore, cookieName string) func(http.Handler) http.Handler + func SettingsPageHandler(appState *AppState) http.HandlerFunc + func StaticFileHandler() http.Handler + func TerminalPageHandler(appState *AppState) http.HandlerFunc + func TerminalWSHandler(appState *AppState) http.HandlerFunc + func TwoFactorDisableHandler(appState *AppState) http.HandlerFunc + func TwoFactorPromptPageHandler(appState *AppState) http.HandlerFunc + func TwoFactorSetupPageHandler(appState *AppState) http.HandlerFunc + func TwoFactorSetupSubmitHandler(appState *AppState) http.HandlerFunc + func TwoFactorVerifyPageHandler(appState *AppState) http.HandlerFunc + func TwoFactorVerifySubmitHandler(appState *AppState) http.HandlerFunc + func WorkersPageHandler(appState *AppState) http.HandlerFunc + func WorkersStreamHandler(appState *AppState) http.HandlerFunc + type APIKey struct + CreatedAt time.Time + ID int + KeyPrefix string + LastUsedAt *time.Time + Name string + RevokedAt *time.Time + UserID int + type AppConfig struct + Key string + UpdatedAt time.Time + Value string + type AppState struct + CookieName string + EncryptionKey []byte + RQueueClient *rqueue.Client + RateLimiter ratelimit.Store + Store IStore + Templates *template.Template + func NewAppState(store IStore, rateLimiter ratelimit.Store, encryptionKey []byte) (*AppState, error) + type IStore interface + CleanupExpiredSessions func(ctx context.Context) (int64, error) + CreateAPIKey func(ctx context.Context, userID int, name, keyHash, keyPrefix string) (*APIKey, error) + CreateProvisionedResource func(ctx context.Context, res *ProvisionedResource) (*ProvisionedResource, error) + CreateSession func(ctx context.Context, userID int, ipAddress, userAgent string, ...) (*Session, error) + CreateUser func(ctx context.Context, username, password string) (*User, error) + DeleteConfig func(ctx context.Context, key string) error + DeleteSession func(ctx context.Context, sessionID string) error + DeleteUserSessionsExcept func(ctx context.Context, userID int, exceptSessionID string) error + DisableTOTP func(ctx context.Context, userID int) error + EnableTOTP func(ctx context.Context, userID int) error + GetConfig func(ctx context.Context, key string) (*AppConfig, error) + GetProvisionedResource func(ctx context.Context, id int) (*ProvisionedResource, error) + GetSession func(ctx context.Context, sessionID string) (*Session, error) + GetTOTPSecret func(ctx context.Context, userID int) (string, error) + GetUser func(ctx context.Context, username string) (*User, error) + GetUserByID func(ctx context.Context, id int) (*User, error) + ListAPIKeys func(ctx context.Context, userID int) ([]APIKey, error) + ListProvisionedResources func(ctx context.Context, provider string) ([]ProvisionedResource, error) + RevokeAPIKey func(ctx context.Context, userID int, keyID int) error + SetBackupCodes func(ctx context.Context, userID int, hashedCodes string) error + SetConfig func(ctx context.Context, cfg *AppConfig, encrypt bool) error + SetTOTPSecret func(ctx context.Context, userID int, secret string) error + SoftDeleteProvisionedResource func(ctx context.Context, id int) error + UpdatePassword func(ctx context.Context, username, password string) error + UpdateProvisionedResourceStatus func(ctx context.Context, id int, status, ipAddress string) error + ValidateBackupCode func(ctx context.Context, userID int, code string) (bool, error) + type ProvisionedResource struct + CreatedAt time.Time + DeletedAt *time.Time + ID int + IPAddress string + Metadata map[string]any + Name string + Provider string + Region string + ResourceID string + ResourceType string + Size string + Status string + UpdatedAt time.Time + type Session struct + CreatedAt time.Time + ExpiresAt time.Time + ID string + IPAddress string + UserAgent string + UserID int + func SessionFromContext(ctx context.Context) *Session + type User struct + BackupCodesHash *string + CreatedAt time.Time + ID int + PasswordHash string + TOTPEnabled bool + TOTPSecret *string + UpdatedAt time.Time + Username string + type WorkerHealth struct + CheckedAt string + Concurrency int + JobsProcessed int64 + Reachable bool + ResultsCollected int64 + ResultsPerMinute float64 + Status string + Uptime string + type WorkerView struct + ErrorMessage string + Health *WorkerHealth + SSHCmd string