config

package
v0.0.0-...-7de36fb Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DefaultIP is the default IP address to bind to.
	DefaultIP = "0.0.0.0"
	// PublicAPIport is the port where we can access the public API.
	PublicAPIport = "9000"
	// GradeAPIport is the port where a client can request grading of the exercises.
	GradeAPIport = 9027
	// DefaultTimeout for the API.
	DefaultTimeout = 2 * time.Minute
	// AuthenticatedUserID key for a hash map, where the sha256 fingerprint of the public key is saved.
	AuthenticatedUserID = "sha256Fingerprint"
	// UserContainerImage is the image used for the challenge containers.
	UserContainerImage = "ghcr.io/benschlueter/delegatio/archimage:0.1"
	// SSHContainerImage is the image used for the ssh containers.
	SSHContainerImage = "ghcr.io/benschlueter/delegatio/ssh:0.1"
	// GradingContainerImage is the image used for the grading containers.
	GradingContainerImage = "ghcr.io/benschlueter/delegatio/grader:0.1"
	// UserNamespace is the namespace where the user containers are running.
	UserNamespace = "users"
	// NodeNameEnvVariable is the environment variable name of the node a user-pod is running on.
	NodeNameEnvVariable = "NODE_NAME"
	// AgentPort is the port where the agent is listening.
	AgentPort = 9000
	// SSHServiceAccountName is the name of the Kubernetes ssh service account with cluster access.
	SSHServiceAccountName = "development-ssh"
	// SSHPort is the port where the ssh server is listening.
	SSHPort = 2200
	// SSHNamespaceName is the namespace where the ssh containers are running.
	SSHNamespaceName = "ssh"
	// GraderNamespaceName is the namespace where the grader containers are running.
	GraderNamespaceName = "grader"
)

Variables

View Source
var (
	ClusterConfiguration = ClusterConfig{
		NumberOfWorkers: 2,
		NumberOfMasters: 1,
	}
	// CleanUpTimeout is the timeout after which the save-state function is canceled when ctrl+c is pressed in the cli.
	CleanUpTimeout = 10 * time.Second
	// CiliumPath is the path to the cilium helm chart.
	CiliumPath = "https://github.com/cilium/charts/raw/master/cilium-1.12.5.tgz"
	// Cilium256Hash is the sha256 hash of the cilium helm chart.
	Cilium256Hash = "a9211be3d0d43b91aaaece1191a69c1c676a6226194bec7d806111086e620ab8"
	// TetratePath is the path to the tetrate helm chart.
	TetratePath = "https://github.com/cilium/tetragon/releases/download/v0.8.3/tetra-linux-amd64.tar.gz"
	// Tetragon256Hash is the sha256 hash of the tetrate helm chart.
	Tetragon256Hash = "fa0e23839732cf2a3c4a1d27573431a99dd2599075bf249d3564990d906b9140"
)

ClusterConfiguration is the configuration for the cluster. Infrastructure and Kubernetes configdata is stored here.

View Source
var Commit = func() string {
	if info, ok := debug.ReadBuildInfo(); ok {
		for _, setting := range info.Settings {
			if setting.Key == "vcs.revision" {
				return setting.Value
			}
		}
	}
	return ""
}()

Commit is the git Commit hash of the build.

Functions

This section is empty.

Types

type ChallengeInformation

type ChallengeInformation struct{}

ChallengeInformation holds the data for a challenge.

type ClusterConfig

type ClusterConfig struct {
	NumberOfWorkers int
	NumberOfMasters int
}

ClusterConfig is the configuration for the cluster.

type EtcdCredentials

type EtcdCredentials struct {
	PeerCertData []byte // self generated
	KeyData      []byte // self generated
	CaCertData   []byte // "/etc/kubernetes/pki/etcd/ca.crt"
}

EtcdCredentials contains the credentials for etcd.

type KubeExecConfig

type KubeExecConfig struct {
	Namespace      string
	UserIdentifier string
	Command        string
	Communication  ssh.Channel
	WinQueue       remotecommand.TerminalSizeQueue
	Tty            bool
}

KubeExecConfig holds the configuration parsed to the execCommand function.

type KubeForwardConfig

type KubeForwardConfig struct {
	Namespace     string
	PodName       string
	Port          string
	Communication ssh.Channel
}

KubeForwardConfig holds the configuration parsed to the forwardCommand function.

type KubeRessourceIdentifier

type KubeRessourceIdentifier struct {
	Namespace      string
	UserIdentifier string
	Challenge      string
	NodeName       string
	StorageClass   string
}

KubeRessourceIdentifier holds the information to identify a kubernetes ressource.

type NodeInformation

type NodeInformation struct {
	Masters map[string]string
	Workers map[string]string
}

NodeInformation contains the information about the nodes.

type UserConfiguration

type UserConfiguration struct {
	PubKeyToUser map[string]UserInformation      `yaml:"pubkeysToUser" json:"pubkeysToUser"`
	Challenges   map[string]ChallengeInformation `yaml:"challenges" json:"challenges"`
}

UserConfiguration is the configuration for the user.

func GetExampleConfig

func GetExampleConfig() *UserConfiguration

GetExampleConfig writes an example config to config.json.

type UserInformation

type UserInformation struct {
	RealName string
}

UserInformation holds the data for a user.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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