provision

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package provision turns a blueprint plus a service's choices into the ServiceSpec the agent runs, following Pterodactyl's conventions so official eggs and yolks images work unchanged (environment names, STARTUP, /home/container, /mnt/server).

Index

Constants

View Source
const DefaultPIDs = 512

DefaultPIDs limits processes per container (Wings uses 512 by default).

Variables

This section is empty.

Functions

func ParsePorts

func ParsePorts(s string) ([]int, error)

ParsePorts parses "25565", "25565,25570" and ranges like "27015-27020" (at most 1000 ports).

func Spec

func Spec(e *egg.Egg, svc store.Service) agentlink.ServiceSpec

Spec builds the agent's ServiceSpec for a stored service.

Types

type Choices

type Choices struct {
	Image     string            // must be one of the egg's images; "" = first
	Startup   string            // name of an egg startup command; "" = first
	Variables map[string]string // env -> value; missing ones use the egg default
}

Choices are what the admin picks when creating a service.

type FieldError

type FieldError struct {
	Field   string `json:"field"`
	Message string `json:"message"`
}

FieldError is a validation problem with one input.

func Resolve

func Resolve(e *egg.Egg, c Choices) (image, startup string, vars map[string]string, errs []FieldError)

Resolve validates choices against the egg and returns the image, startup command and the complete variable map to store. Admins may set every variable; customer-facing restrictions (user_editable) apply once customers create services themselves.

Jump to

Keyboard shortcuts

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