apps

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 28 Imported by: 1 module, 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 apps is the applications roof's root: the closed table of the node's resident applications, the seam they assemble through, and the environment their constructors adapt. Each entry carries its name, the registration of its own run arguments, its role bounds, the applications it requires beside it, the admission method it pairs with, and its constructor; the --applications run argument selects among the entries — unset to keep the inference the run arguments practice, empty to run the deliberate core, given to load exactly the names it lists. The application packages sit one beneath the roof and import the core, the libraries, and the siblings their entries require — never the assembly, the harness, the commands, or this root; the table imports them, and the assembly imports the table.

Index

Constants

View Source
const DefaultHostPort = 51820

DefaultHostPort is the host-facing port's default, the WireGuard ecosystem's conventional port; zero is the explicit refusal, running no host-serving application.

Variables

View Source
var Table = []Entry{
	wireguardEntry,
	coordinationEntry,
	egressEntry,
	mihomoEntry,
	votingEntry,
	portalEntry,
	pingEntry,
}

Table is the closed list of the resident applications in the order the borrows need: the WireGuard application first, its borrowers after, which is the reverse of the release. Adding an application adds a package beneath the roof and an entry here; the assembly walks the table and touches nothing.

Functions

func RegisterFlags

func RegisterFlags(flags *pflag.FlagSet, args *Arguments)

RegisterFlags registers every entry's own run arguments over the command's flag set, in table order — the walk the commands run when they build their surfaces.

Types

type Application

type Application interface {
	// Run runs the application's loops until the context is canceled,
	// each in its own goroutine with a panic absorbed and logged, and
	// returns once every goroutine it started has returned. It may close
	// what nothing borrows to end a loop; what a borrower uses stays for
	// Close.
	Run(ctx context.Context) error
	// Close releases what the constructor bound, once Run has returned, or
	// alone when Run never ran — a failed boot releases applications whose
	// Run never started. A second call releases nothing again.
	Close()
}

Application is the seam a resident application assembles through: Run launches its loops under the node's supervision, and Close releases it in the node's reverse-order release walk. Its surfaces mount through the environment as its constructor builds them. The concrete applications satisfy it without importing this package.

func AppOf

func AppOf(loaded []Loaded, name string) Application

AppOf returns the application the name names among the loaded, nil when the name did not load: the borrows' resolution point.

type Arguments

type Arguments struct {
	// Wireguard is the WireGuard application's block.
	Wireguard WireguardArguments
}

Arguments holds the resident applications' own run arguments, one block per entry: the commands register the blocks from the table, and each constructor adapts its own. The zero value refuses every argument-gated application.

type Entry

type Entry struct {
	// Name is the application's name, what --applications lists.
	Name string
	// RegisterFlags registers the entry's own run arguments over the
	// commands' flag sets, the destinations in the entry's block of
	// Arguments. Nil when the application takes no argument.
	RegisterFlags func(*pflag.FlagSet, *Arguments)
	// CoreOnly bounds the entry to the founding core.
	CoreOnly bool
	// Requires names the applications the entry needs beside it: a list
	// that names this entry without one of them refuses the boot, for
	// requirements never imply.
	Requires []string
	// MissingArg names the entry's loading argument and why it refuses the
	// loading, when the entry's own arguments are refused — the inference
	// regime skips the entry and a list that names it refuses the boot,
	// the same fact read twice. "" when the entry loads on any arguments.
	MissingArg func(*Arguments) string
	// Admission names the admission method the entry pairs with: the entry
	// loads exactly when --trust.enroll-auth selects the method — the
	// inference regime loads it beside the method and skips it without, and
	// a list refuses either without the other. "" when the entry loads
	// under any method.
	Admission string
	// New constructs the application from the environment and the loaded —
	// the applications earlier in table order, where a borrower finds the
	// owner's exported surface.
	New func(*Environment, []Loaded) (Application, error)
}

Entry is one resident application's place in the table: the name the list selects by, the registration of the application's own run arguments, its role bounds, the applications it requires beside it, the admission method it pairs with, and the constructor that adapts the environment into the application's own configuration.

func Select

func Select(list []string, core bool, args Arguments, admission string) ([]Entry, error)

Select resolves the applications the list names against the table, core marking the founding core and admission naming the selected admission method, "" for none: nil keeps the inference — an entry loads whose role bounds hold, whose requirements load, whose required arguments are present, and whose paired method is the one selected, the zero-conf default; the empty list loads none, the deliberate core; a given list loads exactly the named entries, in table order whatever order the list spells. Every miscombination refuses, the fix named.

type Environment

type Environment struct {
	// Arguments are the resident applications' own run arguments; each
	// constructor reads its own entry's block.
	Arguments Arguments
	// IA is the node's ISD-AS; Core marks the founding core's role.
	IA   addr.IA
	Core bool
	// StateRoot is the state directory's root; each application keeps its
	// own state beneath.
	StateRoot string
	// ControlHost is the control address, "host:port"; its host is the
	// underlay host the host-facing port binds.
	ControlHost string
	// Domain is the core's WebPKI identity — the founding core's own when
	// Core is set, the network's core identity otherwise.
	Domain string
	// HTTPSOrigin is the origin the founding core's HTTPS server answers
	// on: https:// and the domain, with the harness's port when its
	// placement binds one other than HTTPS's own.
	HTTPSOrigin string
	// Resolvers are the DNS resolvers the node's applications resolve
	// names through, as --dns.resolvers names them; empty names none.
	Resolvers []netip.Addr
	// Engine provides the node's chain for the directory channel; Paths
	// leases the paths the mesh datagrams ride.
	Engine *trust.Engine
	Paths  Paths
	// Memberships lists the memberships the node's membership method holds
	// that have not lapsed — on the founding core, every node's.
	Memberships func(ctx context.Context) ([]membership.Membership, error)
	// NewConn binds the node's sending conn on an ephemeral port: the
	// socket the application's own services ride.
	NewConn func() (*scion.Conn, error)
	// Bus is the node's bus, the topics of the state the node's components
	// share.
	Bus *bus.Bus
	// RegisterSvc and UnregisterSvc register and retire one of the
	// application's sockets as a SCION service in this AS, on the serving
	// data plane generation and on every one to come.
	RegisterSvc   func(svc addr.SVC, port uint16) error
	UnregisterSvc func(svc addr.SVC, port uint16) error
	// Authorizer is the selected admission policy the applications ask —
	// open where none loads. The coordination application's registrations
	// ask its verdict, and the portal application decides through it.
	Authorizer enrollauth.AdmissionAuthorizer
	// TRCDecision is the control plane's decision on the TRC updates the
	// cores submit: the founder's own gates, the pin of what verifies as
	// submitted, and the sensitive vote it casts on its admission policy's
	// allow. Nil on every node but the founding core, the one role the
	// voting application loads on; the application refuses to load
	// without it.
	TRCDecision voting.Decider
	// RemoveNode removes a node from the network: from the TRC at once
	// where it names the node a core, then its membership by the
	// membership method's rule. Nil on every node but the founding core,
	// the one role the portal loads on.
	RemoveNode func(ctx context.Context, ia addr.IA) error
	// MountControlEndpoint mounts one of the application's handlers on the
	// node's control endpoint, behind the peer-identity middleware, beside
	// the drafts' services.
	MountControlEndpoint func(pattern string, handler http.Handler)
	// MountHTTPS mounts one of the application's handlers on the founding
	// core's HTTPS server, beside the ACME challenge, at a pattern no other
	// application mounts — a pattern mounted twice refuses the boot.
	MountHTTPS func(pattern string, handler http.Handler)
	// FounderRoute resolves the route to the founding core the directory's
	// publish and fetch ride on every other node; the founding core needs
	// none, serving the directory itself.
	FounderRoute func() *scion.Addr
	// Relay carries the relay derivation's inputs: the production form
	// derives from the domain, and the harness's placement — its loopback
	// address and pinned certificate — stands in for the domain and the
	// WebPKI. The zero value derives everything from Domain.
	Relay RelayPlacement
	// Internet is the integration harness's stand-in for the internet: the
	// address the egress's outbound legs reach for each destination a host
	// addresses. Nil reaches each destination itself.
	Internet func(netip.AddrPort) netip.AddrPort
	// DirectoryPacing overrides the directory's publish and fetch cadence;
	// zero keeps the production constants.
	DirectoryPacing time.Duration
}

Environment is the node's facts the entries' constructors adapt into their applications' own configurations: everything the assembly's phases produced that a resident consumes, built once when the applications assemble.

type Loaded

type Loaded struct {
	Name string
	App  Application
}

Loaded is one constructed application: its name beside what its entry's constructor returned. The list grows in table order as the constructors return, and the assembly's walks — the starts, the reverse release — read it.

type Paths

type Paths interface {
	Lease(dst addr.IA) *scion.Lease
}

Paths is the node's path resolution as the residents call it: each destination's lease.

type RelayPlacement

type RelayPlacement struct {
	URL       string
	IPv4      string
	CertName  string
	RelayOnly bool
}

RelayPlacement is the harness's stand-in for the production relay derivation: the relay's URL as the presences dial it and the advertisements carry, the address that dials it without DNS, the pinned certificate's name, and the relay-only posture that forces the relay leg in the netmap.

type WireguardArguments

type WireguardArguments struct {
	// HostPort is the shared host-facing UDP port every host dials. It
	// alone decides whether the node serves hosts: zero runs no WireGuard
	// application, nor any application requiring it.
	HostPort uint16
}

WireguardArguments is the WireGuard application's own run arguments.

Directories

Path Synopsis
Package coordination is the coordination application: the network's headscale, minimal by decision, served by the core alone beside the WireGuard application.
Package coordination is the coordination application: the network's headscale, minimal by decision, served by the core alone beside the WireGuard application.
Package egress is the egress application: the node's netstack, which ends the TCP and UDP flows the hosts send to the internet and opens them again from the node's own sockets, relays their echo requests on the node's own ICMP socket, and serves the node's own address — the first of its slice — to the applications that borrow a listener on it.
Package egress is the egress application: the node's netstack, which ends the TCP and UDP flows the hosts send to the internet and opens them again from the node's own sockets, relays their echo requests on the node's own ICMP socket, and serves the node's own address — the first of its slice — to the applications that borrow a listener on it.
Package mihomo is the mihomo application: the mihomo proxy provider a node serves its hosts at its own address, listing one tailnet client instance per exit the tailnet topic names — each node with a slice, the node's own among them — so a host's mihomo chooses its exit per flow.
Package mihomo is the mihomo application: the mihomo proxy provider a node serves its hosts at its own address, listing one tailnet client instance per exit the tailnet topic names — each node with a slice, the node's own among them — so a host's mihomo chooses its exit per flow.
Package ping is CION's SCMP-echo application, the network's probe: its resident prober measures the paths the node's picks and leases ask it to, and publishes their records on the node bus.
Package ping is CION's SCMP-echo application, the network's probe: its resident prober measures the paths the node's picks and leases ask it to, and publishes their records on the node bus.
Package portal is the operator's console: the resident application the founding core serves beneath /admin/ on its HTTPS server, paired with the portal admission method it decides for.
Package portal is the operator's console: the resident application the founding core serves beneath /admin/ on its HTTPS server, paired with the portal admission method it decides for.
Package voting is the TRC voting application: the resident application a founding core hosts for the cores of its ISD to submit TRC updates on.
Package voting is the TRC voting application: the resident application a founding core hosts for the cores of its ISD to submit TRC updates on.
Package wireguard is CION's WireGuard application: wireguard-go embedded in the CION binary, carrying the tailnet's hosts and the node-to-node mesh.
Package wireguard is CION's WireGuard application: wireguard-go embedded in the CION binary, carrying the tailnet's hosts and the node-to-node mesh.
impl/bbolt
Package bbolt is the application directory's bbolt store, following the trust DB's pattern: a small file, values marshaled beside their keys — node entries keyed by ISD-AS, host entries by public key.
Package bbolt is the application directory's bbolt store, following the trust DB's pattern: a small file, values marshaled beside their keys — node entries keyed by ISD-AS, host entries by public key.
impl/dbtest
Package dbtest holds the application directory store's contract tests, shared by every implementation the way the trust DB's are.
Package dbtest holds the application directory store's contract tests, shared by every implementation the way the trust DB's are.

Jump to

Keyboard shortcuts

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