app

package
v0.1.28 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: AGPL-3.0 Imports: 30 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

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

type BackgroundJob struct {
	Name string
	Run  func(context.Context)
}

BackgroundJob is one long-lived VPS worker. Edge callers receive the list but do not run it.

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
}

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
}

Panel is the assembled panel: its public HTTP handler, VPS listener adapter and services.

func Build

func Build(c Config) (*Panel, error)

Build wires services into the HTTP handler shared by the VPS and edge editions.

Jump to

Keyboard shortcuts

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