server

package
v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindAllEnv

func BindAllEnv(v *viper.Viper)

Types

type AuthConfig

type AuthConfig struct {
	RequireEmailVerification bool
	BasicAuthEnabled         bool
	RestrictedEmailDomains   []string
}

func (*AuthConfig) IsEmailAllowed

func (a *AuthConfig) IsEmailAllowed(email string) bool

type Config

type Config struct {
	shared.Config

	DB database.Config

	AuthConfig AuthConfig

	ServerRuntimeConfig ServerRuntimeConfig

	UserSessionStore *cookie.UserSessionStore

	TokenOpts *token.TokenOpts

	UserNotifier notifier.UserNotifier

	VCSProviders map[vcs.VCSRepositoryKind]vcs.VCSProvider

	DefaultFileStore filestorage.FileStorageManager

	DefaultLogStore logstorage.LogStorageBackend

	ModuleRunQueueManager queuemanager.ModuleRunQueueManager
}

func (*Config) ToAPIServerMetadataType

func (c *Config) ToAPIServerMetadataType() *types.APIServerMetadata

type ConfigFile

type ConfigFile struct {
	Runtime ConfigFileRuntime `mapstructure:"runtime" json:"runtime,omitempty"`

	Auth shared.ConfigFileAuth `mapstructure:"auth" json:"auth,omitempty"`

	Notification ConfigFileNotification `mapstructure:"notification" json:"notification,omitempty"`

	VCS ConfigFileVCS `mapstructure:"vcs" json:"vcs,omitempty"`

	FileStore shared.FileStorageConfigFile `mapstructure:"fileStore" json:"fileStore,omitempty"`

	LogStore shared.LogStoreConfigFile `mapstructure:"logStore" json:"logStore,omitempty"`
}

type ConfigFileGithub added in v0.11.0

type ConfigFileGithub struct {
	Enabled                bool   `mapstructure:"enabled" json:"enabled"`
	GithubAppClientID      string `mapstructure:"appClientID" json:"appClientID,omitempty"`
	GithubAppClientSecret  string `mapstructure:"appClientSecret" json:"appClientSecret,omitempty"`
	GithubAppName          string `mapstructure:"appName" json:"appName,omitempty"`
	GithubAppWebhookSecret string `mapstructure:"appWebhookSecret" json:"appWebhookSecret,omitempty"`
	GithubAppID            string `mapstructure:"appID" json:"appID,omitempty"`
	GithubAppSecretPath    string `mapstructure:"appSecretPath" json:"appSecretPath,omitempty"`
}

type ConfigFileNotification

type ConfigFileNotification struct {
	Sendgrid ConfigFileNotificationSendgrid `mapstructure:"sendgrid" json:"sendgrid,omitempty"`
}

type ConfigFileNotificationSendgrid

type ConfigFileNotificationSendgrid struct {
	SendgridAPIKey                string `mapstructure:"apiKey" json:"apiKey,omitempty"`
	SendgridPWResetTemplateID     string `mapstructure:"pwResetTemplateID" json:"pwResetTemplateID,omitempty"`
	SendgridVerifyEmailTemplateID string `mapstructure:"verifyEmailTemplateID" json:"verifyEmailTemplateID,omitempty"`
	SendgridInviteLinkTemplateID  string `mapstructure:"inviteLinkTemplateID" json:"inviteLinkTemplateID,omitempty"`
	SendgridSenderEmail           string `mapstructure:"senderEmail" json:"senderEmail,omitempty" validator:"email"`
}

type ConfigFileRuntime

type ConfigFileRuntime struct {
	// Port is the port that the core server listens on
	Port int `mapstructure:"port" json:"port,omitempty" default:"8080"`

	// ServerURL is the full server URL of the instance, INCLUDING protocol.
	// We include the protocol as several auth implementations depend on it, like
	// JWT token and cookies.
	ServerURL string `mapstructure:"url" validator:"url" json:"url,omitempty" default:"http://localhost:8080"`

	// BroadcastGRPCAddress is the endpoint for the grpc server to be used by clients
	BroadcastGRPCAddress string `mapstructure:"broadcastGRPCAddress" json:"broadcastGRPCAddress,omitempty" validator:"url" default:"http://localhost:8080"`

	RunBackgroundWorker  bool   `mapstructure:"runBackgroundWorker" json:"runBackgroundWorker,omitempty" default:"false"`
	RunRunnerWorker      bool   `mapstructure:"runRunnerWorker" json:"runRunnerWorker,omitempty" default:"false"`
	RunTemporalServer    bool   `mapstructure:"runTemporalServer" json:"runTemporalServer,omitempty" default:"false"`
	RunStaticFileServer  bool   `mapstructure:"runStaticFileServer" json:"runStaticFileServer,omitempty" default:"false"`
	StaticFileServerPath string `mapstructure:"staticFilePath" json:"staticFilePath,omitempty"`

	PermittedModuleDeploymentMechanisms []string `` /* 144-byte string literal not displayed */
}

General server runtime options

type ConfigFileVCS added in v0.11.0

type ConfigFileVCS struct {
	Github ConfigFileGithub `mapstructure:"github" json:"github,omitempty"`
}

type ServerRuntimeConfig

type ServerRuntimeConfig struct {
	Version string

	ServerURL            string
	Port                 int
	CookieName           string
	BroadcastGRPCAddress string
	RunBackgroundWorker  bool
	RunRunnerWorker      bool
	RunTemporalServer    bool
	RunStaticFileServer  bool
	StaticFileServerPath string

	PermittedModuleDeploymentMechanisms []string
}

Jump to

Keyboard shortcuts

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