realmadmin

package module
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

README

DEB-package automation

./cmd - a directory containing the source code files with .go and .sh extensions.

  • .go - compile binaries with the same name as the directory. Store them in ${TMP_DIR}.
  • .sh - copy them to ${TMP_DIR}.

TODO

  • Select Go version from go.mod
  • Compile all main.go files with environment variables
  • Handle binaries in nfpm shell scripts
  • Configure preinstall-nfpm script

Hints

Calculated IPv6 to IPv4:

echo "fdcc:1786:d861::3" | cut -f 2,3 -d ':' | sed 's/\://' | xxd -r -p | hexdump -v -e '/1 "%u."' | sed 's/\.$/\n/'

Keydesk brigade ID to Database UUID:

echo "${brigade_id}=========" | base32 -d 2>/dev/null | hexdump -ve '1/1 "%02x"'

Database UUID to Keydesk brigade ID:

echo "${brigade_id}" | xxd -r -p -l 16 | base32 | tr -d "="

License

This project is licensed under the Mozilla Public License 2.0. See the LICENSE file for more details.

See the COPYRIGHT file for detailed copyright information.

Documentation

Index

Constants

View Source
const AggrSnapsVersion = 2

AggrStatsVersion - current version of aggregated stats.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggrSnaps

type AggrSnaps struct {
	Version    int       `json:"version"`
	UpdateTime time.Time `json:"update_time"`

	// ExternalIPFiltered is a filtered prefix if applicable.
	ExternalIPFiltered netip.Prefix `json:"ext_ip_filtered,omitempty"`

	// ControlNodeFiltered is a filtered prefix if applicable.
	ControlNodeFiltered netip.Prefix `json:"ctrl_node_filtered,omitempty"`

	// DatacenterID is a datacenter id.
	DatacenterID string `json:"datacenter_id"`

	// identification tag, using to ident whole snapshot.
	// 2023-01-01T00:00:00Z-regular-quarter-snapshot.
	Tag string `json:"tag"`

	// GlobalSnapAt is a time of the global snapshot start.
	// It is used to identify the snapshot.
	GlobalSnapAt time.Time `json:"global_snap_at"`

	// RealmKeyFP is a fingerprint of the realm public key.
	RealmKeyFP string `json:"realm_key_fp"`

	// AuthorityKeyFP is a fingerprint of the authority public key
	// with which the PSK was encrypted.
	AuthorityKeyFP string `json:"authority_key_fp"`
	// PSK is a secret, which is used to concatenate with
	// the main secret and LockerSecret to get the final secret.
	// We need to provide it to decrypt the payload.
	// PSK is encrypted with Realm public key or Authority
	// public key determined by situation.
	EncryptedPreSharedSecret string `json:"encrypted_psk"`

	Snaps []*EncryptedBrigade `json:"snaps"`

	// TotalCount is a total count of the snapshots.
	TotalCount int `json:"total_count"`

	// ErrorsCount is a count of the errors during the snapshot collection.
	ErrorsCount int `json:"errors_count"`
}

AggrSnaps - structure for aggregated stats with additional fields.

type Answer

type Answer struct {
	keydesk.Answer
	KeydeskIPv6 netip.Addr `json:"keydesk_ipv6"`
	FreeSlots   int        `json:"free_slots"`
}

type ControlNodeRestorePlan

type ControlNodeRestorePlan struct {
	Plan []*storage.Brigade `json:"plan"`
}

ControlNodeRestorePlan - control node restore plan.

type EncryptedBrigade

type EncryptedBrigade struct {
	snapCore.EncryptedBrigade
	InstanceID string `json:"instance_id"`
}

EncryptedBrigade - structure for encrypted brigade with additional fields.

type InstancedSnaps

type InstancedSnaps struct {
	Snaps []*EncryptedBrigade `json:"snaps"`

	TotalCount  int `json:"total_count"`
	ErrorsCount int `json:"errors_count"`
}

InstancedSnaps - structure for encrypted brigade with additional fields.

type PreparedSnap

type PreparedSnap struct {
	BrigadeID       string   `json:"brigade_id"`
	EndpointIPv4    string   `json:"endpoint_ipv4"`
	DomainNames     []string `json:"domain_names"`
	Payload         string   `json:"payload"`          // encrypted by realm public key
	EncryptedSecret string   `json:"encrypted_secret"` // encrypted by target realm public key
}

PreparedSnap - prepared snapshot.

type ReservationConfig

type ReservationConfig struct {
	ReservationID string                  `json:"reservation_id"`
	Plan          []ReservationNodeConfig `json:"plan"`
}

ReservationConfig - reservation config.

type ReservationNodeConfig

type ReservationNodeConfig struct {
	ControlIP        string   `json:"control_ip"`
	RouterNACLPubKey string   `json:"router_nacl_pubkey"`
	Slots            []string `json:"slots"`
}

ReservationNodeConfig - reservation node config.

type RestoreNodeConfig

type RestoreNodeConfig struct {
	ControlIP string         `json:"control_ip"`
	Snaps     []PreparedSnap `json:"snaps"`
}

RestoreNodeConfig - restore node config.

type RestorePlan

type RestorePlan struct {
	RealmFP       string              `json:"realm_fp"`
	ReservationID string              `json:"reservation_id"`
	Plan          []RestoreNodeConfig `json:"plan"`
}

RestorePlan - restore plan.

Jump to

Keyboard shortcuts

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