config

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config loads runtime settings from the environment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	PanelAddr string
	NodeUUID  string
	Token     string
	Insecure  bool
	// ServerName overrides the TLS SNI when the panel sits behind a proxy.
	ServerName string

	XrayBinary  string
	XrayWorkDir string
	// XrayAPIAddr is the local address of the xray stats API injected into the
	// generated configuration.
	XrayAPIAddr string

	LogLevel string
}

Agent holds the node agent settings.

func LoadAgent

func LoadAgent() (*Agent, error)

type Panel

type Panel struct {
	// HTTPAddr serves the REST API and the embedded web UI.
	HTTPAddr string
	// GRPCAddr accepts agent control streams.
	GRPCAddr string

	DatabaseURL string
	JWTSecret   string
	TokenTTL    time.Duration

	// PublicURL is the externally reachable panel origin, used to build
	// subscription links and node installation commands.
	PublicURL string
	// SubscriptionPublicURL overrides PublicURL for subscription links when the
	// subscription page is served from a separate domain.
	SubscriptionPublicURL string

	// GRPCPublicHost/Port is what a node agent dials back on. Behind the
	// bundled Caddy this is the panel's domain on 443, and GRPCPublicTLS makes
	// the generated install command tell the agent to dial over TLS.
	GRPCPublicHost string
	GRPCPublicPort int
	GRPCPublicTLS  bool

	BootstrapAdmin    string
	BootstrapPassword string

	HeartbeatInterval time.Duration
	UsageInterval     time.Duration
	UsageRetention    time.Duration

	SubscriptionProfileTitle string
	SubscriptionSupportURL   string

	// AgentDistDir holds prebuilt node agent binaries the panel serves at
	// /dist, so a node can install itself without a Go toolchain or a registry.
	AgentDistDir string

	CORSOrigins []string
	LogLevel    string
	TLSCert     string
	TLSKey      string
}

Panel holds every setting the panel process needs.

func LoadPanel

func LoadPanel() (*Panel, error)

Jump to

Keyboard shortcuts

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