Documentation
¶
Index ¶
- Constants
- func IsSecretKey(kind CredentialKind, key string) bool
- type AuthType
- type BackupHookSpec
- type BackupSpec
- type Certificate
- type ContainerBackupPath
- type Credential
- type CredentialKind
- type DatabaseBackupSpec
- type DatabaseConfig
- type Deployment
- type DeploymentRateLimit
- type DeploymentSecurityConfig
- type DeploymentStatus
- type DomainConfig
- type HealthCheckConfig
- type InfraService
- type Network
- type NetworkContainer
- type NetworkingConfig
- type ProtectedCommandRule
- type ProtectedModeConfig
- type ProtectedPath
- type QuickAction
- type RegistryCredential
- type RegistryCredentialWithType
- type RegistryType
- type RegistryTypeSource
- type SSLConfig
- type Service
- type ServiceMetadata
- func (m *ServiceMetadata) EffectivePrimaryService() string
- func (m *ServiceMetadata) GetDatabases() []DatabaseConfig
- func (m *ServiceMetadata) GetDomains() []DomainConfig
- func (m *ServiceMetadata) GetPrimaryDatabase() *DatabaseConfig
- func (m *ServiceMetadata) GetUniqueDomainNames() []string
- func (m *ServiceMetadata) HasMultipleDatabases() bool
- func (m *ServiceMetadata) HasMultipleDomains() bool
Constants ¶
View Source
const ( InfraTypeNginx = "nginx" InfraTypeCertbot = "certbot" InfraTypeDatabase = "database" InfraTypeRedis = "redis" InfraTypePowerDNS = "powerdns" InfraStatusRunning = "running" InfraStatusStopped = "stopped" InfraStatusExternal = "external" InfraStatusUnknown = "unknown" )
View Source
const CredentialMask = "********"
CredentialMask is returned in place of a secret value so callers can tell a secret is set without receiving it. A value equal to the mask on update is treated as "unchanged".
Variables ¶
This section is empty.
Functions ¶
func IsSecretKey ¶
func IsSecretKey(kind CredentialKind, key string) bool
IsSecretKey reports whether a Data key holds a secret for the given kind.
Types ¶
type BackupHookSpec ¶ added in v0.1.5
type BackupSpec ¶ added in v0.1.5
type BackupSpec struct {
ContainerPaths []ContainerBackupPath `yaml:"container_paths,omitempty" json:"container_paths,omitempty"`
Databases []DatabaseBackupSpec `yaml:"databases,omitempty" json:"databases,omitempty"`
PreHooks []BackupHookSpec `yaml:"pre_hooks,omitempty" json:"pre_hooks,omitempty"`
PostHooks []BackupHookSpec `yaml:"post_hooks,omitempty" json:"post_hooks,omitempty"`
ExcludePatterns []string `yaml:"exclude_patterns,omitempty" json:"exclude_patterns,omitempty"`
}
type Certificate ¶
type Certificate struct {
Domain string `json:"domain"`
Issuer string `json:"issuer"`
NotBefore time.Time `json:"not_before"`
NotAfter time.Time `json:"not_after"`
DaysLeft int `json:"days_left"`
Status string `json:"status"`
Path string `json:"path"`
AutoRenew bool `json:"auto_renew"`
DeploymentID string `json:"deployment_id,omitempty"`
}
type ContainerBackupPath ¶ added in v0.1.5
type Credential ¶
type Credential struct {
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Kind CredentialKind `json:"kind" yaml:"kind"`
Data map[string]string `json:"data" yaml:"data"`
CreatedAt time.Time `json:"created_at" yaml:"created_at"`
UpdatedAt time.Time `json:"updated_at" yaml:"updated_at"`
}
Credential is a generic, kind-tagged secret held by the credential manager, separate from the registry-specific RegistryCredential. Secret-bearing keys in Data are masked when marshaled to JSON but written verbatim to the 0600 on-disk store.
func (Credential) MarshalJSON ¶
func (c Credential) MarshalJSON() ([]byte, error)
type DatabaseBackupSpec ¶ added in v0.1.5
type DatabaseBackupSpec struct {
Service string `yaml:"service" json:"service"`
Type string `yaml:"type" json:"type"`
HostEnv string `yaml:"host_env,omitempty" json:"host_env,omitempty"`
PortEnv string `yaml:"port_env,omitempty" json:"port_env,omitempty"`
UserEnv string `yaml:"user_env,omitempty" json:"user_env,omitempty"`
PasswordEnv string `yaml:"password_env,omitempty" json:"password_env,omitempty"`
DatabaseEnv string `yaml:"database_env,omitempty" json:"database_env,omitempty"`
Host string `yaml:"host,omitempty" json:"host,omitempty"`
Port int `yaml:"port,omitempty" json:"port,omitempty"`
User string `yaml:"user,omitempty" json:"user,omitempty"`
Password string `yaml:"password,omitempty" json:"password,omitempty"`
Database string `yaml:"database,omitempty" json:"database,omitempty"`
}
type DatabaseConfig ¶ added in v0.1.5
type DatabaseConfig struct {
ID string `yaml:"id" json:"id"`
Alias string `yaml:"alias" json:"alias"`
Type string `yaml:"type" json:"type"`
Mode string `yaml:"mode" json:"mode"`
Service string `yaml:"service,omitempty" json:"service,omitempty"`
Host string `yaml:"host,omitempty" json:"host,omitempty"`
Port int `yaml:"port,omitempty" json:"port,omitempty"`
Container string `yaml:"container,omitempty" json:"container,omitempty"`
DatabaseName string `yaml:"database_name,omitempty" json:"database_name,omitempty"`
Username string `yaml:"username,omitempty" json:"username,omitempty"`
EnvPrefix string `yaml:"env_prefix,omitempty" json:"env_prefix,omitempty"`
}
type Deployment ¶
type DeploymentRateLimit ¶ added in v0.1.5
type DeploymentSecurityConfig ¶ added in v0.1.5
type DeploymentSecurityConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
BlockedIPs []string `yaml:"blocked_ips,omitempty" json:"blocked_ips,omitempty"`
ProtectedPaths []ProtectedPath `yaml:"protected_paths,omitempty" json:"protected_paths,omitempty"`
RateLimits []DeploymentRateLimit `yaml:"rate_limits,omitempty" json:"rate_limits,omitempty"`
}
type DeploymentStatus ¶
type DeploymentStatus string
const ( StatusRunning DeploymentStatus = "running" StatusStopped DeploymentStatus = "stopped" StatusError DeploymentStatus = "error" StatusUnknown DeploymentStatus = "unknown" )
type DomainConfig ¶ added in v0.1.5
type DomainConfig struct {
ID string `yaml:"id" json:"id"`
Service string `yaml:"service" json:"service"`
ContainerPort int `yaml:"container_port" json:"container_port"`
Domain string `yaml:"domain" json:"domain"`
PathPrefix string `yaml:"path_prefix,omitempty" json:"path_prefix,omitempty"`
StripPrefix bool `yaml:"strip_prefix,omitempty" json:"strip_prefix,omitempty"`
SSL SSLConfig `yaml:"ssl" json:"ssl"`
Aliases []string `yaml:"aliases,omitempty" json:"aliases,omitempty"`
// RouteOnlyAliases are extra hostnames routed to this deployment but excluded
// from certificate issuance and renewal, for a hostname whose TLS is
// terminated by an external proxy (e.g. Cloudflare) whose DNS does not point
// at FlatRun. They share the primary domain's certificate over the proxy's
// SNI; issuing a certificate for them would fail ACME validation.
RouteOnlyAliases []string `yaml:"route_only_aliases,omitempty" json:"route_only_aliases,omitempty"`
// ProxyTimeout is the proxy read/send timeout in seconds. Defaults to 60
// when unset; raise it for domains that proxy long-lived WebSocket
// connections so idle sockets are not closed mid-connection.
ProxyTimeout int `yaml:"proxy_timeout,omitempty" json:"proxy_timeout,omitempty"`
// StaticCache opts this domain into a long browser cache for static assets
// (css, js, images, fonts). It applies only to responses whose path has a
// static extension; dynamic responses keep the app's own cache headers.
StaticCache bool `yaml:"static_cache,omitempty" json:"static_cache,omitempty"`
}
type HealthCheckConfig ¶
type InfraService ¶ added in v0.1.5
type InfraService struct {
Name string `json:"name"`
Type string `json:"type"`
Status string `json:"status"`
Managed bool `json:"managed"`
External bool `json:"external"`
ContainerID string `json:"container_id,omitempty"`
Image string `json:"image,omitempty"`
Health string `json:"health,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
Config map[string]any `json:"config,omitempty"`
}
type Network ¶
type Network struct {
ID string `json:"id"`
Name string `json:"name"`
Driver string `json:"driver"`
Scope string `json:"scope"`
Subnet string `json:"subnet"`
Gateway string `json:"gateway"`
Containers []NetworkContainer `json:"containers"`
Labels map[string]string `json:"labels"`
Created string `json:"created"`
}
type NetworkContainer ¶
type NetworkingConfig ¶
type NetworkingConfig struct {
Expose bool `yaml:"expose" json:"expose"`
Domain string `yaml:"domain" json:"domain"`
Service string `yaml:"service,omitempty" json:"service,omitempty"`
ContainerPort int `yaml:"container_port" json:"container_port"`
Protocol string `yaml:"protocol" json:"protocol"`
ProxyType string `yaml:"proxy_type" json:"proxy_type"`
}
type ProtectedCommandRule ¶ added in v0.2.0
type ProtectedCommandRule struct {
ID string `yaml:"id,omitempty" json:"id,omitempty"`
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Match string `yaml:"match" json:"match"`
Pattern string `yaml:"pattern" json:"pattern"`
CaseSensitive bool `yaml:"case_sensitive,omitempty" json:"case_sensitive,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
}
type ProtectedModeConfig ¶ added in v0.2.0
type ProtectedModeConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
BlockedActions []string `yaml:"blocked_actions,omitempty" json:"blocked_actions,omitempty"`
BlockedCommandRules []ProtectedCommandRule `yaml:"blocked_command_rules,omitempty" json:"blocked_command_rules,omitempty"`
DisableTerminal bool `yaml:"disable_terminal,omitempty" json:"disable_terminal,omitempty"`
}
type ProtectedPath ¶ added in v0.1.5
type QuickAction ¶ added in v0.1.5
type QuickAction struct {
ID string `yaml:"id" json:"id"`
Name string `yaml:"name" json:"name"`
Command string `yaml:"command" json:"command"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Icon string `yaml:"icon,omitempty" json:"icon,omitempty"`
Service string `yaml:"service,omitempty" json:"service,omitempty"`
}
type RegistryCredential ¶ added in v0.1.5
type RegistryCredential struct {
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
RegistryTypeSlug string `json:"registry_type_slug" yaml:"registry_type_slug"`
RegistryURL string `json:"registry_url,omitempty" yaml:"registry_url,omitempty"`
Username string `json:"username" yaml:"username"`
Password string `json:"-" yaml:"password"`
Email string `json:"email,omitempty" yaml:"email,omitempty"`
IsDefault bool `json:"is_default" yaml:"is_default"`
CreatedAt time.Time `json:"created_at" yaml:"created_at"`
UpdatedAt time.Time `json:"updated_at" yaml:"updated_at"`
}
type RegistryCredentialWithType ¶ added in v0.1.5
type RegistryCredentialWithType struct {
RegistryCredential
RegistryType *RegistryType `json:"registry_type,omitempty"`
}
type RegistryType ¶ added in v0.1.5
type RegistryType struct {
Slug string `json:"slug" yaml:"slug"`
Name string `json:"name" yaml:"name"`
URLPatterns []string `json:"url_patterns" yaml:"url_patterns"`
AuthType AuthType `json:"auth_type" yaml:"auth_type"`
LoginURL string `json:"login_url,omitempty" yaml:"login_url,omitempty"`
DocsURL string `json:"docs_url,omitempty" yaml:"docs_url,omitempty"`
Icon string `json:"icon,omitempty" yaml:"icon,omitempty"`
Source RegistryTypeSource `json:"source" yaml:"source"`
IsOfficial bool `json:"is_official" yaml:"is_official"`
CreatedAt time.Time `json:"created_at" yaml:"created_at"`
UpdatedAt time.Time `json:"updated_at" yaml:"updated_at"`
}
func DefaultRegistryTypes ¶ added in v0.1.5
func DefaultRegistryTypes() []RegistryType
type RegistryTypeSource ¶ added in v0.1.5
type RegistryTypeSource string
const ( RegistrySourceBuiltin RegistryTypeSource = "builtin" RegistrySourceLocal RegistryTypeSource = "local" RegistrySourceMarketplace RegistryTypeSource = "marketplace" )
type Service ¶
type Service struct {
Name string `json:"name"`
ContainerID string `json:"container_id"`
Image string `json:"image"`
Status string `json:"status"`
Health string `json:"health,omitempty"`
Ports []string `json:"ports,omitempty"`
Networks []string `json:"networks,omitempty"`
IsPrimary bool `json:"is_primary"`
CreatedAt time.Time `json:"created_at"`
}
type ServiceMetadata ¶
type ServiceMetadata struct {
Name string `yaml:"name" json:"name"`
Type string `yaml:"type" json:"type"`
// PrimaryService is the user-pinned primary service. When set it overrides
// auto-detection for the default-domain upstream and is preserved across
// compose updates and re-discovery.
PrimaryService string `yaml:"primary_service,omitempty" json:"primary_service,omitempty"`
Networking NetworkingConfig `yaml:"networking" json:"networking"`
SSL SSLConfig `yaml:"ssl" json:"ssl"`
HealthCheck HealthCheckConfig `yaml:"healthcheck" json:"healthcheck"`
QuickActions []QuickAction `yaml:"quick_actions,omitempty" json:"quick_actions,omitempty"`
Security *DeploymentSecurityConfig `yaml:"security,omitempty" json:"security,omitempty"`
Backup *BackupSpec `yaml:"backup,omitempty" json:"backup,omitempty"`
ProtectedMode *ProtectedModeConfig `yaml:"protected_mode,omitempty" json:"protected_mode,omitempty"`
RequirePlan bool `yaml:"require_plan,omitempty" json:"require_plan,omitempty"`
CredentialID string `yaml:"credential_id,omitempty" json:"credential_id,omitempty"`
ServiceCredentials map[string]string `yaml:"service_credentials,omitempty" json:"service_credentials,omitempty"`
Domains []DomainConfig `yaml:"domains,omitempty" json:"domains,omitempty"`
Databases []DatabaseConfig `yaml:"databases,omitempty" json:"databases,omitempty"`
}
func (*ServiceMetadata) EffectivePrimaryService ¶
func (m *ServiceMetadata) EffectivePrimaryService() string
EffectivePrimaryService returns the service treated as the deployment's primary: the user-pinned PrimaryService when set, otherwise the auto-detected routing service.
func (*ServiceMetadata) GetDatabases ¶ added in v0.1.5
func (m *ServiceMetadata) GetDatabases() []DatabaseConfig
func (*ServiceMetadata) GetDomains ¶ added in v0.1.5
func (m *ServiceMetadata) GetDomains() []DomainConfig
func (*ServiceMetadata) GetPrimaryDatabase ¶ added in v0.1.5
func (m *ServiceMetadata) GetPrimaryDatabase() *DatabaseConfig
func (*ServiceMetadata) GetUniqueDomainNames ¶ added in v0.1.5
func (m *ServiceMetadata) GetUniqueDomainNames() []string
func (*ServiceMetadata) HasMultipleDatabases ¶ added in v0.1.5
func (m *ServiceMetadata) HasMultipleDatabases() bool
func (*ServiceMetadata) HasMultipleDomains ¶ added in v0.1.5
func (m *ServiceMetadata) HasMultipleDomains() bool
Click to show internal directories.
Click to hide internal directories.