initialize

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: GPL-3.0 Imports: 39 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 Config

func Config(path string) (chan bool, *server.Hertz)

func Currency added in v1.2.5

func Currency(ctx *Dependencies)

func Device added in v1.1.8

func Device(ctx *Dependencies)

func Email

func Email(ctx *Dependencies)

Email get email smtp config

func HandleDatabaseTest added in v1.2.12

func HandleDatabaseTest(_ context.Context, ctx *app.RequestContext)

func HandleMySQLTest

func HandleMySQLTest(ctx context.Context, requestCtx *app.RequestContext)

func HandleRedisTest

func HandleRedisTest(_ context.Context, ctx *app.RequestContext)

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 added in v1.16.0

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 Site

func Site(ctx *Dependencies)

func StartInitSystemConfig

func StartInitSystemConfig(deps *Dependencies)

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 added in v1.19.0

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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