handler

package
v1.0.0-beta.37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: AGPL-3.0 Imports: 45 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blog

func Blog(files fs.FS) http.HandlerFunc

Blog lists the posts, newest first. Like the changelog it reads the files on every request, so a new post shows without a restart in development.

func BlogFeed

func BlogFeed(files fs.FS, appURL, name string) http.HandlerFunc

BlogFeed is the blog as RSS, one item per post.

func BlogPost

func BlogPost(files fs.FS) http.HandlerFunc

BlogPost shows one post at /blog/{slug}.

func Changelog

func Changelog(files fs.FS) http.HandlerFunc

Changelog shows what shipped, newest first. It reads the file on every request, so a new release shows without a restart in development.

func ChangelogFeed

func ChangelogFeed(files fs.FS, appURL, name string) http.HandlerFunc

ChangelogFeed is the changelog as RSS, one item per release, so a reader or a Slack feed hears about each one.

func Compare

func Compare(w http.ResponseWriter, r *http.Request)

Compare shows one tool next to moin at /compare/{name}.

func CompareIndex

func CompareIndex(w http.ResponseWriter, r *http.Request)

CompareIndex lists every tool at /compare.

func NewAuthHandler

func NewAuthHandler(authService *service.AuthService, workspaceService *service.WorkspaceService, githubApp *service.GitHubAppService, passkeys *service.PasskeyService, cfg *config.Config) *authHandler

func Next

func Next(w http.ResponseWriter, r *http.Request)

Next is the page about what grows next to deploys.

func Roadmap

func Roadmap(files fs.FS) http.HandlerFunc

Roadmap shows what moin does today and what comes next, read from docs/roadmap.md on every request.

Types

type AccountHandler

type AccountHandler struct {
	// contains filtered or unexported fields
}

func NewAccountHandler

func NewAccountHandler(authService *service.AuthService, userService *service.UserService, fileService *service.FileService) *AccountHandler

func (*AccountHandler) ChangeEmail

func (h *AccountHandler) ChangeEmail(w http.ResponseWriter, r *http.Request)

func (*AccountHandler) DeleteAccount

func (h *AccountHandler) DeleteAccount(w http.ResponseWriter, r *http.Request)

func (*AccountHandler) DeleteAvatar

func (h *AccountHandler) DeleteAvatar(w http.ResponseWriter, r *http.Request)

func (*AccountHandler) UploadAvatar

func (h *AccountHandler) UploadAvatar(w http.ResponseWriter, r *http.Request)

type AdminHandler

type AdminHandler struct {
	// contains filtered or unexported fields
}

func NewAdminHandler

func NewAdminHandler(admin *service.AdminService) *AdminHandler

func (*AdminHandler) Activity

func (h *AdminHandler) Activity(w http.ResponseWriter, r *http.Request)

Activity is what operators did, the last 50 events.

func (*AdminHandler) ApplyOffer

func (h *AdminHandler) ApplyOffer(w http.ResponseWriter, r *http.Request)

ApplyOffer gives the first workspace of a user the offer of an address.

func (*AdminHandler) ClaimOffers

func (h *AdminHandler) ClaimOffers(w http.ResponseWriter, r *http.Request)

ClaimOffers applies every open offer to the account with that address.

func (*AdminHandler) CreateOffer

func (h *AdminHandler) CreateOffer(w http.ResponseWriter, r *http.Request)

CreateOffer adds an offer and shows it in the list.

func (*AdminHandler) DeleteOffer

func (h *AdminHandler) DeleteOffer(w http.ResponseWriter, r *http.Request)

DeleteOffer removes an offer nobody claimed yet.

func (*AdminHandler) ForeverFree

func (h *AdminHandler) ForeverFree(w http.ResponseWriter, r *http.Request)

ForeverFree makes the first workspace of a user free forever, or ends it.

func (*AdminHandler) Offers

func (h *AdminHandler) Offers(w http.ResponseWriter, r *http.Request)

Offers is the page of offers: add one, see who got which.

func (*AdminHandler) OldDomain

func (h *AdminHandler) OldDomain(w http.ResponseWriter, r *http.Request)

OldDomain shows what still arrives on the old domains.

func (*AdminHandler) Overview

func (h *AdminHandler) Overview(w http.ResponseWriter, r *http.Request)

func (*AdminHandler) RevokeUserSessions

func (h *AdminHandler) RevokeUserSessions(w http.ResponseWriter, r *http.Request)

func (*AdminHandler) SaveUserNote

func (h *AdminHandler) SaveUserNote(w http.ResponseWriter, r *http.Request)

SaveUserNote keeps what admins wrote about a user.

func (*AdminHandler) StartImpersonation

func (h *AdminHandler) StartImpersonation(w http.ResponseWriter, r *http.Request)

func (*AdminHandler) StopImpersonation

func (h *AdminHandler) StopImpersonation(w http.ResponseWriter, r *http.Request)

func (*AdminHandler) User

func (h *AdminHandler) User(w http.ResponseWriter, r *http.Request)

User is one user's page: the facts and what an operator can do.

type AlertsHandler

type AlertsHandler struct {
	// contains filtered or unexported fields
}

AlertsHandler serves the alerts page: where the alerts of the workspace go besides email.

func NewAlertsHandler

func NewAlertsHandler(alerts *service.AlertService) *AlertsHandler

func (*AlertsHandler) Add

Add stores a destination. A webhook's signing secret shows this once.

func (*AlertsHandler) Page

func (h *AlertsHandler) Page(w http.ResponseWriter, r *http.Request)

Page is the alerts page.

func (*AlertsHandler) Remove

func (h *AlertsHandler) Remove(w http.ResponseWriter, r *http.Request)

Remove deletes a destination.

func (*AlertsHandler) Test

func (h *AlertsHandler) Test(w http.ResponseWriter, r *http.Request)

Test sends a test alert. The list shows the result either way.

type AppsHandler

type AppsHandler struct {
	// contains filtered or unexported fields
}

AppsHandler is the apps pages of the web UI. Deploys come from `moin deploy`; the web UI follows them, rolls back, shows logs and keeps env vars.

func NewAppsHandler

func NewAppsHandler(apps *service.AppService, servers *service.ServerService, users *service.UserService, catalogs *service.CatalogService) *AppsHandler

func (*AppsHandler) AddBucket

func (h *AppsHandler) AddBucket(w http.ResponseWriter, r *http.Request)

AddBucket checks and stores a new bucket.

func (*AppsHandler) AddDomain

func (h *AppsHandler) AddDomain(w http.ResponseWriter, r *http.Request)

AddDomain adds one domain, to the main service or the one named, and applies it.

func (*AppsHandler) AppMetrics

func (h *AppsHandler) AppMetrics(w http.ResponseWriter, r *http.Request)

AppMetrics is the metrics tab of an app, ?range=1h, 24h, 7d or 30d.

func (*AppsHandler) AppSection

func (h *AppsHandler) AppSection(section string) http.HandlerFunc

AppSection answers one section of an app (app, deploys, domains, logs or settings) as a whole page.

func (*AppsHandler) AppsPage

func (h *AppsHandler) AppsPage(w http.ResponseWriter, r *http.Request)

AppsPage is every app, in the one order.

func (*AppsHandler) BackupDownload

func (h *AppsHandler) BackupDownload(w http.ResponseWriter, r *http.Request)

BackupDownload gives the page a link to the newest copy of the database, in the user's own bucket, that lasts 15 minutes. The page stays and the browser fetches the file. Without a link, the page says why under the row.

func (*AppsHandler) BackupRestore

func (h *AppsHandler) BackupRestore(w http.ResponseWriter, r *http.Request)

BackupRestore puts a database back to the moment picked.

func (*AppsHandler) BackupSchedule

func (h *AppsHandler) BackupSchedule(w http.ResponseWriter, r *http.Request)

BackupSchedule saves how often the app's databases are copied, how long each copy stays. A failed save answers the rows as stored, with why.

func (*AppsHandler) Bucket

func (h *AppsHandler) Bucket(w http.ResponseWriter, r *http.Request)

Bucket is the buckets page.

func (*AppsHandler) ComposeFile

func (h *AppsHandler) ComposeFile(w http.ResponseWriter, r *http.Request)

ComposeFile downloads the compose file of the app's live deploy as compose.yml.

func (*AppsHandler) Create

func (h *AppsHandler) Create(w http.ResponseWriter, r *http.Request)

Create adds an app and shows its password once, with a link to its page.

func (*AppsHandler) Data

func (h *AppsHandler) Data(w http.ResponseWriter, r *http.Request)

Data is the Data section of an app, read live from the server: its databases, one database with its tables and backups (?db=), or the rows of one table (?db=&table=). A table without a database, an older link, is in the first database.

func (*AppsHandler) DataCell

func (h *AppsHandler) DataCell(w http.ResponseWriter, r *http.Request)

DataCell saves one cell and answers it again, green when saved. Clearing a cell that was NULL keeps it NULL.

func (*AppsHandler) DataDelete

func (h *AppsHandler) DataDelete(w http.ResponseWriter, r *http.Request)

DataDelete deletes one row; the page drops it.

func (*AppsHandler) DataInsert

func (h *AppsHandler) DataInsert(w http.ResponseWriter, r *http.Request)

DataInsert adds a row from the new row form, then shows the table again. Empty fields get the column's default.

func (*AppsHandler) DataQuery

func (h *AppsHandler) DataQuery(w http.ResponseWriter, r *http.Request)

DataQuery runs the SQL console. Changes need the box ticked.

func (*AppsHandler) DefaultBucket

func (h *AppsHandler) DefaultBucket(w http.ResponseWriter, r *http.Request)

DefaultBucket makes a bucket the workspace's default.

func (*AppsHandler) Delete

func (h *AppsHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete stops the app on its server and removes it, then goes to the list.

func (*AppsHandler) DeleteRegistry

func (h *AppsHandler) DeleteRegistry(w http.ResponseWriter, r *http.Request)

DeleteRegistry removes a registry login.

func (*AppsHandler) DeployImage

func (h *AppsHandler) DeployImage(w http.ResponseWriter, r *http.Request)

DeployImage deploys an image built elsewhere. The page follows the new deploy.

func (*AppsHandler) DeployLog

func (h *AppsHandler) DeployLog(w http.ResponseWriter, r *http.Request)

DeployLog streams the log of a deploy as HTML for the web (hx-sse): every message is the lines to append, sorted into steps and folds; at the end the state and the event "done". The API streams the same log as JSON for the CLI, the TUI and MCP.

func (*AppsHandler) DeployPage

func (h *AppsHandler) DeployPage(w http.ResponseWriter, r *http.Request)

DeployPage is the Deploys section with the log of one deploy.

func (*AppsHandler) DeployRef

func (h *AppsHandler) DeployRef(w http.ResponseWriter, r *http.Request)

DeployRef deploys a branch, tag or commit from GitHub; the page follows the deploy on its own.

func (*AppsHandler) Detail

func (h *AppsHandler) Detail(w http.ResponseWriter, r *http.Request)

Detail answers the state and the buttons of an app, after a change. The Deploys section also asks for its list and log with n, the deploy whose log shows (0 the newest), and shown, when the page follows the newest, the one it shows now, so a new deploy takes the log. An action asks for neither: its change reaches the list and the log as an event, like any other change. An app removed meanwhile sends the page to the list.

func (*AppsHandler) DomainsDetail

func (h *AppsHandler) DomainsDetail(w http.ResponseWriter, r *http.Request)

DomainsDetail answers the domains of an app, its instant address and its password. It looks up no DNS, but the domain in ?check= (its Check button).

func (*AppsHandler) EditBucket

func (h *AppsHandler) EditBucket(w http.ResponseWriter, r *http.Request)

EditBucket changes a bucket.

func (*AppsHandler) Env

func (h *AppsHandler) Env(w http.ResponseWriter, r *http.Request)

Env answers the env table; with text=1 the empty box that takes them all as one .env text.

func (*AppsHandler) EnvText

func (h *AppsHandler) EnvText(w http.ResponseWriter, r *http.Request)

EnvText takes the env vars as one .env text: first it shows which keys change, with confirm=1 it replaces them, with back=1 it goes back to the text.

func (*AppsHandler) GitHubInstall

func (h *AppsHandler) GitHubInstall(w http.ResponseWriter, r *http.Request)

GitHubInstall is "Connect GitHub": it sends the user to GitHub. next is where to come back to.

func (*AppsHandler) GitHubSetup

func (h *AppsHandler) GitHubSetup(w http.ResponseWriter, r *http.Request)

GitHubSetup is where GitHub sends the user back: after an install, a change of an installation (setup_action=update) or a sign-in. It is one URL for every workspace; the state names the workspace. ConnectGitHub may send the user on to GitHub once more.

func (*AppsHandler) LinkRepo

func (h *AppsHandler) LinkRepo(w http.ResponseWriter, r *http.Request)

LinkRepo makes the app follow the chosen repo and branch.

func (*AppsHandler) Logs

func (h *AppsHandler) Logs(w http.ResponseWriter, r *http.Request)

Logs answers the last lines of the app's containers, or why they could not be read: the panel is their output, an error included.

func (*AppsHandler) MakeCanonical

func (h *AppsHandler) MakeCanonical(w http.ResponseWriter, r *http.Request)

MakeCanonical lets the other domains redirect to one.

func (*AppsHandler) NewPage

func (h *AppsHandler) NewPage(w http.ResponseWriter, r *http.Request)

NewPage is where an app starts: from a folder, GitHub or the catalog.

func (*AppsHandler) Password

func (h *AppsHandler) Password(w http.ResponseWriter, r *http.Request)

Password turns the app's password on or off. Its switch (switch=1) turns it off, or on with a password moin makes and shows once; the fields set one of your own. A wrong field says the rule of its hint line again, in red; a failed switch flips back.

func (*AppsHandler) Redeploy

func (h *AppsHandler) Redeploy(w http.ResponseWriter, r *http.Request)

Redeploy builds the newest source again. The page follows the new deploy.

func (*AppsHandler) Registries

func (h *AppsHandler) Registries(w http.ResponseWriter, r *http.Request)

Registries is the workspace's registry logins, under Settings.

func (*AppsHandler) RemoveBucket

func (h *AppsHandler) RemoveBucket(w http.ResponseWriter, r *http.Request)

RemoveBucket forgets a bucket nothing uses.

func (*AppsHandler) RemoveDomain

func (h *AppsHandler) RemoveDomain(w http.ResponseWriter, r *http.Request)

RemoveDomain removes one domain and applies it.

func (*AppsHandler) RemoveHook

func (h *AppsHandler) RemoveHook(w http.ResponseWriter, r *http.Request)

RemoveHook turns the deploy hook off; its URL stops working.

func (*AppsHandler) RenameApp

func (h *AppsHandler) RenameApp(w http.ResponseWriter, r *http.Request)

RenameApp gives the app a new name and shows its settings under the new link. Its data, backups and instant address stay; the next restart names its containers after it.

func (*AppsHandler) RenameServer

func (h *AppsHandler) RenameServer(w http.ResponseWriter, r *http.Request)

RenameServer gives the server a new name and answers its page with it.

func (*AppsHandler) Repo

func (h *AppsHandler) Repo(w http.ResponseWriter, r *http.Request)

Repo is the repository panel of an app.

func (*AppsHandler) RepoBranches

func (h *AppsHandler) RepoBranches(w http.ResponseWriter, r *http.Request)

RepoBranches answers the branch select of the link form for the repo it has chosen.

func (*AppsHandler) Restart

func (h *AppsHandler) Restart(w http.ResponseWriter, r *http.Request)

Restart starts the live deploy again with the env and domains as they are now, without a build. The page follows the new deploy.

func (*AppsHandler) Rollback

func (h *AppsHandler) Rollback(w http.ResponseWriter, r *http.Request)

Rollback starts the release of an earlier deploy again and goes to the Deploys section, whose log follows the new deploy.

func (*AppsHandler) RotateHook

func (h *AppsHandler) RotateHook(w http.ResponseWriter, r *http.Request)

RotateHook shows a new deploy hook URL once.

func (*AppsHandler) ServerMetrics

func (h *AppsHandler) ServerMetrics(w http.ResponseWriter, r *http.Request)

ServerMetrics is the metrics page of a server.

func (*AppsHandler) ServerSecurity

func (h *AppsHandler) ServerSecurity(w http.ResponseWriter, r *http.Request)

ServerSecurity is the security page of a server.

func (*AppsHandler) SetAppBucket

func (h *AppsHandler) SetAppBucket(w http.ResponseWriter, r *http.Request)

SetAppBucket moves the app's new backups to another bucket.

func (*AppsHandler) SetAutoDeploy

func (h *AppsHandler) SetAutoDeploy(w http.ResponseWriter, r *http.Request)

SetAutoDeploy is the switch for deploy on push: it saves only that and answers the switch as stored, so a failed save flips it back.

func (*AppsHandler) SetBucketKey

func (h *AppsHandler) SetBucketKey(w http.ResponseWriter, r *http.Request)

SetBucketKey hands the secret key of a bucket to a server that has none.

func (*AppsHandler) SetEnv

func (h *AppsHandler) SetEnv(w http.ResponseWriter, r *http.Request)

SetEnv sets one env var from the add form.

func (*AppsHandler) SetInstant

func (h *AppsHandler) SetInstant(w http.ResponseWriter, r *http.Request)

SetInstant picks the provider of the instant address, or off. Its switch (switch=1) turns it on with the first provider, or off; a failed switch flips back.

func (*AppsHandler) SetPinned

func (h *AppsHandler) SetPinned(w http.ResponseWriter, r *http.Request)

SetPinned pins or unpins the app (the switch on=1). The switch already shows the change, so a save answers nothing; a failed one flips it back as stored.

func (*AppsHandler) SetRegistry

func (h *AppsHandler) SetRegistry(w http.ResponseWriter, r *http.Request)

SetRegistry hands a registry login from a form on Registries to a server: the new login's, or a server's that has none yet.

func (*AppsHandler) SetServerSecurity

func (h *AppsHandler) SetServerSecurity(w http.ResponseWriter, r *http.Request)

SetServerSecurity changes one line of a server's Security page, the one set names: tunnel (on or off), ssh, or firewall with on. The other lines keep what the server has now. It answers the page as stored, so a line that could not change goes back and says why.

func (*AppsHandler) Start

func (h *AppsHandler) Start(w http.ResponseWriter, r *http.Request)

Start runs a stopped app again. The page follows the new deploy.

func (*AppsHandler) Stop

func (h *AppsHandler) Stop(w http.ResponseWriter, r *http.Request)

Stop stops the app's containers. Its data stays.

func (*AppsHandler) UnlinkRepo

func (h *AppsHandler) UnlinkRepo(w http.ResponseWriter, r *http.Request)

UnlinkRepo stops the app from following its repo.

func (*AppsHandler) UnsetEnv

func (h *AppsHandler) UnsetEnv(w http.ResponseWriter, r *http.Request)

UnsetEnv removes one env var.

func (*AppsHandler) Uptime

func (h *AppsHandler) Uptime(w http.ResponseWriter, r *http.Request)

Uptime is the uptime page of an app.

func (*AppsHandler) UptimeOn

func (h *AppsHandler) UptimeOn(w http.ResponseWriter, r *http.Request)

UptimeOn is the switch that pauses or resumes uptime of a domain: it saves only that and answers the switch as stored, so a failed save flips it back.

func (*AppsHandler) UptimePath

func (h *AppsHandler) UptimePath(w http.ResponseWriter, r *http.Request)

UptimePath saves the path uptime visits on a domain.

type BillingHandler

type BillingHandler struct {
	// contains filtered or unexported fields
}

func NewBillingHandler

func NewBillingHandler(paymentService payment.Provider, workspaceService *service.WorkspaceService) *BillingHandler

func (*BillingHandler) BillingManagement

func (h *BillingHandler) BillingManagement(w http.ResponseWriter, r *http.Request)

func (*BillingHandler) BillingPage

func (h *BillingHandler) BillingPage(w http.ResponseWriter, r *http.Request)

func (*BillingHandler) CreateCheckout

func (h *BillingHandler) CreateCheckout(w http.ResponseWriter, r *http.Request)

func (*BillingHandler) Webhook

func (h *BillingHandler) Webhook(w http.ResponseWriter, r *http.Request)

type CatalogHandler

type CatalogHandler struct {
	// contains filtered or unexported fields
}

CatalogHandler serves the catalog: its public pages, the install in a workspace, and the update of an installed app.

func NewCatalogHandler

func NewCatalogHandler(catalog *service.CatalogService, apps *service.AppService, servers *service.ServerService, workspaces *service.WorkspaceService, appURL string) *CatalogHandler

func (*CatalogHandler) InApp

func (h *CatalogHandler) InApp(w http.ResponseWriter, r *http.Request)

InApp is the catalog inside a workspace.

func (*CatalogHandler) Install

func (h *CatalogHandler) Install(w http.ResponseWriter, r *http.Request)

Install installs the catalog app. The form shows the secrets moin made for it once instead, the password of its instant address and those the first sign-in needs, with a link to its page, which follows the deploy.

func (*CatalogHandler) InstallPage

func (h *CatalogHandler) InstallPage(w http.ResponseWriter, r *http.Request)

InstallPage is the install form of a catalog app.

func (*CatalogHandler) List

List is the public catalog.

Logo serves an app's logo from the catalog, never from its project's site. An SVG runs no script here: the policy forbids it.

func (*CatalogHandler) Show

Show is the public page of a catalog app.

func (*CatalogHandler) Start

func (h *CatalogHandler) Start(w http.ResponseWriter, r *http.Request)

Start sends the "Deploy with moin" button of the site to the install form in the user's first workspace.

func (*CatalogHandler) Update

func (h *CatalogHandler) Update(w http.ResponseWriter, r *http.Request)

Update deploys the app in the picked version and reloads its page.

func (*CatalogHandler) UpdatePanel

func (h *CatalogHandler) UpdatePanel(w http.ResponseWriter, r *http.Request)

UpdatePanel is the catalog panel of an installed app; nothing for an app of your own.

type CommandHandler

type CommandHandler struct {
	// contains filtered or unexported fields
}

CommandHandler answers the palette.

func NewCommandHandler

func NewCommandHandler(apps *service.AppService, servers *service.ServerService, docs *service.DocsService, catalog *service.CatalogService) *CommandHandler

func (*CommandHandler) Search

func (h *CommandHandler) Search(w http.ResponseWriter, r *http.Request)

Search answers what matches q: apps, servers, buckets, places and actions, as the list under the search field (htmx active search).

type ConnectionsHandler

type ConnectionsHandler struct {
	// contains filtered or unexported fields
}

ConnectionsHandler is Settings, Connections: the connections of the signed-in person and the CI tokens of the workspace, each with a page where its rights change and it goes.

func NewConnectionsHandler

func NewConnectionsHandler(connections *service.ConnectionService, ciTokens *service.CITokenService, apps *service.AppService, passkeys *service.PasskeyService) *ConnectionsHandler

func (*ConnectionsHandler) CIToken

CIToken is the page of one CI token of the workspace.

func (*ConnectionsHandler) Connection

func (h *ConnectionsHandler) Connection(w http.ResponseWriter, r *http.Request)

Connection is the page of one connection of the signed-in person.

func (*ConnectionsHandler) CreateCIToken

func (h *ConnectionsHandler) CreateCIToken(w http.ResponseWriter, r *http.Request)

CreateCIToken makes a CI token in the workspace and shows it once, above the list. A wrong field shows the form again with what is wrong.

func (*ConnectionsHandler) Page

Page lists the connections and CI tokens, with the form for a new CI token.

func (*ConnectionsHandler) RemoveCIToken

func (h *ConnectionsHandler) RemoveCIToken(w http.ResponseWriter, r *http.Request)

RemoveCIToken deletes a CI token and goes back to the list.

func (*ConnectionsHandler) RemoveConnection

func (h *ConnectionsHandler) RemoveConnection(w http.ResponseWriter, r *http.Request)

RemoveConnection ends a connection and every token of it, and goes back to the list.

func (*ConnectionsHandler) SetCITokenRight

func (h *ConnectionsHandler) SetCITokenRight(w http.ResponseWriter, r *http.Request)

SetCITokenRight turns one right of a CI token on or off, at once.

func (*ConnectionsHandler) SetConnectionRight

func (h *ConnectionsHandler) SetConnectionRight(w http.ResponseWriter, r *http.Request)

SetConnectionRight turns one right of a connection on or off, at once.

type DaemonHandler

type DaemonHandler struct {
	// contains filtered or unexported fields
}

DaemonHandler is the surface the moin daemon dials into. It is not part of /api/v1: daemons authenticate with their own tokens, never with a user's.

func NewDaemonHandler

func NewDaemonHandler(servers *service.ServerService, appURL string, clientIPs middleware.ClientIPResolver, oldHosts []string) *DaemonHandler

func (*DaemonHandler) CLIScript

func (h *DaemonHandler) CLIScript(w http.ResponseWriter, _ *http.Request)

CLIScript answers the script that installs the moin command.

func (*DaemonHandler) InstallScript

func (h *DaemonHandler) InstallScript(w http.ResponseWriter, _ *http.Request)

InstallScript answers the install script for this hub.

func (*DaemonHandler) Register

func (h *DaemonHandler) Register(w http.ResponseWriter, r *http.Request)

Register trades the install token in the Authorization header for a daemon token.

func (*DaemonHandler) Session

func (h *DaemonHandler) Session(w http.ResponseWriter, r *http.Request)

Session holds the daemon's WebSocket until either side ends it.

type DeviceHandler

type DeviceHandler struct {
	// contains filtered or unexported fields
}

DeviceHandler is the page where `moin login` is approved in the browser: which workspace, which rights, and the person's passkey or a fresh confirmation to allow it.

func NewDeviceHandler

func NewDeviceHandler(logins *service.DeviceLoginService, workspaces *service.WorkspaceService, passkeys *service.PasskeyService, cfg *config.Config) *DeviceHandler

func (*DeviceHandler) Approve

func (h *DeviceHandler) Approve(w http.ResponseWriter, r *http.Request)

Approve makes the connection, with the person's passkey or a fresh confirmation. The computer's next poll gets its tokens.

func (*DeviceHandler) Deny

func (h *DeviceHandler) Deny(w http.ResponseWriter, r *http.Request)

Deny turns the login down. Its next poll hears so and stops.

func (*DeviceHandler) PasskeyOptions

func (h *DeviceHandler) PasskeyOptions(w http.ResponseWriter, r *http.Request)

PasskeyOptions starts the passkey ceremony that allows a login.

func (*DeviceHandler) Show

func (h *DeviceHandler) Show(w http.ResponseWriter, r *http.Request)

Show asks for the code, or with ?code= shows the login to approve. Without a session it sends the user to sign in first and back here after.

type DocsHandler

type DocsHandler struct {
	// contains filtered or unexported fields
}

func NewDocsHandler

func NewDocsHandler(docsService *service.DocsService) *DocsHandler

func (*DocsHandler) ShowDocs

func (h *DocsHandler) ShowDocs(w http.ResponseWriter, r *http.Request)

ShowDocs is the docs: /docs the topics with every page, /docs/<slug> one page, and either with .md its Markdown. Every link is a full page load.

type GitHubAppHandler

type GitHubAppHandler struct {
	// contains filtered or unexported fields
}

GitHubAppHandler creates the hub's GitHub App from a manifest.

func NewGitHubAppHandler

func NewGitHubAppHandler(githubApp *service.GitHubAppService, workspaces *service.WorkspaceService) *GitHubAppHandler

func (*GitHubAppHandler) Created

func (h *GitHubAppHandler) Created(w http.ResponseWriter, r *http.Request)

Created is where GitHub sends the admin back after creating the app, with its code and the state: the hub trades the code for the app and uses it at once. The activity of the admin's first workspace notes it.

type HomeHandler

type HomeHandler struct {
	// contains filtered or unexported fields
}

func NewHomeHandler

func NewHomeHandler(telemetry *service.TelemetryService, billing bool, files fs.FS) *HomeHandler

func (*HomeHandler) HomePage

func (h *HomeHandler) HomePage(w http.ResponseWriter, r *http.Request)

HomePage shows the landing page of the hosted hub. A self-hosted one is private and has none: it sends people to the app or to sign in.

func (*HomeHandler) NotFoundPage

func (h *HomeHandler) NotFoundPage(w http.ResponseWriter, r *http.Request)

type HooksHandler

type HooksHandler struct {
	// contains filtered or unexported fields
}

HooksHandler serves deploy hooks: secret URLs that CI calls after it pushed an image. The token in the path is the only credential.

func NewHooksHandler

func NewHooksHandler(apps *service.AppService) *HooksHandler

func (*HooksHandler) Deploy

func (h *HooksHandler) Deploy(w http.ResponseWriter, r *http.Request)

Deploy deploys the image from ?image= or a JSON body {"image": "..."}, with the compose file of ?commit= or "commit", the commit CI built the image from, and answers 202 with the deploy.

func (*HooksHandler) GitHubWebhook

func (h *HooksHandler) GitHubWebhook(w http.ResponseWriter, r *http.Request)

GitHubWebhook takes the events of the moin GitHub App: pushes deploy the apps that follow the branch, an uninstall unlinks its apps.

type LegalHandler

type LegalHandler struct {
	// contains filtered or unexported fields
}

func NewLegalHandler

func NewLegalHandler(legalService *service.LegalService) *LegalHandler

func (*LegalHandler) ShowPage

func (h *LegalHandler) ShowPage(w http.ResponseWriter, r *http.Request)

type OAuthHandler

type OAuthHandler struct {
	// contains filtered or unexported fields
}

OAuthHandler is the authorization endpoint of OAuth, where a person lets an AI agent in: the approval page of `moin login`, with the workspace, the rights and the passkey, and where it goes back to.

func NewOAuthHandler

func NewOAuthHandler(oauth *service.OAuthService, workspaces *service.WorkspaceService, passkeys *service.PasskeyService, cfg *config.Config) *OAuthHandler

func (*OAuthHandler) Approve

func (h *OAuthHandler) Approve(w http.ResponseWriter, r *http.Request)

Approve makes the connection, with the person's passkey or a fresh confirmation, and sends the person back to the client with the code.

func (*OAuthHandler) Authorize

func (h *OAuthHandler) Authorize(w http.ResponseWriter, r *http.Request)

Authorize checks the client's request and shows the approval. Without a session it sends the person to sign in first and back here after.

func (*OAuthHandler) Deny

func (h *OAuthHandler) Deny(w http.ResponseWriter, r *http.Request)

Deny sends the person back to the client, which hears access_denied.

type OverviewHandler

type OverviewHandler struct {
	// contains filtered or unexported fields
}

OverviewHandler serves the first page of a workspace: is everything OK?

func NewOverviewHandler

func NewOverviewHandler(status *service.StatusService, apps *service.AppService, servers *service.ServerService) *OverviewHandler

func (*OverviewHandler) Page

Page shows what needs the member, their pinned apps and the ones deployed last.

type ProfileHandler

type ProfileHandler struct {
	// contains filtered or unexported fields
}

func NewProfileHandler

func NewProfileHandler(users *service.UserService) *ProfileHandler

func (*ProfileHandler) EmailAlerts

func (h *ProfileHandler) EmailAlerts(w http.ResponseWriter, r *http.Request)

EmailAlerts turns the user's email alerts on or off and answers the switch as stored, so a failed save flips it back.

func (*ProfileHandler) UpdateName

func (h *ProfileHandler) UpdateName(w http.ResponseWriter, r *http.Request)

type SEOHandler

type SEOHandler struct {
	// contains filtered or unexported fields
}

func NewSEOHandler

func NewSEOHandler(
	docsService, uiDocs *service.DocsService,
	uiFiles fs.FS,
	baseURL string,
	files fs.FS,
	robotsNoIndex bool,
	legal bool,
) *SEOHandler

func (*SEOHandler) LLMs

func (h *SEOHandler) LLMs(w http.ResponseWriter, r *http.Request)

func (*SEOHandler) Robots

func (h *SEOHandler) Robots(w http.ResponseWriter, _ *http.Request)

func (*SEOHandler) Sitemap

func (h *SEOHandler) Sitemap(w http.ResponseWriter, _ *http.Request)

type ServersHandler

type ServersHandler struct {
	// contains filtered or unexported fields
}

ServersHandler is the servers page of the web UI.

func NewServersHandler

func NewServersHandler(servers *service.ServerService, users *service.UserService) *ServersHandler

func (*ServersHandler) Create

func (h *ServersHandler) Create(w http.ResponseWriter, r *http.Request)

Create adds a server and answers the reset form and its install command. The event stream reloads the table.

func (*ServersHandler) DaemonUpdates

func (h *ServersHandler) DaemonUpdates(w http.ResponseWriter, r *http.Request)

DaemonUpdates turns automatic daemon updates on or off and answers the switch as stored, so a failed save flips it back.

func (*ServersHandler) Delete

func (h *ServersHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete removes a server from its page and goes back to the list.

func (*ServersHandler) Install

func (h *ServersHandler) Install(w http.ResponseWriter, r *http.Request)

Install answers whether the install command on the page is still needed. It works once: while it is unused the server still holds its token and the page keeps it; once a daemon used it, the answer takes its place.

func (*ServersHandler) List

List answers the table, for the reload after a change.

func (*ServersHandler) NewInstall

func (h *ServersHandler) NewInstall(w http.ResponseWriter, r *http.Request)

NewInstall answers a new install command for a server in the same panel as after Add server. The old command stops working.

func (*ServersHandler) ServersPage

func (h *ServersHandler) ServersPage(w http.ResponseWriter, r *http.Request)

func (*ServersHandler) UpdateDaemon

func (h *ServersHandler) UpdateDaemon(w http.ResponseWriter, r *http.Request)

UpdateDaemon has the server's daemon update itself and says how it went. The event stream reloads the list with the new version.

type SettingsHandler

type SettingsHandler struct {
	// contains filtered or unexported fields
}

func NewSettingsHandler

func NewSettingsHandler(authService *service.AuthService, passkeys *service.PasskeyService, apps *service.AppService, updates *service.UpdateService) *SettingsHandler

func (*SettingsHandler) AddPasskey

func (h *SettingsHandler) AddPasskey(w http.ResponseWriter, r *http.Request)

AddPasskey takes the browser's answer, stores the passkey and says to go back to the security settings, which list it and ask for its name.

func (*SettingsHandler) Home

Home is Settings: you, your workspaces, this workspace, moin, sign out.

func (*SettingsHandler) Integrations

func (h *SettingsHandler) Integrations(w http.ResponseWriter, r *http.Request)

Integrations are the accounts the workspace connects once: GitHub, Cloudflare and Tailscale.

func (*SettingsHandler) PasskeyOptions

func (h *SettingsHandler) PasskeyOptions(w http.ResponseWriter, r *http.Request)

PasskeyOptions starts adding a passkey to the signed-in user.

func (*SettingsHandler) RemovePasskey

func (h *SettingsHandler) RemovePasskey(w http.ResponseWriter, r *http.Request)

RemovePasskey removes a passkey of the signed-in user, unless it is their last way in, and answers the passkeys as they are now.

func (*SettingsHandler) RenamePasskey

func (h *SettingsHandler) RenamePasskey(w http.ResponseWriter, r *http.Request)

RenamePasskey names a passkey of the signed-in user and answers the passkeys as they are now, without the name form.

func (*SettingsHandler) RevokeAllSessions

func (h *SettingsHandler) RevokeAllSessions(w http.ResponseWriter, r *http.Request)

func (*SettingsHandler) RevokeSession

func (h *SettingsHandler) RevokeSession(w http.ResponseWriter, r *http.Request)

func (*SettingsHandler) SetIntegrations

func (h *SettingsHandler) SetIntegrations(w http.ResponseWriter, r *http.Request)

SetIntegrations connects Cloudflare or Tailscale with the key in the form, replaces the key of a connected one, or disconnects the one remove names, and answers the page.

func (*SettingsHandler) SettingsPage

func (h *SettingsHandler) SettingsPage(w http.ResponseWriter, r *http.Request)

SettingsPage is your account: profile and how you sign in.

type SiteSearchHandler

type SiteSearchHandler struct {
	// contains filtered or unexported fields
}

SiteSearchHandler is the one search of the public site: the docs, moin UI and the catalog.

func NewSiteSearchHandler

func NewSiteSearchHandler(docs, uiDocs *service.DocsService, uiFiles fs.FS, catalog *service.CatalogService) *SiteSearchHandler

func (*SiteSearchHandler) Search

Search answers /search?q=: for the palette (htmx) only its answers, as a page the search without JavaScript.

type TelemetryHandler

type TelemetryHandler struct {
	// contains filtered or unexported fields
}

TelemetryHandler takes the counts self-hosted hubs send.

func NewTelemetryHandler

func NewTelemetryHandler(telemetry *service.TelemetryService) *TelemetryHandler

func (*TelemetryHandler) Receive

func (h *TelemetryHandler) Receive(w http.ResponseWriter, r *http.Request)

type UIHandler

type UIHandler struct {
	// contains filtered or unexported fields
}

UIHandler is the website of moin UI.

func NewUIHandler

func NewUIHandler(docs *service.DocsService, files fs.FS) *UIHandler

func (*UIHandler) Show

func (h *UIHandler) Show(w http.ResponseWriter, r *http.Request)

Show answers everything under /ui: the tabs, one block, one component, and a page with .md as its Markdown.

type UpdateHandler

type UpdateHandler struct {
	// contains filtered or unexported fields
}

UpdateHandler is the update notice of the web UI: a new release for the admins of a self-hosted hub.

func NewUpdateHandler

func NewUpdateHandler(updates *service.UpdateService) *UpdateHandler

func (*UpdateHandler) Notice

func (h *UpdateHandler) Notice(w http.ResponseWriter, r *http.Request)

Notice answers the notice, empty for anyone but an admin.

type WorkspaceHandler

type WorkspaceHandler struct {
	// contains filtered or unexported fields
}

func NewWorkspaceHandler

func NewWorkspaceHandler(workspaces *service.WorkspaceService) *WorkspaceHandler

func (*WorkspaceHandler) ActivityPage

func (h *WorkspaceHandler) ActivityPage(w http.ResponseWriter, r *http.Request)

ActivityPage shows what the team did, 50 events at a time. With after it renders only the next rows, for "Show older".

func (*WorkspaceHandler) ChangeRole

func (h *WorkspaceHandler) ChangeRole(w http.ResponseWriter, r *http.Request)

func (*WorkspaceHandler) Create

func (h *WorkspaceHandler) Create(w http.ResponseWriter, r *http.Request)

func (*WorkspaceHandler) Delete

func (h *WorkspaceHandler) Delete(w http.ResponseWriter, r *http.Request)

func (*WorkspaceHandler) Invite

func (h *WorkspaceHandler) Invite(w http.ResponseWriter, r *http.Request)

func (*WorkspaceHandler) Leave

func (*WorkspaceHandler) NewPage

func (h *WorkspaceHandler) NewPage(w http.ResponseWriter, r *http.Request)

func (*WorkspaceHandler) Page

func (*WorkspaceHandler) Redirect

func (h *WorkspaceHandler) Redirect(w http.ResponseWriter, r *http.Request)

func (*WorkspaceHandler) RemoveMember

func (h *WorkspaceHandler) RemoveMember(w http.ResponseWriter, r *http.Request)

func (*WorkspaceHandler) ResendInvitation

func (h *WorkspaceHandler) ResendInvitation(w http.ResponseWriter, r *http.Request)

func (*WorkspaceHandler) RevokeInvitation

func (h *WorkspaceHandler) RevokeInvitation(w http.ResponseWriter, r *http.Request)

func (*WorkspaceHandler) UpdateName

func (h *WorkspaceHandler) UpdateName(w http.ResponseWriter, r *http.Request)

type WorkspaceInvitationHandler

type WorkspaceInvitationHandler struct {
	// contains filtered or unexported fields
}

func NewWorkspaceInvitationHandler

func NewWorkspaceInvitationHandler(workspaces *service.WorkspaceService, cfg *config.Config) *WorkspaceInvitationHandler

func (*WorkspaceInvitationHandler) Accept

func (*WorkspaceInvitationHandler) Show

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL