bootstrap

package
v1.20.3 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const LegacyDefaultNodeSecret = "12345678"

LegacyDefaultNodeSecret is the node secret the original seed data shipped. The value is public knowledge, so an installation still carrying it serves the node API — which hands out every user's subscription uuid — to anyone.

Variables

This section is empty.

Functions

func Currency

func Currency(ctx *Dependencies)

func Device

func Device(ctx *Dependencies)

func Email

func Email(ctx *Dependencies)

Email get email smtp config

func Invite

func Invite(ctx *Dependencies)

func Migrate

func Migrate(ctx *Dependencies)

func Mobile

func Mobile(ctx *Dependencies)

func Node

func Node(ctx *Dependencies)

func NodeSecret

func NodeSecret(svcCtx *Dependencies)

NodeSecret provisions a random node secret when the database does not carry one yet, so a fresh installation never serves the node API with a guessable credential. It has to run after Migrate, which seeds the empty row, and before Node, which copies the value into the runtime config.

An installation still holding LegacyDefaultNodeSecret is only reported, never rotated: every node was configured with that secret, so rotating it here would silently cut them off. The operator rotates it from the admin panel and reconfigures the nodes in the same window.

func Register

func Register(ctx *Dependencies)

func Reload

func Reload(deps *Dependencies, subsystem string)

Reload refreshes the subsystem changed by an administrator. Startup-only migration and node-secret provisioning are deliberately excluded.

func Site

func Site(ctx *Dependencies)

func Start

func Start(deps *Dependencies)

Start loads startup state in dependency order. Migration and node-secret provisioning must precede every node configuration read.

func Subscribe

func Subscribe(svc *Dependencies)

func Telegram

func Telegram(svc *Dependencies)

Telegram (re)initialises the bot from the stored configuration. On failure it returns without touching the running state, so a transient error during re-initialisation leaves the previous bot working instead of none at all.

func Verify

func Verify(svc *Dependencies)

Types

type Dependencies

type Dependencies struct {
	Config                   func() config.Config
	UpdateConfig             func(func(*config.Config))
	Store                    repository.Store
	ExchangeRate             *billing.CurrencyRateCache
	Notification             notification.Service
	SetTelegramBot           func(*tgbot.Bot)
	SetNodeMultiplierManager func(*network.MultiplierManager)
}

Dependencies is the startup/reconfiguration boundary. It owns only mutable runtime configuration and the services needed to load or publish it.

Jump to

Keyboard shortcuts

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