nats

package module
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

README

OpenUEM - NATS

Repository containing the OpenUEM NATS message exchange struct and common utils

This repository is used by OpenUEM's workers, agents and the console as a submodule

Documentation

Index

Constants

View Source
const DISABLED = "systemupdate.disabled"
View Source
const NOTIFY_BEFORE_DOWNLOAD = "systemupdate.notify_before_download"
View Source
const NOTIFY_BEFORE_INSTALLATION = "systemupdate.notify_before_installation"
View Source
const NOTIFY_SCHEDULED_INSTALLATION = "systemupdate.notify_scheduled_installation"
View Source
const NOT_CONFIGURED = "systemupdate.not_configured"
View Source
const REGISTER_APPROVED = "users.approved"
View Source
const REGISTER_CERTIFICATE_SENT = "users.certificate_sent"
View Source
const REGISTER_COMPLETE = "users.completed"
View Source
const REGISTER_FORCE_PASSWORD_CHANGE = "users.force_change_password"
View Source
const REGISTER_IN_REVIEW = "users.review_request"
View Source
const REGISTER_OIDC_FIRST_LOGIN = "users.oidc_first_login"
View Source
const REGISTER_PASSWORD_LINK_SENT = "users.password_link_sent"
View Source
const REGISTER_REVOKED = "users.certificate_revoked"
View Source
const REGISTER_SEND_CERTIFICATE = "users.send_certificate"
View Source
const UNKNOWN = "systemupdate.unknown"
View Source
const UPDATE_ERROR = "admin.update.agents.task_status_error"
View Source
const UPDATE_PENDING = "admin.update.agents.task_status_pending"
View Source
const UPDATE_SUCCESS = "admin.update.agents.task_status_success"

Variables

This section is empty.

Functions

func ConnectWithNATS

func ConnectWithNATS(servers, clientCert, clientKey, caCert string) (*nats.Conn, error)

func ConnectWithNATSTOKEN

func ConnectWithNATSTOKEN(servers, token string) (*nats.Conn, error)

func RegisterPossibleStatus

func RegisterPossibleStatus() []string

func SystemUpdatePossibleStatus

func SystemUpdatePossibleStatus() []string

func TaskUpdatePossibleStatus

func TaskUpdatePossibleStatus() []string

Types

type AgentCertificateData

type AgentCertificateData struct {
	CertBytes       []byte `json:"cert_bytes,omitempty"`
	PrivateKeyBytes []byte `json:"private_key_bytes,omitempty"`
}

type AgentReport

type AgentReport struct {
	AgentID                     string           `json:"id,omitempty"`
	OS                          string           `json:"os,omitempty"`
	Hostname                    string           `json:"hostname,omitempty"`
	Release                     Release          `json:"release,omitempty"`
	ExecutionTime               time.Time        `json:"execution_time,omitempty"`
	IP                          string           `json:"ip,omitempty"`
	WAN                         string           `json:"wan_ip,omitempty"`
	MACAddress                  string           `json:"mac,omitempty"`
	SFTPPort                    string           `json:"sftp_port,omitempty"`
	VNCProxyPort                string           `json:"vnc_proxy_port,omitempty"`
	Enabled                     bool             `json:"enabled,omitempty"`
	DebugMode                   bool             `json:"debug,omitempty"`
	Computer                    Computer         `json:"computer"`
	Antivirus                   Antivirus        `json:"antivirus"`
	OperatingSystem             OperatingSystem  `json:"operatingsystem"`
	LogicalDisks                []LogicalDisk    `json:"logicaldisks,omitempty"`
	PhysicalDisks               []PhysicalDisk   `json:"physicaldisks,omitempty"`
	Monitors                    []Monitor        `json:"monitors,omitempty"`
	MemorySlots                 []MemorySlot     `json:"memoryslots,omitempty"`
	Printers                    []Printer        `json:"printers,omitempty"`
	Shares                      []Share          `json:"shares,omitempty"`
	SystemUpdate                SystemUpdate     `json:"systemupdate"`
	NetworkAdapters             []NetworkAdapter `json:"networkadapters,omitempty"`
	Applications                []Application    `json:"apps,omitempty"`
	LoggedOnUsers               []LoggedOnUser   `json:"loggedonusers,omitempty"`
	SupportedVNCServer          string           `json:"vnc,omitempty"`
	Updates                     []Update         `json:"updates,omitempty"`
	LastUpdateTaskExecutionTime time.Time        `json:"last_update_task_execution_time"`
	LastUpdateTaskStatus        string           `json:"last_update_task_status,omitempty"`
	LastUpdateTaskResult        string           `json:"last_update_task_result,omitempty"`
	CertificateReady            bool             `json:"certificate_ready,omitempty"`
	RestartRequired             bool             `json:"restart_required,omitempty"`
	SftpServiceDisabled         bool             `json:"sftp_service_disabled,omitempty"`
	RemoteAssistanceDisabled    bool             `json:"remote_assistance_disabled,omitempty"`
	Tenant                      string           `json:"tenant,omitempty"`
	Site                        string           `json:"site,omitempty"`
	IsWayland                   bool             `json:"is_wayland,omitempty"`
	HasRustDesk                 bool             `json:"has_rust_desk,omitempty"`
	HasRustDeskService          bool             `json:"has_rust_desk_service,omitempty"`
	IsFlatpakRustDesk           bool             `json:"is_flatpak_rust_desk,omitempty"`
	Netbird                     Netbird          `json:"netbird"`
}

type AgentSetting

type AgentSetting struct {
	DebugMode        bool
	SFTPService      bool
	RemoteAssistance bool
	SFTPPort         string
	VNCProxyPort     string
}

type Antivirus

type Antivirus struct {
	Name      string `json:"name,omitempty"`
	IsActive  bool   `json:"is_active,omitempty"`
	IsUpdated bool   `json:"is_updated,omitempty"`
}

type Application

type Application struct {
	Name        string `json:"name,omitempty"`
	Version     string `json:"version,omitempty"`
	InstallDate string `json:"install_date,omitempty"`
	Publisher   string `json:"publisher,omitempty"`
}

type CertificateRequest

type CertificateRequest struct {
	FullName       string   `json:"fullname,omitempty"`
	Email          string   `json:"email,omitempty"`
	Username       string   `json:"username,omitempty"`
	Organization   string   `json:"organization,omitempty"`
	Country        string   `json:"country,omitempty"`
	Province       string   `json:"province,omitempty"`
	Locality       string   `json:"locality,omitempty"`
	Address        string   `json:"address,omitempty"`
	PostalCode     string   `json:"postal_code,omitempty"`
	YearsValid     int      `json:"years_valid,omitempty"`
	MonthsValid    int      `json:"months_valid,omitempty"`
	DaysValid      int      `json:"days_valid,omitempty"`
	Password       string   `json:"password,omitempty"`
	OCSPResponders []string `json:"ocsp_responders,omitempty"`
	ConsoleURL     string   `json:"console_url,omitempty"`
	AgentId        string   `json:"agentId,omitempty"`
	DNSName        string   `json:"dns_name,omitempty"`
}

type CfgProfiles

type CfgProfiles struct {
	AgentID string `json:"agentID,omitempty"`
}

type Computer

type Computer struct {
	Manufacturer   string `json:"manufacturer,omitempty"`
	Model          string `json:"model,omitempty"`
	Serial         string `json:"serial,omitempty"`
	Processor      string `json:"processor,omitempty"`
	ProcessorArch  string `json:"processor_arch,omitempty"`
	ProcessorCores int64  `json:"processor_cores,omitempty"`
	Memory         uint64 `json:"memory,omitempty"`
}

type Config

type Config struct {
	Ok                       bool `json:"ok,omitempty"`
	AgentFrequency           int  `json:"agent_frequency,omitempty"`
	WinGetFrequency          int  `json:"winget_frequency,omitempty"`
	SFTPDisabled             bool `json:"sftp_disabled,omitempty"`
	RemoteAssistanceDisabled bool `json:"remote_assistance_disabled,omitempty"`
}

type DeployAction

type DeployAction struct {
	AgentId        string    `json:"agentid,omitempty"`
	Action         string    `json:"action,omitempty"`
	When           time.Time `json:"when,omitempty"`
	PackageId      string    `json:"packageid,omitempty"`
	PackageName    string    `json:"packagename,omitempty"`
	PackageVersion string    `json:"packageversion,omitempty"`
	Repository     string    `json:"repository,omitempty"`
	Info           string    `json:"info,omitempty"`
	Failed         bool      `json:"failed,omitempty"`
}

type FileInfo

type FileInfo struct {
	Arch     string `json:"arch,omitempty"`
	Os       string `json:"os,omitempty"`
	FileURL  string `json:"file_url,omitempty"`
	Checksum string `json:"checksum,omitempty"`
}

type LoggedOnUser

type LoggedOnUser struct {
	Name      string    `json:"name,omitempty"`
	LastLogon time.Time `json:"last_logon"`
}

type LogicalDisk

type LogicalDisk struct {
	Label                 string `json:"label,omitempty"`
	Usage                 int8   `json:"usage,omitempty"`
	Filesystem            string `json:"filesystem,omitempty"`
	SizeInUnits           string `json:"size_in_units,omitempty"`
	RemainingSpaceInUnits string `json:"remaining_space_in_units,omitempty"`
	VolumeName            string `json:"volume_name,omitempty"`
	BitLockerStatus       string `json:"bitlocker_status,omitempty"`
}

type MemorySlot

type MemorySlot struct {
	Slot         string `json:"slot,omitempty"`
	Size         string `json:"size,omitempty"`
	MemoryType   string `json:"type,omitempty"`
	SerialNumber string `json:"serial_number,omitempty"`
	PartNumber   string `json:"part_number,omitempty"`
	Speed        string `json:"speed,omitempty"`
	Manufacturer string `json:"manufacturer,omitempty"`
}

type Monitor

type Monitor struct {
	Manufacturer      string `json:"manufacturer,omitempty"`
	Model             string `json:"model,omitempty"`
	Serial            string `json:"serial,omitempty"`
	WeekOfManufacture string `json:"week_of_manufacture,omitempty"`
	YearOfManufacture string `json:"year_of_manufacture,omitempty"`
}

type NetBirdGroups

type NetBirdGroups struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	PeersCount int    `json:"peers_count"`
}

type Netbird

type Netbird struct {
	Version             string   `json:"version,omitempty"`
	Installed           bool     `json:"installed,omitempty"`
	IP                  string   `json:"ip,omitempty"`
	Profile             string   `json:"profile,omitempty"`
	ManagementURL       string   `json:"management_url,omitempty"`
	ManagementConnected bool     `json:"management_connected,omitempty"`
	SignalURL           string   `json:"signal_url,omitempty"`
	SignalConnected     bool     `json:"signal_connected,omitempty"`
	PeersTotal          int      `json:"peers_total,omitempty"`
	PeersConnected      int      `json:"peers_connected,omitempty"`
	SSHEnabled          bool     `json:"ssh_enabled,omitempty"`
	ServiceStatus       string   `json:"service_status,omitempty"`
	Profiles            []string `json:"profiles,omitempty"`
	DNSServers          []string `json:"dns_servers,omitempty"`
	Error               string   `json:"error,omitempty"`
}

type NetbirdSettings

type NetbirdSettings struct {
	OneOffKey     string `json:"key,omitempty"`
	ManagementURL string `json:"management_url,omitempty"`
	Profile       string `json:"profile,omitempty"`
}

type NetbirdTask

type NetbirdTask struct {
	ID           string          `json:"id"`
	Install      bool            `json:"install,omitempty"`
	Uninstall    bool            `json:"uinstall,omitempty"`
	Register     bool            `json:"register,omitempty"`
	RegisterInfo NetbirdSettings `json:"register_info,omitempty"`
}

type NetworkAdapter

type NetworkAdapter struct {
	Name              string    `json:"name,omitempty"`
	MACAddress        string    `json:"mac_address,omitempty"`
	Addresses         string    `json:"addresses,omitempty"`
	Subnet            string    `json:"subnet,omitempty"`
	DefaultGateway    string    `json:"default_gateway,omitempty"`
	DNSServers        string    `json:"dns_servers,omitempty"`
	DNSDomain         string    `json:"dns_domain,omitempty"`
	DHCPEnabled       bool      `json:"dhcp_enabled,omitempty"`
	DHCPLeaseObtained time.Time `json:"dhcp_lease_obtained"`
	DHCPLeaseExpired  time.Time `json:"dhcp_lease_expired"`
	Speed             string    `json:"speed,omitempty"`
	Virtual           bool      `json:"virtual,omitempty"`
}

type Notification

type Notification struct {
	From                   string `json:"from,omitempty"`
	To                     string `json:"to,omitempty"`
	Subject                string `json:"subject,omitempty"`
	MessageTitle           string `json:"message_title,omitempty"`
	MessageGreeting        string `json:"message_greeting,omitempty"`
	MessageText            string `json:"message_text,omitempty"`
	MessageAction          string `json:"message_action,omitempty"`
	MessageActionURL       string `json:"message_action_url,omitempty"`
	MessageAttachFileName  string `json:"message_attach_filename,omitempty"`
	MessageAttachFile      string `json:"message_attach_file,omitempty"`
	MessageAttachFileName2 string `json:"message_attach_filename2,omitempty"`
	MessageAttachFile2     string `json:"message_attach_file2,omitempty"`
}

type OpenUEMRelease

type OpenUEMRelease struct {
	Version         string     `json:"version,omitempty"`
	Channel         string     `json:"channel,omitempty"`
	Summary         string     `json:"summary,omitempty"`
	ReleaseNotesURL string     `json:"release_notes,omitempty"`
	ReleaseDate     time.Time  `json:"release_date,omitempty"`
	Files           []FileInfo `json:"files,omitempty"`
	IsCritical      bool       `json:"is_critical,omitempty"`
}

type OpenUEMServerRelease

type OpenUEMServerRelease struct {
	Version         string                      `json:"version,omitempty"`
	Channel         string                      `json:"channel,omitempty"`
	Summary         string                      `json:"summary,omitempty"`
	ReleaseNotesURL string                      `json:"release_notes,omitempty"`
	ReleaseDate     time.Time                   `json:"release_date,omitempty"`
	Files           map[string][]ServerFileInfo `json:"files,omitempty"`
	IsCritical      bool                        `json:"is_critical,omitempty"`
}

type OpenUEMUpdateRequest

type OpenUEMUpdateRequest struct {
	Version      string    `json:"version,omitempty"`
	Channel      string    `json:"channel,omitempty"`
	DownloadFrom string    `json:"download,omitempty"`
	DownloadHash string    `json:"download_hash,omitempty"`
	UpdateAt     time.Time `json:"updated_at,omitempty"`
	UpdateNow    bool      `json:"update_now,omitempty"`
}

type OperatingSystem

type OperatingSystem struct {
	Version        string    `json:"version,omitempty"`
	Description    string    `json:"description,omitempty"`
	InstallDate    time.Time `json:"install_date"`
	Edition        string    `json:"edition,omitempty"`
	Arch           string    `json:"arch,omitempty"`
	Username       string    `json:"username,omitempty"`
	LastBootUpTime time.Time `json:"last_bootup_time"`
	Domain         string    `json:"domain,omitempty"`
}

type PhysicalDisk

type PhysicalDisk struct {
	DeviceID     string `json:"device_id,omitempty"`
	Model        string `json:"model,omitempty"`
	SerialNumber string `json:"serial_number,omitempty"`
	SizeInUnits  string `json:"size_in_units,omitempty"`
}

type Printer

type Printer struct {
	Name      string `json:"name,omitempty"`
	Port      string `json:"port,omitempty"`
	IsDefault bool   `json:"is_default,omitempty"`
	IsNetwork bool   `json:"is_network,omitempty"`
	IsShared  bool   `json:"is_shared,omitempty"`
}

type ProfileConfig

type ProfileConfig struct {
	ProfileID     int                           `yaml:"profileID"`
	Exclusions    []string                      `yaml:"exclusions"`
	Deployments   []string                      `yaml:"deployments"`
	WinGetConfig  *wingetcfg.WinGetCfg          `yaml:"config,omitempty"`
	AnsibleConfig []*ansiblecfg.AnsiblePlaybook `yaml:"ansible,omitempty"`
	NetBirdConfig []*NetbirdTask                `yaml:"netbird,omitempty"`
}

type RebootOrRestart

type RebootOrRestart struct {
	Date time.Time `json:"date,omitempty"`
}

type Release

type Release struct {
	Version      string    `json:"version,omitempty"`
	Channel      string    `json:"channel,omitempty"`
	Summary      string    `json:"summary,omitempty"`
	ReleaseNotes string    `json:"release_notes,omitempty"`
	FileURL      string    `json:"file_url,omitempty"`
	Checksum     string    `json:"checksum,omitempty"`
	IsCritical   bool      `json:"is_critical,omitempty"`
	ReleaseDate  time.Time `json:"release_date,omitempty"`
	Arch         string    `json:"arch,omitempty"`
	Os           string    `json:"os,omitempty"`
}

type RemoteConfigRequest

type RemoteConfigRequest struct {
	AgentID  string `json:"agentID,omitempty"`
	TenantID string `json:"tenantID,omitempty"`
	SiteID   string `json:"siteID,omitempty"`
}

type RustDesk

type RustDesk struct {
	CustomRendezVousServer  string `json:"customRendezVousServer,omitempty"`
	RelayServer             string `json:"relayServer,omitempty"`
	APIServer               string `json:"apiServer,omitempty"`
	Key                     string `json:"key,omitempty"`
	PermanentPassword       string `json:"permanentPassword,omitempty"`
	Whitelist               string `json:"whitelist,omitempty"`
	DirectIPAccess          bool   `json:"directIPAccess,omitempty"`
	VerificationMethod      string `json:"verificationMethod,omitempty"`
	TemporaryPasswordLength int    `json:"temporaryPasswordLength,omitempty"`
}

type RustDeskResult

type RustDeskResult struct {
	Error      string `json:"error"`
	RustDeskID string `json:"id"`
}

type ServerFileInfo

type ServerFileInfo struct {
	Arch     string `json:"arch,omitempty"`
	Os       string `json:"os,omitempty"`
	FileURL  string `json:"file_url,omitempty"`
	Checksum string `json:"checksum,omitempty"`
}

type Share

type Share struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Path        string `json:"path,omitempty"`
}

type SoftwarePackage

type SoftwarePackage struct {
	ID     string `json:"ID,omitempty"`
	Name   string `json:"name,omitempty"`
	Source string `json:"source,omitempty"`
}

type SystemUpdate

type SystemUpdate struct {
	Status         string    `json:"status,omitempty"`
	LastInstall    time.Time `json:"last_install"`
	LastSearch     time.Time `json:"last_search"`
	PendingUpdates bool      `json:"pending_updates,omitempty"`
}

type Update

type Update struct {
	Title      string    `json:"title,omitempty"`
	Date       time.Time `json:"date"`
	SupportURL string    `json:"support_url,omitempty"`
}

type VNCConnection

type VNCConnection struct {
	PIN        string `json:"pin,omitempty"`
	NotifyUser bool   `json:"notify_user,omitempty"`
}

type WingetCfgDeploy

type WingetCfgDeploy struct {
	PackageID string `json:"PackageID,omitempty"`
	Installed bool   `json:"installed,omitempty"`
}

WingetCfgDeploy allows the agent to inform if a package has been installed or desinstalled using Winget configure

type WingetCfgReport

type WingetCfgReport struct {
	ProfileID int    `json:"profileID,omitempty"`
	AgentID   string `json:"agentID,omitempty"`
	Success   bool   `json:"success,omitempty"`
	Error     string `json:"error,omitempty"`
}

type WingetPackage

type WingetPackage struct {
	ID   string `json:"ID,omitempty"`
	Name string `json:"name,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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