ctrl

package module
v0.2.1 Latest Latest
Warning

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

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

README

Ctrl

ctrl is a Command & Control (C2) backend system for Servers, IOT and Edge platforms. Simply put, control anything.

Example use cases:

  • Send shell commands or scripts to control one or many end nodes that will instruct to change config, restart services and control those systems.
  • Gather data from both secure and not secure devices and systems, and transfer them encrypted in a secure way over the internet to your central system for handling those data.
  • Collect metrics or monitor end nodes, then send and store the result to some ctrl instance, or pass those data's on to another ctrl instance for further handling of metrics or monitoring data.
  • Distribute certificates.
  • Run as a sidecar in Kubernetes for direct access to the pod.

As long as you can do something as an operator in a shell on a system you can do the same with ctrl in a secure and encrypted way to one or all end nodes (servers) in one go with one single message/command.

Features

  • Run bash commands or complete scripts of your prefered scripting language (bash, python, powershell and so on).
  • Read and write to files.
  • Copy files.
  • ACL's to restric who can do what.

Doc

The complete documentation can be found here https://postmannen.github.io/ctrl/introduction.html

Example

An example of a request message to copy into ctrl's readfolder.

Quick start

Start up a local nats message broker

docker run -p 4444:4444 nats -p 4444

Create a ctrl docker image.

git clone [email protected]:postmannen/ctrl.git
cd ctrl
docker build -t ctrl:test1 .
mkdir -p testrun/readfolder
cd testrun

create a .env file

cat << EOF > .env
NODE_NAME="node1"
BROKER_ADDRESS="127.0.0,1:4444"
ENABLE_DEBUG=1
START_PUB_HELLO=60
IS_CENTRAL_ERROR_LOGGER=0
EOF

Start the ctrl container.

docker run --env-file=".env" --rm -ti -v $(PWD)/readfolder:/app/readfolder ctrl:test1

Prepare and send a message.

cat << EOF > msg.yaml
---
- toNodes:
    - node1
  method: cliCommand
  methodArgs:
    - "bash"
    - "-c"
    - |
      echo "some config line" > /etc/my-service-config.1
      echo "some config line" > /etc/my-service-config.2
      echo "some config line" > /etc/my-service-config.3
      systemctl restart my-service

  replyMethod: none
  ACKTimeout: 0
EOF

cp msg.yaml readfolder
Input methods

New Request Messages in Json/Yaml format can be injected by the user to ctrl in the following ways:

  • Unix Socket. Use for example netcat or another tool to deliver new messages to a socket like nc -U tmp/ctrl.sock < msg.yaml.
  • Read Folder. Write/Copy messages to be delivered to the readfolder of ctrl.
  • TCP Listener, Use for example netcat or another tool to deliver new messages a TCP Listener like nc localhost:8888 < msg.yaml.
Error messages from nodes
  • Error messages will be sent back to the central error handler and the originating node upon failure.

The error logs can be read on the central server in the directory <ctrl-home>/data/errorLog, and in the log of the instance the source node. You can also create a message to read the errorlog if you don't have direct access to the central server.

Flags and configuration file

ctrl supports both the use of flags with env variables. An .env file can also be used.

Schema for the messages to send into ctrl via the API's
Field Name Value Type Description
toNode string A single node to send a message to
toNodes string array A comma separated list of nodes to send a message to
jetstreamToNode string array JetstreamToNode, the topic used to prefix the stream name with the format NODES.<JetstreamToNode>
method string The request method to use
methodArgs string array The arguments to use for the method
replyMethod string The method to use for the reply message
replyMethodArgs string array The arguments to use for the reply method
ACKTimeout int The time to wait for a received acknowledge (ACK). 0 for no acknowledge
retries int The number of times to retry if no ACK was received
replyACKTimeout int The timeout to wait for an ACK message before we retry
replyRetries int The number of times to retry if no ACK was received for repply messages
methodTimeout int The timeout in seconds for how long we wait for a method to complete
replyMethodTimeout int The timeout in seconds for how long we wait for a method to complete for repply messages
directory string The directory for where to store the data of the repply message
fileName string The name of the file for where we store the data of the reply message
schedule [int type value for interval in seconds, int type value for total run time in seconds] Schedule a message to re run at interval
Request Methods
Method name Description
opProcessList Get a list of the running processes
opProcessStart Start up a process
opProcessStop Stop a process
cliCommand Will run the command given, and return the stdout output of the command when the command is done
cliCommandCont Will run the command given, and return the stdout output of the command continously while the command runs
tailFile Tail log files on some node, and get the result for each new line read sent back in a reply message
httpGet Scrape web url, and get the html sent back in a reply message
hello Send Hello messages
copySrc Copy a file from one node to another node
errorLog Method for receiving error logs for Central error logger
none Don't send a reply message
console Print to stdout or stderr
fileAppend Append to file, can also write to unix sockets
file Write to file, can also write to unix sockets
portSrc Forward tcp conntections between ctrl nodes

History

ctrl is the continuation of the code I earlier wrote for RaaLabs called Steward. The original repo was public with a MIT license, but in October 2023 the original repo was made private, and are no longer avaialable to the public. The goal of this repo is to provide an actively maintained, reliable and stable version. This is also a playground for myself to test out ideas an features for such a service as described earlier.

This started out as an idea I had for how to control infrastructure. This is the continuation of the same idea, and a project I'm working on free of charge in my own spare time, so please be gentle :)

NB: Filing of issues and bug fixes are highly appreciated. Feature requests will genereally not be followed up simply because I don't have the time to review it at this time :

Steward was written with an MIT License. With the new fork the service was renamed to ctrl and the license were changed to AGPL V3.0. More information in the LICENSE-CHANGE.md and LICENSE files.

Disclaimer

All code in this repository are to be concidered not-production-ready, and the use is at your own responsibility and risk. The code are the attempt to concretize the idea of a purely async management system where the controlling unit is decoupled from the receiving unit, and that that we know the state of all the receiving units at all times.

Also read the license file for further details.

Expect the main branch to have breaking changes. If stability is needed, use the released packages, and read the release notes where changes will be explained.

Documentation

Overview

Notes:

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrACKSubscribeRetry = errors.New("ctrl: retrying to subscribe for ack message")
	// TODO: Other errors are not used for anything other than printing.
	ErrOther = errors.New("other error")
)

Functions

func CheckEnv

func CheckEnv[T any](key string, v T) any

func EncodeSeed

func EncodeSeed(public PrefixByte, src []byte) ([]byte, error)

EncodeSeed will encode a raw key with the prefix and then seed prefix and crc16 and then base32 encoded. This is a slightly modified version of the function found in the nkeys package, just with less options.

func NewPortInitialData

func NewPortInitialData(uuid string, sourceNode Node, sourceSubMethod Method, sourcePort string, destinationNode Node, destinationSubMethod Method, destinationPort string, maxSessionTimeout int) portInitialData

NewPortInitialData creates a new portInitialData struct.

func NewPortSortedBuffer

func NewPortSortedBuffer() *portSortedBuffer

NewPortSortedBuffer creates a new portSortedBuffer.

func NewServer

func NewServer(configuration *Configuration, version string) (*server, error)

newServer will prepare and return a server type

Types

type Configuration

type Configuration struct {
	// Shell on the operating system to use when executing cliCommands
	ShellOnNode string
	// ConfigFolder, the location for the configuration folder on disk
	ConfigFolder string `comment:"ConfigFolder, the location for the configuration folder on disk"`
	// The folder where the socket file should live
	SocketFolder string `comment:"The folder where the socket file should live"`
	// The folder where the readfolder should live
	ReadFolder string `comment:"The folder where the readfolder should live"`
	// EnableReadFolder for enabling the read messages api from readfolder
	EnableReadFolder bool `comment:"EnableReadFolder for enabling the read messages api from readfolder"`
	// TCP Listener for sending messages to the system, <host>:<port>
	TCPListener string `comment:"TCP Listener for sending messages to the system, <host>:<port>"`
	// HTTP Listener for sending messages to the system, <host>:<port>
	HTTPListener string `comment:"HTTP Listener for sending messages to the system, <host>:<port>"`
	// The folder where the database should live
	DatabaseFolder string `comment:"The folder where the database should live"`
	// Unique string to identify this Edge unit
	NodeName string `comment:"Unique string to identify this Edge unit"`
	// NodeAlias for adding extra aliases for the node name
	NodeAlias string `comment:"NodeAlias"`
	// The address of the message broker, <address>:<port>
	BrokerAddress string `comment:"The address of the message broker, <address>:<port>"`
	// NatsConnOptTimeout the timeout for trying the connect to nats broker
	NatsConnOptTimeout int `comment:"NatsConnOptTimeout the timeout for trying the connect to nats broker"`
	// Nats connect retry interval in seconds
	NatsConnectRetryInterval int `comment:"Nats connect retry interval in seconds"`
	// NatsReconnectJitter in milliseconds
	NatsReconnectJitter int `comment:"NatsReconnectJitter in milliseconds"`
	// NatsReconnectJitterTLS in seconds
	NatsReconnectJitterTLS int `comment:"NatsReconnectJitterTLS in seconds"`
	// KeysUpdateInterval in seconds
	KeysUpdateInterval int `comment:"KeysUpdateInterval in seconds"`
	// AclUpdateInterval in seconds
	AclUpdateInterval int `comment:"AclUpdateInterval in seconds"`
	// The type of profiling
	Profiling string
	// The number of the profiling port
	ProfilingPort string `comment:"The number of the profiling port"`
	// Host and port for prometheus listener, e.g. localhost:2112
	PromHostAndPort string `comment:"Host and port for prometheus listener, e.g. localhost:2112"`
	// Comma separated list of additional streams to consume from.
	JetstreamsConsume string `comment:"a comma separated list of other jetstream subjects to consume"`
	// Jetstream MaxMsgsPerSubject
	JetStreamMaxMsgsPerSubject int `comment:"max messages to keep on the broker for a jetstream subject"`
	// Set to true if this is the node that should receive the error log's from other nodes
	DefaultMessageTimeout int `comment:"Set to true if this is the node that should receive the error log's from other nodes"`
	// Default value for how long can a request method max be allowed to run in seconds
	DefaultMethodTimeout int `comment:"Default value for how long can a request method max be allowed to run in seconds"`
	// Default amount of retries that will be done before a message is thrown away, and out of the system
	DefaultMessageRetries int `comment:"Default amount of retries that will be done before a message is thrown away, and out of the system"`
	// The path to the data folder
	SubscribersDataFolder string `comment:"The path to the data folder"`
	// Name of central node to receive logs, errors, key/acl handling
	CentralNodeName string `comment:"Name of central node to receive logs, errors, key/acl handling"`
	// The full path to the certificate of the root CA
	RootCAPath string `comment:"The full path to the certificate of the root CA"`
	// Full path to the NKEY's seed file
	NkeySeedFile string `comment:"Full path to the NKEY's seed file"`
	// The full path to the NKEY user file
	NkeyPublicKey string `toml:"-"`
	//
	NkeyFromED25519SSHKeyFile string `` /* 185-byte string literal not displayed */
	// NkeySeed
	NkeySeed string `toml:"-"`
	// The host and port to expose the data folder, <host>:<port>
	ExposeDataFolder string `comment:"The host and port to expose the data folder, <host>:<port>"`
	// Timeout in seconds for error messages
	ErrorMessageTimeout int `comment:"Timeout in seconds for error messages"`
	// Retries for error messages
	ErrorMessageRetries int `comment:"Retries for error messages"`
	// SetBlockProfileRate for block profiling
	SetBlockProfileRate int `comment:"SetBlockProfileRate for block profiling"`
	// EnableSocket for enabling the creation of a ctrl.sock file
	EnableSocket bool `comment:"EnableSocket for enabling the creation of a ctrl.sock file"`
	// EnableSignatureCheck to enable signature checking
	EnableSignatureCheck bool `comment:"EnableSignatureCheck to enable signature checking"`
	// EnableAclCheck to enable ACL checking
	EnableAclCheck bool `comment:"EnableAclCheck to enable ACL checking"`

	// LogLevel
	LogLevel             string `comment:"LogLevel error/info/warning/debug/none."`
	LogConsoleTimestamps bool   `comment:"LogConsoleTimestamps true/false for enabling or disabling timestamps when printing errors and information to stderr"`
	// KeepPublishersAliveFor number of seconds
	// Timer that will be used for when to remove the sub process
	// publisher. The timer is reset each time a message is published with
	// the process, so the sub process publisher will not be removed until
	// it have not received any messages for the given amount of time.
	KeepPublishersAliveFor int `` /* 309-byte string literal not displayed */

	StartProcesses StartProcesses
}

Configuration are the structure that holds all the different configuration options used both with flags and the config file. If a new field is added to this struct there should also be added the same field to the ConfigurationFromFile struct, and an if check should be added to the checkConfigValues function to set default values when reading from config file.

func NewConfiguration

func NewConfiguration() *Configuration

NewConfiguration will return a *Configuration.

func (*Configuration) CreateKeyPair

func (c *Configuration) CreateKeyPair(prefix PrefixByte) (kp, error)

CreateKeyPair will create the key nkeys key pair. This is a slightly modified version of the function found in the nkeys package, just with less options.

type Handler

type Handler func(proc process, message Message, node string) ([]byte, error)

type HostACLsSerializedWithHash

type HostACLsSerializedWithHash struct {
	// data is all the ACL's for a specific node serialized serialized into cbor.
	Data []byte
	// hash is the sha256 hash of the ACL's.
	// With maps the order are not guaranteed, so A sorted appearance
	// of the ACL map for a host node is used when creating the hash,
	// so the hash stays the same unless the ACL is changed.
	Hash [32]byte
}

HostACLsSerializedWithHash holds the serialized representation node specific ACL's in the authSchema. There is also a sha256 hash of the data.

type Message

type Message struct {

	// The node to send the message to.
	ToNode Node `json:"toNode" yaml:"toNode"`
	// ToNodes to specify several hosts to send message to in the
	// form of an slice/array.
	// The ToNodes field is only a concept that exists when messages
	// are injected f.ex. on a socket, and there they are directly
	//converted into separate node messages for each node, and from
	// there the ToNodes field is not used any more within the system.
	// With other words, a message that exists within ctrl is always
	// for just for a single node.
	ToNodes []Node `json:"toNodes,omitempty" yaml:"toNodes,omitempty"`
	// JetstreamToNode, the topic used to prefix the stream name with
	// with the format NODES.<JetstreamToNode> .
	JetstreamToNode Node `json:"jetstreamToNode" yaml:"jetstreamToNode"`
	// The Unique ID of the message
	ID int `json:"id" yaml:"id"`
	// The actual data in the message. This is typically where we
	// specify the cli commands to execute on a node, and this is
	// also the field where we put the returned data in a reply
	// message.
	Data []byte `json:"data" yaml:"data"`
	// Method, what request type to use, like REQCliCommand, REQHttpGet..
	Method Method `json:"method" yaml:"method"`
	// Additional arguments that might be needed when executing the
	// method. Can be f.ex. an ip address if it is a tcp sender, or the
	// shell command to execute in a cli session.
	MethodArgs []string `json:"methodArgs" yaml:"methodArgs"`
	// ArgSignature is the ed25519 signature of the methodArgs.
	ArgSignature []byte `json:"argSignature" yaml:"argSignature"`
	// ReplyMethod, is the method to use for the reply message.
	// By default the reply method will be set to log to file, but
	// you can override it setting your own here.
	ReplyMethod Method `json:"replyMethod" yaml:"replyMethod"`
	// Additional arguments that might be needed when executing the reply
	// method. Can be f.ex. an ip address if it is a tcp sender, or the
	// shell command to execute in a cli session.
	ReplyMethodArgs []string `json:"replyMethodArgs" yaml:"replyMethodArgs"`
	// IsReply are used to tell that this is a reply message. By default
	// the system sends the output of a request method back to the node
	// the message originated from. If it is a reply method we want the
	// result of the reply message to be sent to the central server, so
	// we can use this value if set to swap the toNode, and fromNode
	// fields.
	IsReply bool `json:"isReply" yaml:"isReply"`
	// From what node the message originated
	FromNode Node `json:"fromNode" yaml:"fromNode"`
	// ACKTimeout for waiting for an ack message
	ACKTimeout int `json:"ACKTimeout" yaml:"ACKTimeout"`
	// RetryWait specified the time in seconds to wait between retries.
	RetryWait int `json:"retryWait" yaml:"retryWait"`
	// IsSubPublishedMsg enables timeout of publishing process, and is used together with process.isSubProcess to be able to terminate the sub processes publishers.
	IsSubPublishedMsg bool `json:"isSubPublishedMsg" yaml:"isSubPublishedMsg"`
	// Resend retries
	Retries int `json:"retries" yaml:"retries"`
	// The ACK timeout of the new message created via a request event.
	ReplyACKTimeout int `json:"replyACKTimeout" yaml:"replyACKTimeout"`
	// The retries of the new message created via a request event.
	ReplyRetries int `json:"replyRetries" yaml:"replyRetries"`
	// Timeout for long a process should be allowed to operate
	MethodTimeout int `json:"methodTimeout" yaml:"methodTimeout"`
	// Timeout for long a process should be allowed to operate
	ReplyMethodTimeout int `json:"replyMethodTimeout" yaml:"replyMethodTimeout"`
	// Directory is a string that can be used to create the
	//directory structure when saving the result of some method.
	// For example "syslog","metrics", or "metrics/mysensor"
	// The type is typically used in the handler of a method.
	Directory string `json:"directory" yaml:"directory"`
	// FileName is used to be able to set a wanted name
	// on a file being saved as the result of data being handled
	// by a method handler.
	FileName string `json:"fileName" yaml:"fileName"`
	// PreviousMessage are used for example if a reply message is
	// generated and we also need a copy of  the details of the the
	// initial request message.
	PreviousMessage *Message
	// Schedule
	Schedule []int `json:"schedule" yaml:"schedule"`
	// Use auto detection of shell for cliCommands
	UseDetectedShell bool `json:"useDetectedShell" yaml:"useDetectedShell"`
	// MethodInstructions is a string that contains eventual extra instructions
	// for the method that is used when the method is executed.
	MethodInstructions []string `json:"methodInstructions" yaml:"methodInstructions"`
	// ReplyMethodInstructions is a string that contains eventual extra instructions
	// for the method that is used when the reply method is executed for the reply message.
	ReplyMethodInstructions []string `json:"replyMethodInstructions" yaml:"replyMethodInstructions"`
	// contains filtered or unexported fields
}

type Method

type Method string

Method is used to specify the actual function/method that is represented in a typed manner.

const (
	// Initial parent method used to start other processes.
	Initial Method = "initial"
	// Get a list of all the running processes.
	OpProcessList Method = "opProcessList"
	// Start up a process.
	OpProcessStart Method = "opProcessStart"
	// Stop up a process.
	OpProcessStop Method = "opProcessStop"
	// Execute a CLI command in for example bash or cmd.
	// This is an event type, where a message will be sent to a
	// node with the command to execute and an ACK will be replied
	// if it was delivered succesfully. The output of the command
	// ran will be delivered back to the node where it was initiated
	// as a new message.
	// The data field is a slice of strings where the first string
	// value should be the command, and the following the arguments.
	CliCommand Method = "cliCommand"
	// REQCliCommandCont same as normal Cli command, but can be used
	// when running a command that will take longer time and you want
	// to send the output of the command continually back as it is
	// generated, and not wait until the command is finished.
	CliCommandCont Method = "cliCommandCont"
	// Send text to be logged to the console.
	// The data field is a slice of strings where the first string
	// value should be the command, and the following the arguments.
	Console Method = "console"
	// Send text logging to some host by appending the output to a
	// file, if the file do not exist we create it.
	// A file with the full subject+hostName will be created on
	// the receiving end.
	// The data field is a slice of strings where the values of the
	// slice will be written to the log file.
	FileAppend Method = "fileAppend"
	// Send text to some host by overwriting the existing content of
	// the fileoutput to a file. If the file do not exist we create it.
	// A file with the full subject+hostName will be created on
	// the receiving end.
	// The data field is a slice of strings where the values of the
	// slice will be written to the file.
	File Method = "file"
	// Initiated by the user.
	CopySrc Method = "copySrc"
	// Initial request for file copying.
	// Generated by the source to send initial information to the destination.
	CopyDst Method = "copyDst"
	// Read the source file to be copied to some node.
	SUBCopySrc Method = "subCopySrc"
	// Write the destination copied to some node.
	SUBCopyDst Method = "subCopyDst"

	PortSrc    Method = "portSrc"
	PortDst    Method = "PortDst"
	SUBPortSrc Method = "subPortSrc"
	SUBPortDst Method = "subPortDst"

	DummySrc    Method = "dummySrc"
	DummyDst    Method = "dummyDst"
	SUBDummySrc Method = "subDummySrc"
	SUBDummyDst Method = "subDummyDst"

	// Hello I'm here message.
	Hello          Method = "hello"
	HelloPublisher Method = "helloPublisher"
	// Error log methods to centralError node.
	ErrorLog Method = "errorLog"
	// Http Get
	HttpGet Method = "httpGet"
	// Tail file
	TailFile Method = "tailFile"
	// REQNone is used when there should be no reply.
	None Method = "none"
	// REQTest is used only for testing to be able to grab the output
	// of messages.
	Test Method = "test"

	// REQPublicKey will get the public ed25519 key from a node.
	PublicKey Method = "publicKey"
	// KeysUpdateRequest will receive all the messages of the current hash of all public keys
	// a node have stored, and send out an update if needed..
	KeysUpdateRequest Method = "keysUpdateRequest"
	// KeysUpdateReceive,deliver the public key from central to a node.
	KeysUpdateReceive Method = "keysUpdateReceive"
	// REQKeysAllow
	KeysAllow Method = "keysAllow"
	// REQKeysDelete
	KeysDelete Method = "keysDelete"

	// REQAclRequestUpdate will get all node acl's from central if an update is available.
	AclRequestUpdate Method = "aclRequestUpdate"
	// REQAclDeliverUpdate will deliver the acl from central to a node.
	AclDeliverUpdate Method = "aclDeliverUpdate"

	// REQAclAddCommand
	AclAddCommand = "aclAddCommand"
	// REQAclDeleteCommand
	AclDeleteCommand = "aclDeleteCommand"
	// REQAclDeleteSource
	AclDeleteSource = "aclDeleteSource"
	// REQGroupNodesAddNode
	AclGroupNodesAddNode = "aclGroupNodesAddNode"
	// REQAclGroupNodesDeleteNode
	AclGroupNodesDeleteNode = "aclGroupNodesDeleteNode"
	// REQAclGroupNodesDeleteGroup
	AclGroupNodesDeleteGroup = "aclGroupNodesDeleteGroup"
	// REQAclGroupCommandsAddCommand
	AclGroupCommandsAddCommand = "aclGroupCommandsAddCommand"
	// REQAclGroupCommandsDeleteCommand
	AclGroupCommandsDeleteCommand = "aclGroupCommandsDeleteCommand"
	// REQAclGroupCommandsDeleteGroup
	AclGroupCommandsDeleteGroup = "aclGroupCommandsDeleteGroup"
	// REQAclExport
	AclExport = "aclExport"
	// REQAclImport
	AclImport = "aclImport"

	// WebUI is used to send messages to the web ui.
	WebUI Method = "webUI"
)

------------------------------------------------------------ The constants that will be used throughout the system for when specifying what kind of Method to send or work with.

func (Method) GetMethodsAvailable

func (m Method) GetMethodsAvailable() MethodsAvailable

The mapping of all the method constants specified, what type it references. The primary use of this table is that messages are not able to pass the actual type of the request since it is sent as a string, so we use the below table to find the actual type based on that string type.

type MethodsAvailable

type MethodsAvailable struct {
	Methodhandlers map[Method]Handler
}

MethodsAvailable holds a map of all the different method types and the associated handler to that method type.

func (MethodsAvailable) CheckIfExists

func (ma MethodsAvailable) CheckIfExists(m Method) (Handler, bool)

Check if exists will check if the Method is defined. If true the bool value will be set to true, and the methodHandler function for that type will be returned.

type Node

type Node string

Node is the type definition for the node who receive or send a message.

type PrefixByte

type PrefixByte byte
const PrefixByteSeed PrefixByte = 18 << 3 // Base32-encodes to 'S...'

PrefixByteSeed is the version byte used for encoded NATS Seeds

const PrefixByteUser PrefixByte = 20 << 3 // Base32-encodes to 'U...'

PrefixByteUser is the version byte used for encoded NATS Users

type StartProcesses

type StartProcesses struct {
	// StartPubHello, sets the interval in seconds for how often we send hello messages to central server
	StartPubHello int `comment:"StartPubHello, sets the interval in seconds for how often we send hello messages to central server"`
	// Enable the updates of public keys
	EnableKeyUpdates bool `comment:"Enable the updates of public keys"`

	// Enable the updates of acl's
	EnableAclUpdates bool `comment:"Enable the updates of acl's"`

	// Start the central error logger.
	IsCentralErrorLogger bool `comment:"Start the central error logger."`
	// Start subscriber for hello messages
	StartSubHello bool `comment:"Start subscriber for hello messages"`
	// Start subscriber for text logging
	StartSubFileAppend bool `comment:"Start subscriber for text logging"`
	// Start subscriber for writing to file
	StartSubFile bool `comment:"Start subscriber for writing to file"`
	// Start subscriber for reading files to copy
	StartSubCopySrc bool `comment:"Start subscriber for reading files to copy"`
	// Start subscriber for writing copied files to disk
	StartSubCopyDst bool `comment:"Start subscriber for writing copied files to disk"`
	// Start subscriber for Echo Request
	StartSubCliCommand bool `comment:"Start subscriber for CLICommand"`
	// Start subscriber for Console
	StartSubConsole bool `comment:"Start subscriber for Console"`
	// Start subscriber for HttpGet
	StartSubHttpGet bool `comment:"Start subscriber for HttpGet"`
	// Start subscriber for tailing log files
	StartSubTailFile bool `comment:"Start subscriber for tailing log files"`
	// Start subscriber for continously delivery of output from cli commands.
	StartSubCliCommandCont bool `comment:"Start subscriber for continously delivery of output from cli commands."`

	// IsCentralKey, will make the node the central key handler for public keys.
	IsCentralKey bool
	// IsCentralAcl, enable to make this instance take the role as the central
	// server that holds all the ACL's, and the handling av the ACL's.
	IsCentralAcl bool `comment:"IsCentralAcl, enable to make this instance take the role as the central auth server"`
}

type Subject

type Subject struct {
	// node, the name of the node to receive the message.
	ToNode string `json:"node" yaml:"toNode"`
	// method, what is this message doing, etc. CLICommand, Syslog, etc.
	Method Method `json:"method" yaml:"method"`
}

subject contains the representation of a subject to be used with one specific process

Directories

Path Synopsis
cmd
ctrl command
doc
concept/auth command
scripts

Jump to

Keyboard shortcuts

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