Documentation ¶
Overview ¶
Embedspawn lets you run the spawn binary main function inside another program
This is used by ask.systems/daemon, but feel free to use it if you want to!
Index ¶
- Variables
- func Run(flagset *flag.FlagSet, args []string)
- type Command
- func (*Command) Descriptor() ([]byte, []int)deprecated
- func (cmd *Command) FullName() string
- func (x *Command) GetArgs() []string
- func (x *Command) GetAutoTlsCerts() bool
- func (x *Command) GetBinary() string
- func (x *Command) GetFiles() []string
- func (x *Command) GetName() string
- func (x *Command) GetNoChroot() bool
- func (x *Command) GetPorts() []uint32
- func (x *Command) GetUser() string
- func (x *Command) GetWorkingDir() string
- func (*Command) ProtoMessage()
- func (x *Command) ProtoReflect() protoreflect.Message
- func (x *Command) Reset()
- func (x *Command) String() string
- type Config
Constants ¶
This section is empty.
Variables ¶
View Source
var File_embedspawn_config_proto protoreflect.FileDescriptor
View Source
var MegabinaryCommands []string
MegabinaryCommands is the list of commands that spawn should use as sub-commands of the binary running spawn. The main ask.systems/daemon binary sets this so spawn can run commands from it.
Functions ¶
Types ¶
type Command ¶
type Command struct { // Binary is the absolute path to the executable file or the relative // path within the directory provided in the -path flag. // // Required. Binary string `protobuf:"bytes,1,opt,name=binary,proto3" json:"binary,omitempty"` // User to run the process as. Cannot be root. // // Required. User string `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty"` // Additional name to show in the dashboard to keep logs separate Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // If unset, cd and/or chroot into $HOME, otherwise use this directory WorkingDir string `protobuf:"bytes,8,opt,name=working_dir,json=workingDir,proto3" json:"working_dir,omitempty"` // Set to true if you don't want the binary run in chroot at working_dir NoChroot bool `protobuf:"varint,7,opt,name=no_chroot,json=noChroot,proto3" json:"no_chroot,omitempty"` // Args is the arguments to pass to the executable Args []string `protobuf:"bytes,4,rep,name=args,proto3" json:"args,omitempty"` // Ports to listen on (with tcp) and pass to the process as files. // Useful for accessing the privelaged ports (<1024). // // In the child process, the sockets will have fd = 3 + i, where Ports[i] is // the port to bind Ports []uint32 `protobuf:"varint,5,rep,packed,name=ports,proto3" json:"ports,omitempty"` // Files to open and pass to the process // // In the child process, the files will have fd = 3 + len(Ports) + i, where // Files[i] is the file Files []string `protobuf:"bytes,6,rep,name=files,proto3" json:"files,omitempty"` // Set to true if all of the files are tls certs you want to keep // autoupdated. This is assumed to be true for portal. You only need this if // you want to make your own binary that gets files refreshed. // // This makes the files in the above array a pipe that will be updated with // the file contents on startup and when spawn in sent the SIGUSR1 signal. // // To use this run the following command after renewing your cert: // // killall -SIGUSR1 {portal,spawn} AutoTlsCerts bool `protobuf:"varint,9,opt,name=auto_tls_certs,json=autoTlsCerts,proto3" json:"auto_tls_certs,omitempty"` // contains filtered or unexported fields }
Next ID: 10
func ReadConfig ¶
func (*Command) Descriptor
deprecated
func (*Command) GetAutoTlsCerts ¶
func (*Command) GetNoChroot ¶
func (*Command) GetWorkingDir ¶
func (*Command) ProtoMessage ¶
func (*Command) ProtoMessage()
func (*Command) ProtoReflect ¶
func (x *Command) ProtoReflect() protoreflect.Message
type Config ¶
type Config struct { Command []*Command `protobuf:"bytes,1,rep,name=command,proto3" json:"command,omitempty"` // contains filtered or unexported fields }
The schema of the config file
Write the file in proto text format which is documented here: https://developers.google.com/protocol-buffers/docs/text-format-spec
func (*Config) Descriptor
deprecated
func (*Config) GetCommand ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.