utils

package
v0.90.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrServiceNotFound = errors.New("service not found")
View Source
var ServicePorts = map[string][]PortSpec{
	"debros-gateway": {
		{Name: "Gateway API", Port: 6001},
	},
	"debros-olric": {
		{Name: "Olric HTTP", Port: 3320},
		{Name: "Olric Memberlist", Port: 3322},
	},
	"debros-node": {
		{Name: "RQLite HTTP", Port: 5001},
		{Name: "RQLite Raft", Port: 7001},
	},
	"debros-ipfs": {
		{Name: "IPFS API", Port: 4501},
		{Name: "IPFS Gateway", Port: 8080},
		{Name: "IPFS Swarm", Port: 4101},
	},
	"debros-ipfs-cluster": {
		{Name: "IPFS Cluster API", Port: 9094},
	},
}

Functions

func EnsurePortsAvailable

func EnsurePortsAvailable(action string, ports []PortSpec) error

EnsurePortsAvailable checks if the specified ports are available

func GetProductionServices

func GetProductionServices() []string

GetProductionServices returns a list of all DeBros production service names that exist

func IsServiceActive

func IsServiceActive(service string) (bool, error)

IsServiceActive checks if a systemd service is currently active (running)

func IsServiceEnabled

func IsServiceEnabled(service string) (bool, error)

IsServiceEnabled checks if a systemd service is enabled to start on boot

func IsServiceMasked

func IsServiceMasked(service string) (bool, error)

IsServiceMasked checks if a systemd service is masked

func NormalizePeers

func NormalizePeers(peersStr string) ([]string, error)

NormalizePeers normalizes and validates peer multiaddrs

func ResolveServiceName

func ResolveServiceName(alias string) ([]string, error)

ResolveServiceName resolves service aliases to actual systemd service names

func ShowDryRunSummary

func ShowDryRunSummary(vpsIP, domain, branch string, peers []string, joinAddress string, isFirstNode bool, oramaDir string)

ShowDryRunSummary displays what would be done during installation without making changes

func ValidateDNSRecord

func ValidateDNSRecord(domain, expectedIP string) error

ValidateDNSRecord validates that the domain points to the expected IP address Returns nil if DNS is valid, warning message if DNS doesn't match but continues, or error if DNS lookup fails completely

func ValidateGeneratedConfig

func ValidateGeneratedConfig(oramaDir string) error

ValidateGeneratedConfig loads and validates the generated node configuration

Types

type IPFSClusterPeerInfo

type IPFSClusterPeerInfo struct {
	PeerID string
	Addrs  []string
}

IPFSClusterPeerInfo contains IPFS Cluster peer information for cluster discovery

type IPFSPeerInfo

type IPFSPeerInfo struct {
	PeerID string
	Addrs  []string
}

IPFSPeerInfo holds IPFS peer information for configuring Peering.Peers

type PortSpec

type PortSpec struct {
	Name string
	Port int
}

PortSpec defines a port and its name for checking availability

func CollectPortsForServices

func CollectPortsForServices(services []string, skipActive bool) ([]PortSpec, error)

CollectPortsForServices returns a list of ports used by the specified services

func DefaultPorts

func DefaultPorts() []PortSpec

DefaultPorts is used for fresh installs/upgrades before unit files exist.

Jump to

Keyboard shortcuts

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