config

package
v0.0.0-...-5f17d81 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RegisterInstanceEndpoint   = "/api/v1/instances/register"
	GetInstanceDetailsEndpoint = "/api/v1/instances"
	GetUpdatesInfoEndpoint     = "/api/v1/updates"
	SetUpdateSentEndpoint      = "/api/v1/updates/sent"
	GetLicenseEndpoint         = "/api/v1/licenses"
	HealthEndpoint             = "/api/v1/health"
	LogCollectorEndpoint       = "/api/v1/logcollectors/upload"
	GetLatestVersionEndpoint   = "/api/v1/versions/latest"

	GitHubReleasesURL = "https://github.com/utmstack/UTMStack/releases/download/%s/installer"

	ImagesPath = "/utmstack/images"

	RequiredMinCPUCores  = 2
	RequiredMinDiskSpace = 30
	RequiredDistroUbuntu = "ubuntu"
	RequiredDistroRHEL   = "redhat"
)

Variables

View Source
var (
	DEFAULT_BRANCH    string
	INSTALLER_VERSION string
	REPLACE           string
	PUBLIC_KEY        string

	BackendConfigEndpoint  = "https://127.0.0.1/api/utm-configuration-parameters?page=0&size=10000&sectionId.equals=%d&sort=id,asc"
	ConfigPath             = filepath.Join("/root", "utmstack.yml")
	InstanceConfigPath     = filepath.Join(GetConfig().UpdatesFolder, "instance-config.yml")
	ServiceLogPath         = filepath.Join(GetConfig().UpdatesFolder, "logs", "utmstack-updater.log")
	VersionFilePath        = filepath.Join(GetConfig().UpdatesFolder, "version.json")
	LicenseFilePath        = filepath.Join(GetConfig().UpdatesFolder, "LICENSE")
	EventProcessorLogsPath = filepath.Join(GetConfig().DataDir, "events-engine-workdir", "logs")
	CheckUpdatesEvery      = 5 * time.Minute
	SyncSystemLogsEvery    = 5 * time.Minute
	ConnectedToInternet    = false
	Updating               = false
)

Functions

func DetectAirGapMode

func DetectAirGapMode() bool

func GetCMServer

func GetCMServer() string

func Logger

func Logger() *twlogger.Logger

Types

type Config

type Config struct {
	MainServer    string  `yaml:"main_server"`
	Branch        string  `yaml:"branch"`
	Password      string  `yaml:"password"`
	DataDir       string  `yaml:"data_dir"`
	ServerType    string  `yaml:"server_type"`
	ServerName    string  `yaml:"server_name"`
	InternalKey   string  `yaml:"internal_key"`
	UpdatesFolder string  `yaml:"updates_folder"`
	MappingName   *string `yaml:"mapping_name,omitempty"`
}

func GetConfig

func GetConfig() *Config

func (*Config) Set

func (c *Config) Set() error

Jump to

Keyboard shortcuts

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