app

package
v0.89.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "doco-cd" // Name of the application

Variables

View Source
var (
	Version            = "dev" // Version of the application, to be set during build time
	ErrInvalidLogLevel = validator.TextErr{Err: errors.New("invalid log level, must be one of debug, info, warn, error")}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	LogLevel                    string                 `env:"LOG_LEVEL,notEmpty" envDefault:"info"`                          // LogLevel is the log level for the application
	HttpPort                    uint16                 `env:"HTTP_PORT,notEmpty" envDefault:"80" validate:"min=1,max=65535"` // HttpPort is the port the HTTP server will listen on
	HttpProxyString             string                 `env:"HTTP_PROXY"`                                                    // HttpProxyString is the HTTP proxy URL as a string
	HttpProxy                   transport.ProxyOptions // HttpProxy is the HTTP proxy configuration parsed from the HttpProxyString
	ApiSecret                   string                 `env:"API_SECRET"`                                                             // #nosec G117 -- ApiSecret is the secret token used to authenticate with the API
	ApiSecretFile               string                 `env:"API_SECRET_FILE,file"`                                                   // ApiSecretFile is the file containing the ApiSecret
	WebhookSecret               string                 `env:"WEBHOOK_SECRET"`                                                         // WebhookSecret is the secret token used to authenticate the webhook
	WebhookSecretFile           string                 `env:"WEBHOOK_SECRET_FILE,file"`                                               // WebhookSecretFile is the file containing the WebhookSecret
	GitAccessToken              string                 `env:"GIT_ACCESS_TOKEN"`                                                       // GitAccessToken is the access token used to authenticate with the Git server (e.g. GitHub) for private repositories
	GitAccessTokenFile          string                 `env:"GIT_ACCESS_TOKEN_FILE,file"`                                             // GitAccessTokenFile is the file containing the GitAccessToken
	GitHubAppID                 string                 `env:"GITHUB_APP_ID"`                                                          // GitHubAppID is the GitHub App identifier used to mint installation access tokens
	GitHubAppIDFile             string                 `env:"GITHUB_APP_ID_FILE,file"`                                                // GitHubAppIDFile is the file containing the GitHub App identifier
	GitHubAppPrivateKey         string                 `env:"GITHUB_APP_PRIVATE_KEY"`                                                 // GitHubAppPrivateKey is the PEM private key for the GitHub App
	GitHubAppPrivateKeyFile     string                 `env:"GITHUB_APP_PRIVATE_KEY_FILE,file"`                                       // GitHubAppPrivateKeyFile is the file containing the GitHub App private key
	GitHubAppInstallationID     int64                  `env:"GITHUB_APP_INSTALLATION_ID"`                                             // GitHubAppInstallationID optionally pins a specific installation id (0 means auto-detect via owner/repo)
	GitAuthDomainsYAML          string                 `env:"GIT_AUTH_DOMAINS"`                                                       // GitAuthDomainsYAML is the YAML configuration for domain-scoped Git credentials
	GitAuthDomainsFile          string                 `env:"GIT_AUTH_DOMAINS_FILE,file"`                                             // GitAuthDomainsFile is the file containing the YAML configuration for domain-scoped Git credentials
	GitAuthDomains              []git.ScopedAuthConfig `yaml:"-"`                                                                     // GitAuthDomains holds parsed domain-scoped Git credentials
	GitCloneDepth               int                    `env:"GIT_CLONE_DEPTH,notEmpty" envDefault:"0" validate:"min=0"`               // GitCloneDepth limits the number of commits to fetch. 0 means full clone (no depth limit). A positive value enables shallow clones.
	GitCloneSubmodules          bool                   `env:"GIT_CLONE_SUBMODULES,notEmpty" envDefault:"true"`                        // GitCloneSubmodules controls whether git submodules are cloned
	SSHPrivateKey               string                 `env:"SSH_PRIVATE_KEY"`                                                        // SSHPrivateKey is the SSH private key used for SSH authentication with Git repositories
	SSHPrivateKeyFile           string                 `env:"SSH_PRIVATE_KEY_FILE,file"`                                              // SSHPrivateKeyFile is the file containing the SSHPrivateKey
	SSHPrivateKeyPassphrase     string                 `env:"SSH_PRIVATE_KEY_PASSPHRASE"`                                             // SSHPrivateKeyPassphrase is the passphrase for the SSH private key, if applicable
	SSHPrivateKeyPassphraseFile string                 `env:"SSH_PRIVATE_KEY_PASSPHRASE_FILE,file"`                                   // SSHPrivateKeyPassphraseFile is the file containing the SSHPrivateKeyPassphrase
	AuthType                    string                 `env:"AUTH_TYPE,notEmpty" envDefault:"oauth2"`                                 // AuthType is the type of authentication to use when cloning repositories
	SkipTLSVerification         bool                   `env:"SKIP_TLS_VERIFICATION,notEmpty" envDefault:"false"`                      // SkipTLSVerification skips the TLS verification when cloning repositories.
	DockerQuietDeploy           bool                   `env:"DOCKER_QUIET_DEPLOY,notEmpty" envDefault:"true"`                         // DockerQuietDeploy suppresses the status output of dockerCli in deployments (e.g. pull, create, start)
	DockerSwarmFeatures         bool                   `env:"DOCKER_SWARM_FEATURES,notEmpty" envDefault:"true"`                       // DockerSwarmFeatures enables the usage Docker Swarm features in the application if it has detected that it is running in a Docker Swarm environment
	DeployConfigBaseDir         string                 `env:"DEPLOY_CONFIG_BASE_DIR" envDefault:"/"`                                  // DeployConfigBaseDir is the base directory (relative to the repository root) where deployment configuration files will be searched for.
	PassEnv                     bool                   `env:"PASS_ENV"`                                                               // PassEnv controls whether environment variables from the doco-cd container should be passed to the deployment environment for docker compose variable interpolation. Use with caution, as this may expose sensitive information to the deployment environment.
	PollConfigYAML              string                 `env:"POLL_CONFIG"`                                                            // PollConfigYAML is the unparsed string containing the PollConfig in YAML format
	PollConfigFile              string                 `env:"POLL_CONFIG_FILE,file"`                                                  // PollConfigFile is the file containing the PollConfig in YAML format
	PollConfig                  []poll.Config          `yaml:"-"`                                                                     // PollConfig is the YAML configuration for polling Git repositories for changes
	MaxPayloadSize              int64                  `env:"MAX_PAYLOAD_SIZE,notEmpty" envDefault:"1048576"`                         // MaxPayloadSize is the maximum size of the payload in bytes that the HTTP server will accept (default 1MB = 1048576 bytes)
	MetricsPort                 uint16                 `env:"METRICS_PORT,notEmpty" envDefault:"9120" validate:"min=1,max=65535"`     // MetricsPort is the port the prometheus metrics server will listen on
	AppriseApiURL               config.HttpUrl         `env:"APPRISE_API_URL" validate:"httpUrl"`                                     // AppriseApiURL is the URL of the Apprise notification service
	AppriseNotifyUrls           string                 `env:"APPRISE_NOTIFY_URLS"`                                                    // AppriseNotifyUrls is a comma-separated list of URLs to notify via the Apprise notification service
	AppriseNotifyUrlsFile       string                 `env:"APPRISE_NOTIFY_URLS_FILE,file"`                                          // AppriseNotifyUrlsFile is the file containing the AppriseNotifyUrls
	AppriseNotifyLevel          string                 `env:"APPRISE_NOTIFY_LEVEL,notEmpty" envDefault:"success"`                     // AppriseNotifyLevel is the level of notifications to send via the Apprise notification service
	SecretProvider              string                 `env:"SECRET_PROVIDER"`                                                        // SecretProvider is the secret provider/manager to use for retrieving secrets (e.g. bitwarden secrets manager)
	MaxDeploymentLoopCount      uint                   `env:"MAX_DEPLOYMENT_LOOP_COUNT,notEmpty" envDefault:"2" validate:"min=0"`     // Maximum allowed deployment loops before a forced deployment is triggered
	MaxConcurrentDeployments    uint                   `env:"MAX_CONCURRENT_DEPLOYMENTS,notEmpty" envDefault:"4" validate:"min=1"`    // Maximum number of concurrent deployments allowed
	OciVerifyMaxWorkers         uint                   `env:"OCI_VERIFY_MAX_WORKERS,notEmpty" envDefault:"1" validate:"min=1,max=10"` // Maximum number of workers used per OCI signature verification (clamped to 10)
	OciTrustPolicyYAML          string                 `env:"OCI_TRUST_POLICY"`                                                       // OciTrustPolicyYAML contains the app-level OCI signature trust policy as YAML
	OciTrustPolicyFile          string                 `env:"OCI_TRUST_POLICY_FILE,file"`                                             // OciTrustPolicyFile is the file containing OCI trust policy YAML
	OciTrustPolicy              config.OciTrustPolicy  `yaml:"-"`                                                                     // OciTrustPolicy is the parsed app-level OCI signature trust policy
}

Config is used to configure this application https://github.com/caarlos0/env?tab=readme-ov-file#env-tag-options

func GetConfig

func GetConfig() (*Config, error)

GetConfig returns the app Config.

Jump to

Keyboard shortcuts

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