infra

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InfraStats

type InfraStats struct {
	TotalServices int `json:"total_services"`
	Running       int `json:"running"`
	Stopped       int `json:"stopped"`
	External      int `json:"external"`
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(cfg *config.Config) *Manager

func (*Manager) CheckSecurityHealth

func (m *Manager) CheckSecurityHealth() *SecurityHealthCheck

CheckSecurityHealth verifies the security setup is correctly configured

func (*Manager) GetAgentPort

func (m *Manager) GetAgentPort() int

GetAgentPort returns the port the agent API is listening on

func (*Manager) GetDockerHostIP

func (m *Manager) GetDockerHostIP() string

GetDockerHostIP returns the IP address that containers can use to reach the host. It tries multiple methods and falls back to the default Docker bridge gateway.

func (*Manager) GetService

func (m *Manager) GetService(name string) (*models.InfraService, error)

func (*Manager) GetServiceLogs

func (m *Manager) GetServiceLogs(name string, tail int) (string, error)

func (*Manager) GetStats

func (m *Manager) GetStats() (*InfraStats, error)

func (*Manager) IsNginxRunning

func (m *Manager) IsNginxRunning() bool

IsNginxRunning checks if the nginx container is running

func (*Manager) ListServices

func (m *Manager) ListServices() ([]models.InfraService, error)

func (*Manager) RefreshSecurityScripts

func (m *Manager) RefreshSecurityScripts() (*RefreshSecurityScriptsResult, error)

RefreshSecurityScripts regenerates all security configs: nginx.conf, Lua scripts, and vhosts

func (*Manager) RestartService

func (m *Manager) RestartService(name string) error

func (*Manager) SetNginxRealtimeCapture

func (m *Manager) SetNginxRealtimeCapture(enabled bool) error

func (*Manager) SetNginxRealtimeCaptureWithStatus

func (m *Manager) SetNginxRealtimeCaptureWithStatus(enabled bool) (map[string]interface{}, error)

SetNginxRealtimeCaptureWithStatus enables/disables realtime capture and returns detailed status

func (*Manager) StartService

func (m *Manager) StartService(name string) error

func (*Manager) StopService

func (m *Manager) StopService(name string) error

func (*Manager) UpdateConfig

func (m *Manager) UpdateConfig(cfg *config.Config)

type RefreshSecurityScriptsResult

type RefreshSecurityScriptsResult struct {
	Success            bool     `json:"success"`
	AgentIP            string   `json:"agent_ip"`
	AgentPort          int      `json:"agent_port"`
	NginxConfWritten   bool     `json:"nginx_conf_written"`
	LuaWritten         bool     `json:"lua_written"`
	VolumesModified    bool     `json:"volumes_modified"`
	ContainerRecreated bool     `json:"container_recreated"`
	NginxReloaded      bool     `json:"nginx_reloaded"`
	VhostsUpdated      []string `json:"vhosts_updated,omitempty"`
	Errors             []string `json:"errors,omitempty"`
}

RefreshSecurityScriptsResult contains the result of refreshing security scripts

type SecurityHealthCheck

type SecurityHealthCheck struct {
	Status          string                 `json:"status"`
	Checks          map[string]bool        `json:"checks"`
	Issues          []string               `json:"issues"`
	Recommendations []string               `json:"recommendations"`
	Details         map[string]interface{} `json:"details,omitempty"`
}

SecurityHealthCheck represents the result of a security setup health check

Jump to

Keyboard shortcuts

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