Documentation
¶
Overview ¶
Package app assembles the shared panel services and HTTP surface for each edition.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackgroundJob ¶
BackgroundJob is one long-lived VPS worker. The edge runs only the bounded phases listed in edge_tick.go.
type Config ¶
type Config struct {
Store *store.Store
Vault *vault.Vault
Auth *auth.Service
Limiter securitylimit.Limiter
MasterKey []byte
Clock func() time.Time
Logger *slog.Logger
Instance InstanceConfig
DecoyDir string
PanelAddr string
DataDir string
UpdateService string
Title string
HealthBlipWindow time.Duration
BackgroundStarters []BackgroundJob
AfterResponse access.AfterResponseRunner
// Remote is the edge edition's node link. Setting it makes this the edge edition (fleet does the same): Me says so,
// and the RPCs that start work the edge does not run yet refuse with unavailable_in_edition.
Remote fleet.Remote
// ProvisionForward makes this panel hand SSH installs to the Provisioner (the edge Worker that holds the sockets): the
// ProvisioningService calls and the install page are answered, after the sign-in check, with a marker that the Worker
// turns into a request to that object. Without it, and without SSHClient, they are served here (and refused on the edge).
ProvisionForward bool
// ProvisionKick wakes the Provisioner (edge: set its alarm). The cron pass calls it while installs are pending; a
// Provisioner calls it when an install is queued. Nil: nothing to wake.
ProvisionKick func(context.Context) error
// SSHClient makes this panel the one that runs the installs (the Provisioner): it dials through it. Nil: the default
// client of the VPS edition.
SSHClient *nodeprovision.Client
// NodeBinaries is where an install gets the agent binary; nil: the update service (the signed bundle on disk).
NodeBinaries nodeprovision.BinarySource
}
Config contains the edition-specific dependencies and settings for the shared panel.
type InstanceConfig ¶
type InstanceConfig struct {
PublicURL string
AdminHost string
AdminPrefix string
AdminListen string
RPID string
RPOrigins []string
AgentSNI string
SubPrefix string
LinkPrefix string // secret path prefix of the signed agent WebSocket link; empty = not served by this handler
}
InstanceConfig is the stored reachability and WebAuthn configuration used by the panel.
func (InstanceConfig) AdminURL ¶
func (in InstanceConfig) AdminURL() string
AdminURL is the address the owner opens in a browser.
func (InstanceConfig) MuxPrefix ¶
func (in InstanceConfig) MuxPrefix() string
MuxPrefix is empty unless the admin lives under a secret path prefix.
type Panel ¶
type Panel struct {
Handler http.Handler
Server *httpserver.Server
Fleet *fleet.Fleet
Access *access.Service
Health *health.Service
Update *update.Service
Warp *warp.Service
Provision *nodeprovision.Service
Backup *backup.Service
Telegram *telegram.Service
Store *store.Store
Desired func(ctx context.Context, nodeID string) ([]statehash.Inbound, error)
BackgroundJobs []BackgroundJob
// contains filtered or unexported fields
}
Panel is the assembled panel: its public HTTP handler, VPS listener adapter and services.