Documentation
¶
Overview ¶
Package runtimesettings holds the registry of operator-tunable settings and resolves each one as saved value, then env var, then registry default.
Index ¶
- Constants
- Variables
- func BindRuntimeLimits(s *Service)
- func CheckAppImageKeep(n int) error
- func CheckAppImageKeepCount(n int) error
- func ClampBuildCacheReclaimTimeout(d time.Duration) time.Duration
- func ClampLimit(key string, n int) int
- func ClampMeshApplyRetries(n int) int
- func ClampMeshApplyRetryDelay(d time.Duration) time.Duration
- func ClampMeshApplyTimeout(d time.Duration) time.Duration
- func ClampMeshWakeDebounce(d time.Duration) time.Duration
- func DurationEnvToDays(allowZero bool) func(string) (string, error)
- func MinDaysCheck(floor int) func(string) error
- func MinDurationCheck(floor time.Duration) func(string) error
- func ParseAppImageKeepOverrides(raw string) (map[string]int, error)
- func ParseDuration(s string) (time.Duration, error)
- func ParseJSON(d Definition, raw json.RawMessage) (string, error)
- func PositiveDaysEnv(raw string) (string, error)
- func Register(d Definition)
- type AccessSearchLimits
- type Apply
- type Category
- type CutoverVerify
- type DBViewerLimits
- type Definition
- type Kind
- type LogRuleLimits
- type PostmortemLimits
- type Risk
- type Service
- func (s *Service) AbuseLimits(ctx context.Context) abuse.Limits
- func (s *Service) AccessLogRetention(ctx context.Context) time.Duration
- func (s *Service) AccessSearchLimits(ctx context.Context) AccessSearchLimits
- func (s *Service) AckReviewed(ctx context.Context, actor string) error
- func (s *Service) All(ctx context.Context) ([]Setting, error)
- func (s *Service) AnyPendingRestart(ctx context.Context) (bool, error)
- func (s *Service) AuthGateTimeout(ctx context.Context) time.Duration
- func (s *Service) Bool(ctx context.Context, key string) bool
- func (s *Service) CaptureBoot(ctx context.Context) error
- func (s *Service) ContainerLogRotation(ctx context.Context) (sizeMB, files int)
- func (s *Service) CutoverVerify(ctx context.Context) CutoverVerify
- func (s *Service) DatabaseParamsMaxConnections(ctx context.Context) int
- func (s *Service) DatabaseParamsMaxMemoryMB(ctx context.Context) int
- func (s *Service) DatabaseViewerLimits(ctx context.Context) DBViewerLimits
- func (s *Service) Duration(ctx context.Context, key string) time.Duration
- func (s *Service) FirewallConfirmWindow(ctx context.Context) time.Duration
- func (s *Service) Get(ctx context.Context, key string) (Setting, error)
- func (s *Service) GitSubmodulesTimeout(ctx context.Context) time.Duration
- func (s *Service) Int(ctx context.Context, key string) int
- func (s *Service) Limit(ctx context.Context, key string) int
- func (s *Service) List(ctx context.Context, key string) []string
- func (s *Service) LogRuleLimits(ctx context.Context) LogRuleLimits
- func (s *Service) Onboarding(ctx context.Context) ([]Setting, error)
- func (s *Service) PostmortemLimits(ctx context.Context) PostmortemLimits
- func (s *Service) ProxyCertWait(ctx context.Context) time.Duration
- func (s *Service) Reset(ctx context.Context, key string) (Setting, error)
- func (s *Service) Reviewed(ctx context.Context) (bool, error)
- func (s *Service) Set(ctx context.Context, key string, raw json.RawMessage, actor string) (Setting, error)
- func (s *Service) Source(ctx context.Context, key string) string
- func (s *Service) String(ctx context.Context, key string) string
- func (s *Service) StringChecked(ctx context.Context, key string) (string, error)
- func (s *Service) SystemTokenRotationLead(ctx context.Context) time.Duration
- func (s *Service) TemplatesImportTimeout(ctx context.Context) time.Duration
- func (s *Service) TrustedProxyPreset(ctx context.Context) string
- func (s *Service) ValidateForWrite(ctx context.Context, key string, raw json.RawMessage, opts WriteOptions) (string, error)
- func (s *Service) VisitorHistoryRetention(ctx context.Context) time.Duration
- func (s *Service) VisitorSaltRotation(ctx context.Context) time.Duration
- func (s *Service) WeakensOnReset(ctx context.Context, key string) bool
- func (s *Service) WeakensTo(ctx context.Context, key string, raw json.RawMessage) bool
- type Setting
- type SizePreset
- type Store
- type ValidationError
- type WriteOptions
Constants ¶
const ( SourceSaved = "saved" SourceEnv = "env" SourceDefault = "default" )
Source says where an effective value came from.
const ( KeyWebhookReplayProtection = "security.webhook_replay_protection" KeyWebhookReplayWindow = "security.webhook_replay_window" KeyAuditSensitiveReads = "security.audit_sensitive_reads" KeyBindBlockCredentialDirs = "security.bind_block_credential_dirs" KeyBindAllowedRoots = "security.bind_allowed_roots" KeyTrustLoopbackForwarded = "security.trust_loopback_forwarded_headers" KeyIngressDNS01AllHosts = "ingress.dns01_all_hosts" KeyIngressCARetryBase = "ingress.ca_switch_retry_base" KeyIngressCARetryMax = "ingress.ca_switch_retry_max" KeyMetricsScrapeEnabled = "observability.metrics_scrape_enabled" KeyHeartbeatJobAttempts = "heartbeat.job_max_attempts" KeyHeartbeatJobBackoffBase = "heartbeat.job_backoff_base" KeyHeartbeatJobBackoffMax = "heartbeat.job_backoff_max" KeyHeartbeatJobQueue = "heartbeat.job_queue" KeyContainersRestartPolicy = "containers.restart_policy" KeyGameStatusTimeout = "games.status_timeout" KeyGameStatusCache = "games.status_cache" KeyRevokedTokenDays = "retention.revoked_token_days" //nolint:gosec // setting key, not a credential KeyExpiredTokenDays = "retention.expired_token_days" //nolint:gosec // setting key, not a credential KeyDesktopSessionTTL = "desktop.session_ttl" KeyDomainsDNSWaitBudget = "domains.dns_wait_budget" KeyDatabasesPoolerDefault = "databases.pooler_default" )
Registered setting keys.
const ( KeyAbuseMaxRPS = "abuse.max_rps" KeyAbuseMaxBurst = "abuse.max_burst" KeyAbuseMaxDenyEntries = "abuse.max_deny_entries" KeyAbuseMaxAgentEntries = "abuse.max_agent_entries" KeyAbuseDefaultRPS = "abuse.default_rps" KeyAbuseDefaultBurst = "abuse.default_burst" KeyAbuseMaxTrackedClients = "abuse.max_tracked_clients" KeyAbuseShards = "abuse.shards" KeyAbuseIdleEvict = "abuse.idle_evict" KeyAbuseMaxRetryAfter = "abuse.max_retry_after" KeyAbuseDryRunDefault = "abuse.dryrun_default_window" KeyAbuseDryRunMax = "abuse.dryrun_max_window" KeyAbuseDryRunTop = "abuse.dryrun_top_clients" KeyAbuseSuggestBurstSecs = "abuse.suggest_burst_seconds" )
Registered keys for the per-app abuse defense limits.
const ( KeyAccessSearchMaxWindow = "telemetry.access_search_max_window" KeyAccessSearchMaxRows = "telemetry.access_search_max_rows" KeyAccessSearchMaxTerm = "telemetry.access_search_max_term" KeyAccessSearchMaxScan = "telemetry.access_search_max_scan" KeyAccessSearchMaxConc = "telemetry.access_search_max_concurrent" )
Access log search bounds. The rows live in the edge's in-memory ring, so the scan cap is what keeps one tenant's search from holding CPU on a busy edge.
const ( KeyDomainsWWWMode = "domains.www_mode" KeyDomainsCanonical = "domains.canonical" )
Keys for how a bare domain and its www twin are set up.
const ( KeyAppsMetricsMax = "api.apps_metrics_max" KeyLogExportMaxLines = "logs.export_max_lines" KeyStackHistoryLimit = "stacks.history_limit" KeyMaxTagsPerApp = "tags.max_per_app" KeyMaxTagsPerResource = "tags.max_per_resource" KeyFixitMaxPerHour = "fixit.max_per_hour" KeyDeployApprovalClaimTimeoutSec = "deploy.approval_claim_timeout_seconds" KeyApproveDigestCheckTimeoutSec = "deploy.approve_digest_check_timeout_seconds" KeyGitAccessCacheTTL = "git.access_cache_ttl_seconds" KeyGitAccessNamesMax = "git.access_names_max" )
Registered keys for API limits that used to be env-only.
const ( KeyAppBundleMaxBytes = "apps.bundle_import_max_bytes" KeyAppBundleMaxEntries = "apps.bundle_import_max_entries" KeyAppBundleMaxEntryBytes = "apps.bundle_import_max_entry_bytes" )
App bundle import keys. A bundle is an uploaded file from anywhere, so every cap has a floor and a ceiling and a stray seed can never lift it.
const ( KeyAppMetricsScrapeInterval = "app_metrics.scrape_interval" KeyAppMetricsScrapeTimeout = "app_metrics.scrape_timeout" KeyAppMetricsMaxBodyBytes = "app_metrics.max_body_bytes" KeyAppMetricsMaxSeries = "app_metrics.max_series" KeyAppMetricsMaxLabels = "app_metrics.max_labels" KeyAppMetricsRetentionHours = "app_metrics.retention_hours" KeyAppMetricsQueryMaxPoints = "app_metrics.query_max_points" KeyAppMetricsMaxLabelBytes = "app_metrics.max_label_bytes" KeyAppMetricsMaxStoredRows = "app_metrics.max_stored_rows" KeyAppMetricsScrapeWorkers = "app_metrics.scrape_workers" )
App metrics scrape setting keys.
const ( KeyAppsRunMaxConcurrentPerApp = "apps_run.max_concurrent_per_app" KeyAppsRunMaxTimeoutSeconds = "apps_run.max_timeout_seconds" KeyAppsRunMemoryLimitMB = "apps_run.memory_limit_mb" KeyAppsRunCPULimitMillis = "apps_run.cpu_limit_millis" )
Limits for one-off command runs (apps run, the dashboard Run card, POST /api/v1/jobs/runs).
const ( KeyAppSleepMaxWaiters = "appsleep.max_waiters" KeyAppSleepWakeWaitSeconds = "appsleep.wake_wait_seconds" //nolint:gosec // setting key, not a credential )
Limits for requests held while a sleeping app wakes.
const ( KeyAuditAnchorWebhookURL = "audit.anchor_webhook_url" KeyAuditAnchorWebhookSecret = "audit.anchor_webhook_secret" //nolint:gosec // setting key, not a credential )
Audit anchor webhook export keys. The URL empty means the export is off.
const ( KeyAutoscaleGaugeTimeout = "autoscale.gauge_timeout" KeyAutoscaleGaugeMaxBytes = "autoscale.gauge_max_bytes" )
Gauge scrape limits for custom autoscale signals. The gauge path stays env-only until a store migration lands.
const ( KeyBackupHookTimeoutSeconds = "backup.hook_timeout_seconds" KeyBackupHookMaxOutputBytes = "backup.hook_max_output_bytes" )
Volume backup hook budgets. Hooks run inside the app's own container, so both are clamped to keep a hung or chatty hook from holding a backup open.
const ( KeyBootRechecks = "boot.rechecks" KeyBootEventRecheck = "boot.event_recheck" // KeyBootDeferredStages starts non critical boot stages after the listener is up. KeyBootDeferredStages = "boot.deferred_stages" )
Boot recheck keys.
const ( KeyBootstrapScriptMaxBytes = "bootstrap_scripts.max_bytes" KeyBootstrapScriptMaxCount = "bootstrap_scripts.max_count" DefaultBootstrapScriptMaxBytes = 64 << 10 DefaultBootstrapScriptMaxCount = 50 )
Registered keys for the saved bootstrap script limits.
const ( // KeyBuildCacheAppQuotaGB caps one app's cache mounts; 0 turns the quota off. KeyBuildCacheAppQuotaGB = "build.cache_app_quota_gb" // KeyBuildCacheReclaimMaxRecords bounds how many records one reclaim run removes. KeyBuildCacheReclaimMaxRecords = "build.cache_reclaim_max_records" // KeyBuildCacheReclaimTimeout bounds one reclaim so a wedged builder cannot hold it. KeyBuildCacheReclaimTimeout = "build.cache_reclaim_timeout" )
const ( // KeyBuildCacheBudget turns the post build cache budget prune on, off or auto. KeyBuildCacheBudget = "build.cache_budget" // KeyBuildCacheBudgetMaxMB is the most builder cache kept after a build; 0 sizes it from the disk. KeyBuildCacheBudgetMaxMB = "build.cache_budget_max_mb" // KeyBuildCacheBudgetReservedMB is the cache a prune never goes below; 0 picks a default. KeyBuildCacheBudgetReservedMB = "build.cache_budget_reserved_mb" )
const ( BuildCacheBudgetAuto = "auto" BuildCacheBudgetOn = "on" BuildCacheBudgetOff = "off" )
Cache budget modes.
const ( KeyBuildHookTriggersPerMinute = "deploy.build_hook_triggers_per_minute" KeyBuildHookMaxCIDRs = "deploy.build_hook_max_cidrs" )
Incoming build hook limits. The env vars only seed the defaults; a saved value applies to the next hook call without a restart.
const ( KeyChangesStreamMaxPerCaller = "events.changes_max_streams_per_caller" KeyChangesStreamBuffer = "events.changes_buffer" KeyChangesStreamHeartbeat = "events.changes_heartbeat" )
Change stream caps, so one caller cannot pin unbounded connections or memory.
const ( KeyCleanupFailingWindow = "cleanup.failing_window" KeyCleanupFailingFloor = "cleanup.failing_floor" )
Cleanup failure alert setting keys.
const ( KeyCloudMaxDestroys = "cloud.max_destroys" KeyCloudAllowProtectedDelete = "cloud.allow_protected_delete" KeyCloudRequireFullEstimate = "cloud.require_full_estimate" KeyCloudEngineTimeoutSeconds = "cloud.engine_timeout_seconds" KeyCloudDefaultMonthlyCostLim = "cloud.default_monthly_cost_limit" KeyCloudFetchMaxMB = "cloud.fetch_max_mb" KeyCloudFetchMinFreeMB = "cloud.fetch_min_free_mb" KeyCloudFetchTimeoutSeconds = "cloud.fetch_timeout_seconds" KeyCloudAllowChecksumOnly = "cloud.allow_checksum_only" KeyCloudStateMaxKB = "cloud.state_max_kb" KeyCloudEngineImage = "cloud.engine_image" KeyCloudEngineUser = "cloud.engine_user" KeyCloudEngineNetwork = "cloud.engine_network" KeyCloudEngineDenyAddrs = "cloud.engine_deny_addresses" KeyCloudEngineMemoryMB = "cloud.engine_memory_mb" KeyCloudEngineCPUs = "cloud.engine_cpus" KeyCloudEnginePids = "cloud.engine_pids" KeyCloudEngineRunMinFreeMB = "cloud.engine_run_min_free_mb" KeyCloudEngineTmpMB = "cloud.engine_tmp_mb" KeyCloudPlanMaxAgeMinutes = "cloud.plan_max_age_minutes" KeyCloudMaxConcurrentPlans = "cloud.max_concurrent_plans" KeyCloudPlanJobRetentionHours = "cloud.plan_job_retention_hours" )
Registered keys for the cloud provisioning engine guards. Env names are seeds only.
const ( KeyIngressTrustedProxyPreset = "ingress.trusted_proxy_preset" KeyCloudflareIPsRefresh = "ingress.cloudflare_ips_refresh" KeyCloudflareIPsMinRanges = "ingress.cloudflare_ips_min_ranges" KeyCloudflareIPsTimeout = "ingress.cloudflare_ips_timeout" KeyCloudflareIPsMaxBytes = "ingress.cloudflare_ips_max_bytes" // TrustedProxyPresetNone and TrustedProxyPresetCloudflare are the preset values. TrustedProxyPresetNone = "none" TrustedProxyPresetCloudflare = "cloudflare" )
Cloudflare client IP preset keys and the refresh bounds around its range list.
const ( KeyComposeRepoFileMaxBytes = "compose.repo_file_max_bytes" KeyComposeRepoDeployTimeout = "compose.repo_deploy_timeout" )
Keys for compose apps deployed from a git repository.
const ( KeyContainersLogMaxSizeMB = "containers.log_max_size_mb" KeyContainersLogMaxFiles = "containers.log_max_files" )
Registered keys for managed container log rotation.
const ( KeyCutoverVerifyCertWarnDays = "cutover.verify_cert_warn_days" KeyCutoverVerifyCertFailDays = "cutover.verify_cert_fail_days" KeyCutoverVerifySlowTTFB = "cutover.verify_slow_ttfb" KeyCutoverVerifyHSTSMinAge = "cutover.verify_hsts_min_age" KeyCutoverVerifyTimeout = "cutover.verify_timeout" KeyCutoverVerifyMinInterval = "cutover.verify_min_interval" )
Registered keys for the domain cutover verifier thresholds.
const ( KeyDatabaseBulkConcurrency = "databases.bulk_concurrency" KeyDatabaseBulkMaxItems = "databases.bulk_max_items" )
Registered keys for POST /api/v1/databases/bulk.
const ( KeyDBSpaceRows = "db.space_report_rows" KeyDBCompactMinFree = "db.compact_min_free_percent" KeySystemProcessesRows = "system.processes_max_rows" )
Registered keys for the database space report and host process table.
const ( KeyDBCacheSizeMB = "store.cache_size_mb" KeyDBMmapSizeMB = "store.mmap_size_mb" KeyDBTempStore = "store.temp_store" KeyDBSynchronous = "store.synchronous" )
Keys for SQLite connection tuning of the control plane database.
const ( DBTuningDefault = "default" DBTempFile = "file" DBTempMemory = "memory" DBSyncNormal = "normal" DBSyncFull = "full" )
Tuning value names; "default" leaves the SQLite built-in untouched.
const ( KeyDBViewerTimeout = "database_viewer.query_timeout" KeyDBViewerMaxRows = "database_viewer.max_rows" KeyDBViewerMaxBytes = "database_viewer.max_bytes" KeyDBViewerMaxCell = "database_viewer.max_cell_bytes" KeyDBViewerSchemaRows = "database_viewer.schema_max_rows" KeyDBViewerMaxSQL = "database_viewer.max_sql_bytes" KeyLogRuleEvalInterval = "log_rules.eval_interval" KeyLogRuleMaxWindow = "log_rules.max_window" KeyLogRuleMaxRows = "log_rules.max_rows" KeyLogRuleSamples = "log_rules.samples" )
Registered keys for the database console and log rule limits. Env names are the long-standing ones and only seed defaults.
const ( KeyIngressUnmatchedMode = "ingress.unmatched_mode" KeyIngressUnmatchedRedirectURL = "ingress.unmatched_redirect_url" // UnmatchedDiagnostic, UnmatchedNotFound and UnmatchedRedirect are the accepted ingress.unmatched_mode values. UnmatchedDiagnostic = "diagnostic" UnmatchedNotFound = "not_found" UnmatchedRedirect = "redirect" )
Registered keys for what the ingress answers when no route claims the requested host.
const ( KeyDeployDrainTimeout = "deploy.drain_timeout" KeyDeployPreviousReleaseHold = "deploy.previous_release_hold" KeyDeployStableWindow = "deploy.stable_window" KeyDeployWatchWindow = "deploy.watch_window" // KeyDeployCIGateMaxWaits caps the CI gate waits one app may hold at once, one per ref. KeyDeployCIGateMaxWaits = "deploy.ci_gate_max_waits_per_app" // KeyDeployReceiptApprovalWindow is the longest gap between an approval and the deploy it released. KeyDeployReceiptApprovalWindow = "deploy.receipt_approval_window" // KeyDeployProcfileDefaultPort is the port a Procfile web process gets, since a Procfile cannot declare one. KeyDeployProcfileDefaultPort = "deploy.procfile_default_port" )
Deploy window keys: the drain, hold, stable and watch timings that decide whether a deploy drops requests. Env names stay as the seed.
const ( KeyDiskHistoryRetentionDays = "disk.history_retention_days" KeyDiskHistorySampleInterval = "disk.history_sample_interval" KeyDiskForecastWindowDays = "disk.forecast_window_days" KeyDiskForecastMinDays = "disk.forecast_min_days" DiskHistoryMinSampleInterval = time.Hour )
Disk history setting keys.
const ( KeyDNSEgressReportMaxNames = "dns.egress_report_max_names" DNSEgressReportMaxNamesMin = 10 DNSEgressReportMaxNamesMax = 10000 )
Egress dry run: caps how many distinct names one report lists.
const ( KeyDNSForwardEnabled = "dns.forward_enabled" KeyDNSForwardAttemptTimeout = "dns.forward_attempt_timeout" KeyDNSForwardQueryTimeout = "dns.forward_query_timeout" KeyDNSForwardUpstreams = "dns.forward_upstreams" KeyDNSCacheBytes = "dns.cache_bytes" KeyDNSCacheMaxTTL = "dns.cache_max_ttl" KeyDNSCacheNegativeMaxTTL = "dns.cache_negative_max_ttl" KeyDNSContainerFallback = "dns.container_fallback" KeyDNSRateLimitQPS = "dns.rate_limit_qps" KeyDNSRateLimitBurst = "dns.rate_limit_burst" // DNSFallbackHostUpstream and DNSFallbackNone are the values of dns.container_fallback. DNSFallbackHostUpstream = "host_upstream" DNSFallbackNone = "none" )
Mesh DNS forwarding to the host's upstream resolvers (beta, only active while the mesh resolver is on).
const ( KeyDNSInternalNamesEnabled = "dns.internal_names_enabled" KeyDNSInternalNamesMax = "dns.internal_names_max" KeyDNSInternalNameMaxLength = "dns.internal_name_max_length" KeyDNSInternalLabelMaxLen = "dns.internal_label_max_length" KeyDNSInternalNamesReserved = "dns.internal_names_reserved" )
Extra internal DNS names per app (beta, off by default).
const ( KeyDNSMeshResolverEnabled = "dns.mesh_resolver_enabled" KeyDNSMeshResolverInterval = "dns.mesh_resolver_interval" )
Mesh DNS resolver on the bridge gateways (beta, off by default).
const ( KeyDNSQueryLogAppRefresh = "dns.query_log_app_refresh" KeyDNSQueryLogEnabled = "dns.query_log_enabled" KeyDNSQueryLogSize = "dns.query_log_size" KeyDNSQueryLogPrivacy = "dns.query_log_privacy" // DNSQueryLogSizeMin and Max clamp how many records the ring may hold. DNSQueryLogSizeMin = 10 DNSQueryLogSizeMax = 100000 )
Mesh DNS query visibility (beta, off by default).
const ( KeyDomainsDNSWatchInterval = "domains.dns_watch_interval_seconds" KeyDomainsDNSWatchMaxMins = "domains.dns_watch_max_minutes" )
Keys for the background DNS watcher that follows a new domain until it is live.
const ( KeyDockerHubLimitWarnPercent = "registry.dockerhub.limit_warn_percent" KeyDockerHubLimitsCacheSecond = "registry.dockerhub.limits_cache_seconds" KeyDockerHubTagPageSize = "registry.dockerhub.tag_page_size" KeyDockerHubUseCredential = "registry.dockerhub.use_credential" )
Docker Hub integration keys.
const ( KeyDomainLimitsMaxBodyBytes = "domains.limits_max_body_bytes" KeyDomainLimitsMaxTimeoutSeconds = "domains.limits_max_timeout_seconds" )
Registered keys for the ceilings on per-domain request limits.
const ( KeyDomainTuningMinTimeoutSeconds = "domains.tuning_min_timeout_seconds" KeyDomainTuningMaxTimeoutSeconds = "domains.tuning_max_timeout_seconds" KeyDomainTuningMaxStreamSeconds = "domains.tuning_max_stream_seconds" )
Registered keys for the bounds on per-domain proxy tuning.
const ( KeyErrorsDedupHours = "errors.dedup_hours" KeyErrorsDedupMax = "errors.dedup_max" )
Keys for the error tracking event-ID dedup window.
const ( KeyFootprintGCPercent = "footprint.gc_percent" KeyFootprintMemLimitPercent = "footprint.memlimit_percent" KeyFootprintTrimInterval = "footprint.trim_interval" KeyFootprintTrimMinIdleMB = "footprint.trim_min_idle_mb" )
Keys for the live Go runtime footprint knobs.
const ( KeyGitLabDeployments = "git.gitlab_deployments" KeyGitLabDeploymentsConnections = "git.gitlab_deployments_connections" )
Keys for reporting deploys to a GitLab project's Deployments and Environments pages.
const ( KeyGitPollEnabled = "git.poll_enabled" KeyGitPollInterval = "git.poll_interval" KeyGitPollConcurrency = "git.poll_concurrency" KeyGitPollMaxBackoff = "git.poll_max_backoff" )
Keys of the live git poller settings.
const ( KeyGitTriggerPatternsMax = "git.trigger_patterns_max" KeyGitTriggerPatternMaxLen = "git.trigger_pattern_max_length" KeyGitTriggerRefMaxBytes = "git.trigger_ref_max_bytes" KeyGitTriggerListMaxBytes = "git.trigger_pattern_list_max_bytes" )
Registered keys bounding git deploy trigger tag and branch patterns.
const ( KeyGitRefreshEnabled = "git.oauth_refresh_enabled" KeyGitRefreshLead = "git.oauth_refresh_lead" KeyGitRefreshInterval = "git.oauth_refresh_interval" KeyGitRefreshFailureGrace = "git.oauth_refresh_failure_grace" KeyGitRotateLifetimeDays = "git.rotate_lifetime_days" )
Git provider credential renewal: OAuth access tokens refresh themselves ahead of expiry, and a connection only alerts when a refresh keeps failing.
const ( KeyGitSubmodulesMaxDepth = "git.submodules_max_depth" KeyGitSubmodulesMaxCount = "git.submodules_max_count" KeyGitSubmodulesMaxMB = "git.submodules_max_mb" KeyGitSubmodulesTimeout = "git.submodules_timeout" KeyGitSubmodulesAuthHosts = "git.submodules_credential_hosts" KeyGitLFSHosts = "git.lfs_hosts" KeyGitSubmodulesAllowedCIDRs = "git.submodules_allowed_cidrs" )
Keys bounding submodule and LFS fetches of git source builds.
const ( KeyIaCPlanValueMax = "iac.plan_value_max" KeyStackPruneMaxPercent = "stacks.prune_max_percent" KeyStackPruneMaxCount = "stacks.prune_max_count" KeyIaCSecretMatchMinLen = "iac.secret_match_min_len" KeyHFTimeoutSeconds = "models.hf_timeout_seconds" KeyHFMaxResponseBytes = "models.hf_max_response_bytes" KeyHFMaxListedFiles = "models.hf_max_listed_files" KeyPlacementAffinityTerms = "placement.affinity_max_terms" )
Registered keys for plan and prune guards, model fetch limits and placement limits.
const ( KeyHostPressureEnabled = "host.pressure_enabled" KeyHostPressureShedEnabled = "host.pressure_shed_enabled" KeyHostPressureInterval = "host.pressure_interval" KeyHostPressureHold = "host.pressure_hold" KeyHostPressureExitPercent = "host.pressure_exit_percent" KeyHostPressureJitter = "host.pressure_resume_jitter" KeyHostPressureCPUWarn = "host.pressure_cpu_warn" KeyHostPressureCPUCritical = "host.pressure_cpu_critical" KeyHostPressureMemWarn = "host.pressure_mem_warn" KeyHostPressureMemCritical = "host.pressure_mem_critical" KeyHostPressureFullWarn = "host.pressure_mem_full_warn" KeyHostPressureFullCritical = "host.pressure_mem_full_critical" KeyHostPressureAvailWarn = "host.pressure_avail_warn_percent" KeyHostPressureAvailCrit = "host.pressure_avail_critical_percent" KeyHostPressureLoadWarn = "host.pressure_load_warn" KeyHostPressureLoadCritical = "host.pressure_load_critical" KeyHostNoSwapRAMMB = "host.no_swap_ram_threshold_mb" )
Host pressure setting keys.
const ( // KeyHostUncleanRestartWindow is how long an unclean restart stays in the attention feed and the doctor row. KeyHostUncleanRestartWindow = "host.unclean_restart_window" // KeyHostProtectedOOMScoreAdj is the OOM score adjustment at or below which the control plane counts as protected. KeyHostProtectedOOMScoreAdj = "host.protected_oom_score_adj" )
const ( KeyIaCComposeRefs = "iac.compose_refs" KeyIaCComposeMaxFileKB = "iac.compose_max_file_kb" KeyIaCComposeMaxFiles = "iac.compose_max_files" KeyIaCComposeMaxTotalKB = "iac.compose_max_total_kb" )
Registered keys for compose references in the App kind (ADR 081).
const ( KeyImagesKeepPerApp = "images.keep_per_app" KeyImagesPruneSchedule = "images.prune_schedule" )
Image retention keys.
const ( KeyAppImageKeep = "app.image_keep" KeyAppImageKeepOverrides = "app.image_keep_overrides" )
Per-app image keep keys. 0 follows images.keep_per_app.
const ( KeyIncidentPostmortemFieldMax = "incidents.postmortem_field_max" KeyIncidentPostmortemActionMax = "incidents.postmortem_action_items_max" KeyIncidentPostmortemBodyMax = "incidents.postmortem_body_max" )
Incident postmortem bounds. Each text field is capped on its own so one long section cannot crowd the incident detail view or the audit trail.
const ( KeyIngressMaxBodyBytes = "ingress.max_body_bytes" KeyAccessLogRetention = "telemetry.access_log_retention" KeyIngressFallbackCerts = "ingress.fallback_certs" // KeyVisitorSaltRotation sets how often the salt behind visitor hashes changes. KeyVisitorSaltRotation = "telemetry.visitor_salt_rotation" // KeyVisitorHistoryRetention sets how long hourly visitor rollups are kept; 0 turns persistence off. KeyVisitorHistoryRetention = "telemetry.visitor_history_retention" // FallbackCertsEager and FallbackCertsLazy are the accepted ingress.fallback_certs values. FallbackCertsEager = "eager" FallbackCertsLazy = "lazy" )
Registered keys for the ingress body cap and the in-memory access log window.
const ( KeyAPIRateLimitRead = "api.rate_limit_read_rpm" KeyAPIRateLimitWrite = "api.rate_limit_write_rpm" KeyAPIRateLimitRedeem = "api.rate_limit_redeem_rpm" KeyAuthRateLimitPerIP = "auth.engine_rate_limit_per_ip" KeyAuthRateLimitPerEmail = "auth.engine_rate_limit_per_email" KeyAPIMaxBodyBytes = "api.max_body_bytes" KeyAssetsUploadMaxBytes = "assets.upload_max_bytes" KeyDeployMaxConcurrent = "deploy.max_concurrent" KeyInlineSourceMaxBytes = "deploy.inline_source_max_bytes" KeyInlineSourceMaxFiles = "deploy.inline_source_max_files" KeyInlineSourceKeep = "deploy.inline_source_keep" )
Registered keys for request limits and deploy concurrency.
const ( KeyMeshWakeDebounce = "mesh.wake_debounce" KeyMeshApplyTimeout = "mesh.apply_timeout" KeyMeshApplyRetries = "mesh.apply_retries" KeyMeshApplyRetryDelay = "mesh.apply_retry_delay" )
Mesh config push keys: how a node's join wakes the mesh and how long one push may take.
const ( KeyMeshHubResolveTTL = "mesh.hub_resolve_ttl" KeyMeshHubStaleMax = "mesh.hub_stale_max" )
Mesh hub hostname resolution keys.
const ( KeyMetricsIdleInterval = "metrics.idle_interval" KeyMetricsPresenceWindow = "metrics.presence_window" KeyStoreTouchFlush = "store.touch_flush_interval" )
Keys for how the metrics collector slows down while nobody watches.
const ( // KeyNodesPatchPreviewTTL is how long a patch preview token stays valid for an apply. KeyNodesPatchPreviewTTL = "nodes.patch_preview_ttl" // KeyNodesPatchApplyTimeout bounds one package upgrade run on a node. KeyNodesPatchApplyTimeout = "nodes.patch_apply_timeout" // KeyNodesPatchOutputTailLines is how many lines of package manager output a run keeps. KeyNodesPatchOutputTailLines = "nodes.patch_output_tail_lines" // KeyNodesPatchRunHistory is how many patch runs per node stay listed. KeyNodesPatchRunHistory = "nodes.patch_run_history" // KeyNodesPatchPollInterval is how often a detached upgrade unit's state is read. KeyNodesPatchPollInterval = "nodes.patch_poll_interval" // KeyNodesPatchAdoptLimit caps how many leftover upgrade units a restarted control plane adopts. KeyNodesPatchAdoptLimit = "nodes.patch_adopt_limit" )
const ( KeyNodeCPUThresholdPercent = "nodes.alert_cpu_percent" KeyNodeMemoryThresholdPercent = "nodes.alert_memory_percent" KeyNodeDiskThresholdPercent = "nodes.alert_disk_percent" KeyNodeThresholdSustained = "nodes.alert_sustained_intervals" // NodeThresholdMinPercent and NodeThresholdMaxPercent bound defaults and per-node overrides alike. NodeThresholdMinPercent = 1 NodeThresholdMaxPercent = 100 )
Node threshold alert setting keys; per-node overrides live in the node_threshold_overrides table.
const ( KeyOrgsAvatarMaxBytes = "orgs.avatar_max_bytes" KeyOrgsAvatarMaxDimension = "orgs.avatar_max_dimension" )
Organization profile keys.
const ( KeyOrgsStrictIsolation = "orgs.strict_isolation" KeyOrgsAdminsCanCreate = "orgs.admins_can_create" // KeyOrgsProvisionedDefaultMembership defaults on so existing installs keep joining provisioned users to the default org. KeyOrgsProvisionedDefaultMembership = "orgs.provisioned_default_membership" )
Organization isolation settings. Both default to off so an existing install behaves as before.
const ( KeyOTLPIngestEnabled = "otlp.ingest_enabled" KeyOTLPIngestMaxBody = "otlp.ingest_max_body_bytes" KeyOTLPIngestMaxRecords = "otlp.ingest_max_records" KeyOTLPIngestMaxLine = "otlp.ingest_max_line_bytes" )
Keys for the OTLP logs and metrics receiver. It is off until an operator turns it on.
const ( KeyAuthPasswordMinLength = "auth.password_min_length" KeyAuthPasswordRequireClasses = "auth.password_require_classes" )
Password policy keys. The defaults match the rule that shipped before these settings existed.
const ( KeyPerfStatementTiming = "perf.statement_timing" KeyPerfSlowStatementMS = "perf.slow_statement_ms" KeyPerfSlowStatements = "perf.slow_statement_ring" )
Statement timing keys for the control plane's own database.
const ( KeyProjectsDefaultEnvironment = "projects.default_environment" KeyProjectsDefaultEnvironmentName = "projects.default_environment_name" )
Keys for the environment a new project starts with.
const ( KeyDoctorReachabilityDialbackURL = "doctor.reachability_dialback_url" KeyDoctorReachabilityDialbackAllowPrivate = "doctor.reachability_dialback_allow_private" )
Reachability dial-back keys. The URL empty means nothing is ever contacted.
const ( KeyDeploysRegistryPushMaxBody = "deploys.registry_push_max_body_bytes" KeyDeploysRegistryPushTimeout = "deploys.registry_push_timeout" KeyDeploysRegistryPushDebounce = "deploys.registry_push_debounce" )
Registry push webhook keys (GHCR and Docker Hub deliveries to the image-update hook).
const ( KeyResourceDescriptionMaxChars = "resources.description_max_chars" KeyResourceNotesMaxBytes = "resources.notes_max_bytes" )
Registered caps for the description and notes an operator records on apps and databases.
const ( KeyRuntimeTmpfsMax = "runtime.tmpfs_max" KeyRuntimeTmpfsMaxBytes = "runtime.tmpfs_max_bytes" KeyRuntimeTmpfsDefault = "runtime.tmpfs_default_bytes" KeyRuntimeShmMaxBytes = "runtime.shm_max_bytes" KeyRuntimeExtraHostsMax = "runtime.extra_hosts_max" KeyRuntimeDNSMax = "runtime.dns_max" KeyRuntimeStopTimeoutMax = "runtime.stop_timeout_max_seconds" KeyRuntimePidsMax = "runtime.pids_limit_max" KeyRuntimeUlimitCount = "runtime.ulimit_count_max" KeyRuntimeUlimitBytes = "runtime.ulimit_bytes_max" )
Keys for the bounds a service's runtime options are validated against.
const ( KeySavedViewNameMaxChars = "views.name_max_chars" KeySavedViewFilterMaxKeys = "views.filter_max_keys" KeySavedViewValueMaxBytes = "views.filter_value_max_bytes" KeySavedViewMaxPerUser = "views.max_per_user" )
Registered caps for saved list views, so one user cannot fill the store or the menu.
const ( KeyScanDefaultEnabled = "supply_chain.default_enabled" KeyScanDefaultGate = "supply_chain.default_gate" )
Registered keys for the instance default scan policy apps inherit.
const ( KeySecretsRequireRefEnvironments = "secrets.require_ref_environments" //nolint:gosec // setting key, not a credential KeySecretsRequireRefMode = "secrets.require_ref_mode" //nolint:gosec // setting key, not a credential SecretRefModeOff = "off" SecretRefModeWarn = "warn" SecretRefModeEnforce = "enforce" )
Secret reference policy: environments where literal secret values are not accepted.
const ( KeySecretProviderTimeout = "secrets.provider_timeout_seconds" //nolint:gosec // setting key, not a credential KeySecretProviderCacheTTL = "secrets.provider_cache_ttl_seconds" //nolint:gosec // setting key, not a credential KeySecretProviderMaxRPS = "secrets.provider_max_rps" //nolint:gosec // setting key, not a credential KeySecretProviderMaxResponse = "secrets.provider_max_response_kib" //nolint:gosec // setting key, not a credential )
External secret provider (Doppler, Infisical, 1Password) read tunables.
const ( KeySecretRefMaxRef = "secrets.ref_max_ref_bytes" //nolint:gosec // setting key, not a credential KeySecretRefMaxConn = "secrets.ref_max_conn_bytes" //nolint:gosec // setting key, not a credential KeySecretRefMaxPath = "secrets.ref_max_path_bytes" //nolint:gosec // setting key, not a credential KeySecretRefMaxSegments = "secrets.ref_max_path_depth" //nolint:gosec // setting key, not a credential KeySecretRefMaxKey = "secrets.ref_max_key_bytes" //nolint:gosec // setting key, not a credential )
Length limits for secret:// references and connection names.
const ( KeySpoolMaxAgeSeconds = "spool.max_age_seconds" KeySpoolQuotaBytes = "spool.quota_bytes" KeyAPIExpensiveReadTTL = "api.expensive_read_ttl" )
Upload spool and expensive-read cache keys. 0 keeps the value the env seed gives.
const ( KeyIaCApplyEnabled = "iac.apply_enabled" KeyIaCV1HashAccepted = "iac.v1_hash_accepted" KeyStacksSoloSelfApprove = "stacks.solo_self_approve" KeyStackLockTTL = "stacks.lock_ttl" KeyStackLockRenewFraction = "stacks.lock_renew_fraction" KeyStackApprovalTTL = "stacks.approval_ttl" KeyStackOIDCTTL = "stacks.oidc_ttl" KeyStackDriftIntervalSecs = "stacks.drift_interval_seconds" KeyStackDriftSummaryMax = "stacks.drift_summary_max" KeyStackDriftRotationMinutes = "stacks.drift_rotation_minutes" )
Registered keys for stack and IaC apply. Env names stay as seeds; call sites still read env until each slice moves them to the registry.
const ( KeyStackSyncTickSecs = "stacks.sync_tick_seconds" KeyStackSyncMinIntervalSecs = "stacks.sync_min_interval_seconds" KeyStackSyncMaxRepoMB = "stacks.sync_max_repo_mb" KeyStackSyncFetchTimeout = "stacks.sync_fetch_timeout_seconds" KeyStackSyncMaxFiles = "stacks.sync_max_files" KeyStackSyncMaxFileKB = "stacks.sync_max_file_kb" KeyStackSyncRefreshMinSecs = "stacks.sync_refresh_min_seconds" KeyStackSyncMinFreeMB = "stacks.sync_min_free_mb" KeyStackSyncWebhookMaxKB = "stacks.sync_webhook_max_body_kb" KeyStackSyncSparseWatchMS = "stacks.sync_sparse_watch_ms" )
Registered keys for the plan only git sync of stacks.
const ( KeyDiskLowFreeMB = "disk.low_free_mb" KeyDiskCriticalFreeMB = "disk.critical_free_mb" KeyDiskReserveMB = "disk.reserve_mb" KeyMetricsRetention = "telemetry.metrics_retention" KeyLogsRetention = "telemetry.logs_retention" KeyLogBudgetMB = "telemetry.log_budget_mb" KeyMonitorRawRetained = "monitors.raw_retention" )
Disk guard and telemetry storage setting keys.
const ( KeyStorageLowFreePercent = "storage.low_free_percent" KeyStorageCriticalFreePercent = "storage.critical_free_percent" )
Free-space percent floors the Storage page uses to judge disk health.
const ( KeyTemplatesImportMaxBytes = "templates.import_max_bytes" KeyTemplatesImportTimeout = "templates.import_timeout" )
Template import by URL keys.
const ( KeyTokensReminderWindows = "credential_expiry.reminder_windows_days" //nolint:gosec // setting key, not a credential KeyTokensReminderInterval = "credential_expiry.reminder_interval" //nolint:gosec // setting key, not a credential KeyTokensRotationGrace = "credential_expiry.rotation_grace" //nolint:gosec // setting key, not a credential )
Token expiry reminders, rotation grace and git credential renewal.
const ( KeyTokensDefaultTTLDays = "tokens.default_ttl_days" //nolint:gosec // setting key, not a credential KeyTokensUnusedAlertDays = "tokens.unused_alert_days" //nolint:gosec // setting key, not a credential KeyTokensExpiryWarningDays = "tokens.expiry_warning_days" //nolint:gosec // setting key, not a credential KeyTokensSystemRotationLeadMins = "tokens.system_rotation_lead_minutes" //nolint:gosec // setting key, not a credential )
Token hygiene settings. Both default to 0 so an existing install behaves as before.
const ( KeyProjectCloneMaxApps = "projects.clone_max_apps" KeyProjectClonePlaceholderDomain = "projects.clone_placeholder_domain" KeyPreviewMigrateTimeout = "previews.migrate_timeout" KeyPreviewMigrateWait = "previews.migrate_wait" KeyCDNPurgeHistory = "cdn.purge_history" KeyDeployExplainLogLines = "deploy.explain_log_lines" KeyUpdateOfferedChannels = "updates.offered_channels" KeyNetworkGCMaxRemovals = "network.gc_max_removals" KeyMeshReadyRetrySeconds = "mesh.ready_retry_seconds" KeyAppsContainersInspectTimeout = "apps.containers_inspect_timeout" KeyBackupsComposeRestoreTimeout = "backups.compose_restore_timeout" KeyBackupsScheduleRetainDefault = "backups.schedule_retain_default" KeyBackupsDrillIntervalHours = "backups.drill_interval_hours" KeyBackupsDrillRetentionDays = "backups.drill_retention_days" KeyBackupsDrillTimeout = "backups.drill_timeout" )
Tunables that used to be env-only. The env name stays as the seed.
const ( KeyVaultCacheTTL = "secrets.vault_cache_ttl_seconds" //nolint:gosec // setting key, not a credential KeyVaultAllowPrivate = "vault.allow_private_address" //nolint:gosec // setting key, not a credential KeyVaultTokenRenewAfter = "secrets.vault_token_renew_percent" //nolint:gosec // setting key, not a credential )
HashiCorp Vault and OpenBao client tunables.
const ( KeyVolumesUsageAlertPercent = "volumes.usage_alert_percent" KeyVolumesSizeHistoryRetention = "volumes.size_history_retention" )
Registered keys for volume usage alerts and the volume size history.
const ( KeyVolumesTransferMaxBytes = "volumes.transfer_max_bytes" KeyVolumesTransferTimeout = "volumes.transfer_timeout" KeyVolumesImportOverwrite = "volumes.import_overwrite" // KeyVolumesTransferMaxConcurrent bounds uploads staged at once on a control plane. KeyVolumesTransferMaxConcurrent = "volumes.transfer_max_concurrent" // KeyVolumesTransferSpoolDir names the folder under the data dir that stages import archives. KeyVolumesTransferSpoolDir = "volumes.transfer_spool_dir" // DefaultVolumesTransferSpoolDir is the spool folder name under the data dir. DefaultVolumesTransferSpoolDir = "volume-transfer" )
Registered keys for moving a volume's files in and out as an archive.
const ( KeyAuditLogDays = "retention.audit_log_days" KeyAuditSecurityDays = "retention.audit_security_days" KeyEmailLogDays = "retention.email_log_days" KeyWebhookDeliveryDays = "retention.webhook_delivery_days" KeyEventWebhookDays = "retention.event_webhook_days" KeyAlertHistoryDays = "retention.alert_history_days" KeyAuthExpiredDays = "retention.auth_expired_days" KeyAIHistoryDays = "retention.ai_history_days" KeyRestoreHistoryDays = "retention.restore_history_days" KeyProbeAttemptDays = "retention.probe_attempt_days" KeyAppHistoryDays = "retention.app_history_days" KeyForgeStatusDays = "retention.forge_status_days" KeyUsageCostDays = "retention.usage_cost_days" KeyStatusIncidentDays = "retention.status_incident_days" KeyCleanupInterval = "cleanup.interval" KeyCleanupEnabled = "cleanup.enabled" AuditLogFloorDays = 90 AuditSecurityFloorDays = 365 CleanupMinInterval = 15 * time.Minute )
Retention and cleanup scheduler keys. Each retention key is the runtime form of an older env var, which stays as that setting's env override.
const AppImageKeepMin = 2
AppImageKeepMin is the smallest per-app keep, so the previous successful release survives.
const AuthRateLimitFloor = 10
AuthRateLimitFloor keeps the credential limiter high enough for an admin to sign in, MFA included, and low enough to stop stuffing.
const DefaultPoolerImage = "edoburu/pgbouncer:v1.26.1-p0"
DefaultPoolerImage is an exact version tag of a pgbouncer image that speaks the env contract the pooler reconciler writes.
const DefaultSizePresets = "small=0.5:512Mi,medium=1:1Gi,large=2:2Gi,xlarge=4:4Gi"
DefaultSizePresets seeds the table when nothing is saved or in env.
const ImagesPruneOff = "off"
ImagesPruneOff turns the scheduled prune off, which is the long-standing behavior.
const JobQueueMax = 10000
JobQueueMax bounds the job ping queue so its backing channel has a fixed size while the limit stays live.
const KeyAPIConditionalGet = "api.conditional_get"
KeyAPIConditionalGet switches ETag and 304 answers on read JSON endpoints.
const KeyAPIConditionalGetMaxBytes = "api.conditional_get_max_bytes"
KeyAPIConditionalGetMaxBytes caps the body buffered to compute an ETag.
const (
KeyAccessLogSize = "telemetry.access_log_size"
)
KeyAccessLogSize is the per-route ring size of the in-memory recent-requests log.
const KeyAccountPreferencesMaxBytes = "account.preferences_max_bytes"
KeyAccountPreferencesMaxBytes caps one saved per-user preference document.
const KeyAppsEnvApplyOnSet = "apps.env_apply_on_set"
KeyAppsEnvApplyOnSet makes env set and import restart the app right away.
const KeyAppsMaxReplicasPerService = "apps.max_replicas_per_service"
KeyAppsMaxReplicasPerService caps the replica count one service may be given.
const KeyAuthSSOAutoRedirect = "auth.sso_auto_redirect"
KeyAuthSSOAutoRedirect sends the sign-in page straight to the only enabled single sign-on provider.
const KeyBackupDefaultRetentionHours = "backup.default_retention_hours"
KeyBackupDefaultRetentionHours is the default backup retention window in hours.
const (
KeyBackupLocalRoot = "backup.local_root"
)
Backup root key.
const KeyBuildSettingValueMaxBytes = "builds.setting_value_max_bytes"
KeyBuildSettingValueMaxBytes caps each per-app build setting value.
const KeyBuildStageLogTailLines = "build.stage_log_tail_lines"
KeyBuildStageLogTailLines sizes the log tail kept for each build stage.
const KeyBuildsMemoryLimitMB = "builds.memory_limit_mb"
KeyBuildsMemoryLimitMB caps the memory one build may use; 0 means auto.
const KeyCertificatesWeeklyIssueWarn = "certificates.weekly_issue_warn"
KeyCertificatesWeeklyIssueWarn is the certificate count in seven days at which the budget meter warns.
const KeyCloudConnectionsEnabled = "cloud.connections_enabled"
KeyCloudConnectionsEnabled gates the cloud connections API and CLI (preview).
const KeyComposeDependsOnTimeout = "compose.depends_on_timeout"
KeyComposeDependsOnTimeout bounds how long a compose service waits on a depends_on dependency.
const KeyConnectionBindingRuleValueMaxLen = "connections.binding_rule_value_max_len"
KeyConnectionBindingRuleValueMaxLen caps one string inside binding rules, such as a branch or a path.
const KeyConnectionBindingRulesMaxBytes = "connections.binding_rules_max_bytes"
KeyConnectionBindingRulesMaxBytes caps the rules JSON a binding may store.
const (
KeyConnectionExpiryWarn = "connections.expiry_warn"
)
KeyConnectionExpiryWarn is how far ahead the integrations hub flags a connection as expiring.
const KeyDBOptimizeInterval = "store.optimize_interval"
KeyDBOptimizeInterval is how often the control plane database refreshes planner statistics.
const KeyDBParamsMaxConnections = "databases.params_max_connections"
KeyDBParamsMaxConnections caps the connection parameters a database owner may stage (max_connections, maxclients, maxConns). The env name only seeds the default.
const KeyDBParamsMaxMemoryMB = "databases.params_max_memory_mb"
KeyDBParamsMaxMemoryMB caps memory parameters of a database that has no memory limit.
const KeyDNSVerifyTokenOnSave = "dns.verify_provider_on_save" //nolint:gosec // setting key, not a credential
KeyDNSVerifyTokenOnSave makes a DNS provider credential save also test it.
const (
KeyDatabaseImportMaxBytes = "databases.import_max_bytes"
)
KeyDatabaseImportMaxBytes caps one dump uploaded to a managed database.
const KeyDatabasesPoolerImage = "databases.pooler_image"
KeyDatabasesPoolerImage is the image the managed Postgres pooler runs.
const KeyDeployApprovalMaxRequired = "deploy.approval_max_required"
KeyDeployApprovalMaxRequired caps how many distinct approvers an environment may require, so a typo cannot lock deploys out.
const KeyDeployMaxConcurrentPerProject = "deploy.max_concurrent_per_project"
KeyDeployMaxConcurrentPerProject caps simultaneous builds inside one project.
const KeyDeployOrphanGraceSeconds = "deploy.orphan_grace_seconds"
KeyDeployOrphanGraceSeconds is how old a running deploy must be before cancel may treat it as orphaned.
const KeyDomainsAuthGateTimeout = "domains.auth_gate_timeout"
KeyDomainsAuthGateTimeout is the default auth gate subrequest timeout.
const KeyDomainsBatchMaxItems = "domains.batch_max_items"
KeyDomainsBatchMaxItems caps the items of one POST /api/v1/domains/batch.
const KeyDomainsHTTPSAttemptsPerHour = "domains.https_attempts_per_hour"
KeyDomainsHTTPSAttemptsPerHour caps production HTTPS enable attempts per hour.
const KeyDomainsParkedRetentionDays = "domains.parked_retention_days"
KeyDomainsParkedRetentionDays is how long a parked domain may sit before the hourly job forgets it.
const KeyDomainsRollbackWindowMinutes = "domains.rollback_window_minutes"
KeyDomainsRollbackWindowMinutes bounds how long a domain change can be rolled back.
const KeyFirewallConfirmWindow = "firewall.confirm_window"
KeyFirewallConfirmWindow is how long a dashboard or CLI port restriction waits for confirmation.
const KeyGitSSHScanAllowInternal = "git.ssh_scan_allow_internal"
KeyGitSSHScanAllowInternal lists internal networks a host key scan may dial.
const KeyImagesPullConcurrency = "images.pull_concurrency"
KeyImagesPullConcurrency caps how many distinct image pulls run at once on a node.
const KeyImagesRemoveMaxPerRequest = "images.remove_max_per_request"
KeyImagesRemoveMaxPerRequest caps how many images one explicit removal request may name.
const KeyNetOutboundTimeout = "net.outbound_timeout"
KeyNetOutboundTimeout bounds every shared outbound HTTP request.
const KeyNextjsGenerateActionsKey = "nextjs.generate_actions_key"
KeyNextjsGenerateActionsKey turns on the one-time Server Actions key for wizard-created Next.js apps.
const KeyNextjsMemoryFloorMB = "nextjs.memory_floor_mb"
KeyNextjsMemoryFloorMB is the memory limit under which the doctor warns about Next.js apps.
const KeyNodesProtectedTaintKeys = "nodes.protected_taint_keys"
KeyNodesProtectedTaintKeys lists taint keys whose removal or loosening counts as weakening.
const KeyOnboardingEnabled = "onboarding.enabled"
KeyOnboardingEnabled turns the first-run onboarding flow on or off for everyone.
const KeyOnboardingRestoreReminderDays = "onboarding.restore_reminder_days"
KeyOnboardingRestoreReminderDays is how many days after onboarding starts the dashboard nudges a restore test.
const KeyPipelinesOIDCListenPort = "pipelines.oidc_listen_port"
KeyPipelinesOIDCListenPort is the port of the job OIDC endpoint on the bridge gateway.
const KeyProxyCertWait = "ingress.proxy_cert_wait"
KeyProxyCertWait is how long a managed proxy route may lack a certificate before the diagnosis stops saying "still requesting".
const (
KeyReadConns = "store.read_connections"
)
KeyReadConns sizes the control plane database read pool.
const KeyReconcileResyncSeconds = "reconcile.resync_seconds"
KeyReconcileResyncSeconds is the safety-net interval between full reconcile passes.
const KeyRegistryMirrorPrefix = "registry.mirror_prefix"
KeyRegistryMirrorPrefix is the pull-through prefix for the agent and BuildKit images.
const KeyScheduledTasksHistoryKeep = "scheduled_tasks.history_keep"
KeyScheduledTasksHistoryKeep caps the run history rows kept per scheduled task.
const KeyScheduledTasksMaxOutputBytes = "scheduled_tasks.max_output_bytes"
KeyScheduledTasksMaxOutputBytes bounds the output tail kept per run.
const KeySecurityDockerGuardMaxItems = "security.docker_guard_max_items"
KeySecurityDockerGuardMaxItems caps how many per-rule Docker guard items the attention feed lists.
const KeySecurityProtectedSilenceMaxDays = "security.protected_silence_max_days"
KeySecurityProtectedSilenceMaxDays caps how long a root admin may mute a security-integrity issue.
const KeyShellSectionTimeout = "shell.section_timeout"
KeyShellSectionTimeout bounds each section of the shell bootstrap aggregate.
const KeySizePresets = "apps.size_presets"
KeySizePresets holds the named resource sizes offered for apps and databases.
const KeyStorageLargeUnmanagedImageMB = "storage.large_unmanaged_image_mb"
KeyStorageLargeUnmanagedImageMB is the size at which the Storage page marks an unmanaged image as large.
const KeyTemplatesCapNetAdmin = "templates.capability_net_admin_enabled"
KeyTemplatesCapNetAdmin gates the Elevated net_admin capability class.
const KeyTemplatesFileInputMaxBytes = "templates.file_input_max_bytes"
KeyTemplatesFileInputMaxBytes caps one config file an install form supplies.
const KeyTemplatesFirstBootMaxSeconds = "templates.first_boot_max_seconds"
KeyTemplatesFirstBootMaxSeconds caps a template's own first_boot_seconds.
const KeyUIOutboundUTM = "ui.outbound_utm"
KeyUIOutboundUTM controls whether the dashboard tags outbound links to third party sites with UTM parameters.
const KeyUpgradeVerifyBackup = "upgrade.verify_backup"
KeyUpgradeVerifyBackup turns on the scratch restore of the pre-upgrade backup.
const PasswordMinLengthFloor = 8
PasswordMinLengthFloor is the weakest length any policy may reach, enforced in code as well.
Variables ¶
var BackupRetentionPresets = []int{0, 24, 48, 168, 720, 1440, 2160}
BackupRetentionPresets are the hour counts an operator may pick: 1, 2, 7, 30, 60 and 90 days; 0 keeps backups.
var ErrSensitiveKey = errors.New("runtimesettings: sensitive setting cannot be written by this caller")
ErrSensitiveKey is returned when a caller that may not write credentials targets a sensitive setting.
var ErrUnknownKey = errors.New("runtimesettings: unknown setting")
ErrUnknownKey is returned for a key that is not registered.
var ErrWeakeningNotConfirmed = errors.New("runtimesettings: change weakens a security protection and was not confirmed")
ErrWeakeningNotConfirmed is returned when a write weakens a protection and the caller did not confirm it.
var RetentionPresets = []int{0, 30, 60, 90, 180, 365}
RetentionPresets are the day counts a cleanup policy offers; 0 keeps the data forever.
var TokenRetentionPresets = []int{0, 30, 60, 90, 365}
TokenRetentionPresets are the day counts an operator may pick; 0 keeps tokens forever.
Functions ¶
func BindRuntimeLimits ¶
func BindRuntimeLimits(s *Service)
BindRuntimeLimits points the spec bounds at s. Only the service that handles settings writes may call it, since another instance would cache saved rows and miss later changes.
func CheckAppImageKeep ¶
CheckAppImageKeep accepts 0 (follow the global count) or AppImageKeepMin up to the ceiling.
func CheckAppImageKeepCount ¶
CheckAppImageKeepCount refuses a map with more apps than the settings row may hold.
func ClampBuildCacheReclaimTimeout ¶
ClampBuildCacheReclaimTimeout forces an env seeded timeout into its safe range.
func ClampLimit ¶
ClampLimit forces n into the safe range of a limit setting; boot code uses it so nothing starts below a floor.
func ClampMeshApplyRetries ¶
ClampMeshApplyRetries bounds a mesh.apply_retries value to its registered range.
func ClampMeshApplyRetryDelay ¶
ClampMeshApplyRetryDelay bounds a mesh.apply_retry_delay value to its registered range.
func ClampMeshApplyTimeout ¶
ClampMeshApplyTimeout bounds a mesh.apply_timeout value to its registered range.
func ClampMeshWakeDebounce ¶
ClampMeshWakeDebounce bounds a mesh.wake_debounce value to its registered range.
func DurationEnvToDays ¶
DurationEnvToDays converts a legacy duration env value (a Go duration such as 720h, or Nd) into whole days, rounding up so a window never shrinks. allowZero says whether 0 means keep forever.
func MinDaysCheck ¶
MinDaysCheck rejects a positive day count below floor. 0 (keep forever) always passes.
func MinDurationCheck ¶
MinDurationCheck rejects a duration below floor.
func ParseAppImageKeepOverrides ¶
ParseAppImageKeepOverrides reads the per-app keep map; an empty value is no overrides.
func ParseDuration ¶
ParseDuration parses a positive duration.
func ParseJSON ¶
func ParseJSON(d Definition, raw json.RawMessage) (string, error)
ParseJSON validates an API value (bool, string, number or string array) and returns the canonical stored form.
func PositiveDaysEnv ¶
PositiveDaysEnv accepts only a positive whole-day env value, matching the old audit sweepers where 0 meant "use the default".
func Register ¶
func Register(d Definition)
Register adds a setting to the registry. It panics on a malformed or duplicate definition so a bad registration fails at process start.
Types ¶
type AccessSearchLimits ¶
type AccessSearchLimits struct {
MaxWindow time.Duration
MaxRows int
MaxTerm int
MaxScan int
MaxConc int
}
AccessSearchLimits bounds one access log search, read fresh on every request.
type CutoverVerify ¶
type CutoverVerify struct {
CertWarnDays int
CertFailDays int
SlowTTFB time.Duration
HSTSMinAge int
Timeout time.Duration
MinInterval time.Duration
}
CutoverVerify holds the verifier thresholds, forced into their safe ranges so a stray env seed can never turn a line off.
type DBViewerLimits ¶
type DBViewerLimits struct {
Timeout time.Duration
MaxRows int
MaxBytes int
MaxCellBytes int
SchemaRows int
SQLBytes int
}
DBViewerLimits is the console's per-query bounds, read fresh on every request.
type Definition ¶
type Definition struct {
Key string
Category Category
Kind Kind
Default string
Env string
Apply Apply
Risk Risk
Onboarding bool
// Sensitive masks the value in API responses and audit rows; required for credential-like settings.
Sensitive bool
TitleKey string
DescKey string
Title string
Description string
// AllowedInts limits an int setting to these values; empty accepts any integer.
AllowedInts []int
// CheckItem validates one string_list entry; nil accepts any non-empty entry.
CheckItem func(item string) error
// AllowedStrings limits a string setting to these values.
AllowedStrings []string
// CheckValue vets a canonical value on API writes only (floors and minimums); env and saved rows are not rechecked.
CheckValue func(canonical string) error
// EnvConvert rewrites the env value into this setting's unit before validation (for example a Go duration into days).
EnvConvert func(raw string) (string, error)
// EnvLoose lets an int setting take any non-negative env value, not only the presets, so existing deployments keep working.
EnvLoose bool
// FailClosed makes StringChecked fail instead of falling back to the default when a saved or env value is invalid.
FailClosed bool
// HigherIsWeaker marks an int limit where raising the value weakens a protection, so a raise asks for confirmation.
HigherIsWeaker bool
// StrengthOrder lists a string setting's allowed values from weakest to strongest, so WeakensTo can tell a downgrade.
StrengthOrder []string
// RemovalIsWeaker marks a string_list of protections, where dropping an entry weakens and adding one does not.
RemovalIsWeaker bool
// TrueIsWeaker marks a bool that opens something up when on, so turning it on asks for confirmation.
TrueIsWeaker bool
}
Definition describes one setting. Default and values are in string form (bool "true", duration "10m", int "5", string_list as colon separated).
func Definitions ¶
func Definitions() []Definition
Definitions returns a copy of the registry in registration order.
type LogRuleLimits ¶
type LogRuleLimits struct {
EvalEvery time.Duration
MaxWindow time.Duration
MaxRows int
Samples int
}
LogRuleLimits bounds one log rule evaluation.
type PostmortemLimits ¶
PostmortemLimits bounds one postmortem write, read fresh on every request.
type Risk ¶
type Risk string
Risk marks settings where a weaker value (off, wider, shorter) needs confirmation.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service resolves settings. A nil *Service resolves env then default only, so callers and tests without a database still get the secure defaults.
func NewWithDefinitions ¶
NewWithDefinitions builds a Service over an explicit definition list.
func (*Service) AbuseLimits ¶
AbuseLimits builds the abuse limits from the saved settings, env seeds and defaults, so a caller re-reading it per pass sees a changed value without a restart. Restart-only keys return their boot value.
func (*Service) AccessLogRetention ¶
AccessLogRetention returns the access log window forced into its range, so a stray env seed can never hide every record.
func (*Service) AccessSearchLimits ¶
func (s *Service) AccessSearchLimits(ctx context.Context) AccessSearchLimits
AccessSearchLimits returns the live access log search bounds; a nil service serves env then defaults.
func (*Service) AckReviewed ¶
AckReviewed marks the first-run security review as done.
func (*Service) AnyPendingRestart ¶
AnyPendingRestart reports whether a restart-kind setting differs from its boot value.
func (*Service) AuthGateTimeout ¶
AuthGateTimeout returns the saved default forced into its range, so a bad seed never disables the wait.
func (*Service) CaptureBoot ¶
CaptureBoot records the effective value of every restart-kind setting; the accessors keep returning it and pending_restart compares against it.
func (*Service) ContainerLogRotation ¶
ContainerLogRotation returns the live rotation limits; 0 means unchanged.
func (*Service) CutoverVerify ¶
func (s *Service) CutoverVerify(ctx context.Context) CutoverVerify
CutoverVerify reads the thresholds at call time.
func (*Service) DatabaseParamsMaxConnections ¶
DatabaseParamsMaxConnections returns the live connection ceiling.
func (*Service) DatabaseParamsMaxMemoryMB ¶
DatabaseParamsMaxMemoryMB returns the live memory ceiling for unlimited databases.
func (*Service) DatabaseViewerLimits ¶
func (s *Service) DatabaseViewerLimits(ctx context.Context) DBViewerLimits
DatabaseViewerLimits returns the live console limits; a nil service serves env then defaults.
func (*Service) FirewallConfirmWindow ¶
FirewallConfirmWindow reads the confirm window, forced into its safe range.
func (*Service) GitSubmodulesTimeout ¶
GitSubmodulesTimeout returns the saved fetch timeout forced into its range.
func (*Service) Limit ¶
Limit returns an int limit setting forced into its safe range. API writes are already range-checked; this also covers env seeds, which are only parsed, so a stray 0 or huge value can never disable a limit.
func (*Service) LogRuleLimits ¶
func (s *Service) LogRuleLimits(ctx context.Context) LogRuleLimits
LogRuleLimits returns the live log rule bounds.
func (*Service) Onboarding ¶
Onboarding returns the settings flagged for the first-run review.
func (*Service) PostmortemLimits ¶
func (s *Service) PostmortemLimits(ctx context.Context) PostmortemLimits
PostmortemLimits returns the live postmortem bounds; a nil service serves env then defaults.
func (*Service) ProxyCertWait ¶
ProxyCertWait returns the wait forced into its range.
func (*Service) Set ¶
func (s *Service) Set(ctx context.Context, key string, raw json.RawMessage, actor string) (Setting, error)
Set validates raw and saves it. The returned error is a *ValidationError for a bad value.
func (*Service) Source ¶
Source reports whether a key's value is saved, from the environment, or the default.
func (*Service) StringChecked ¶
StringChecked returns a string setting for a security decision. Unlike String it errors, naming where the problem came from, when the saved settings cannot be read or a FailClosed setting holds an invalid value.
func (*Service) SystemTokenRotationLead ¶
SystemTokenRotationLead reads the rotation lead, forced into its safe range.
func (*Service) TemplatesImportTimeout ¶
TemplatesImportTimeout returns the saved timeout forced into its range.
func (*Service) TrustedProxyPreset ¶
TrustedProxyPreset returns the stored preset, falling back to none for any unknown value.
func (*Service) ValidateForWrite ¶
func (s *Service) ValidateForWrite(ctx context.Context, key string, raw json.RawMessage, opts WriteOptions) (string, error)
ValidateForWrite checks raw against key's type, range, enum and floor rules and the caller's permissions, returning the canonical value. Every writer goes through it.
func (*Service) VisitorHistoryRetention ¶
VisitorHistoryRetention returns the rollup window forced into its range; 0 means persistence is off.
func (*Service) VisitorSaltRotation ¶
VisitorSaltRotation returns the salt period forced into its range.
func (*Service) WeakensOnReset ¶
WeakensOnReset reports whether deleting the saved value would leave a weaker environment seed than the one in force now. Returning to the built-in default never needs confirmation, so only an explicit env seed is compared.
type Setting ¶
type Setting struct {
Key string `json:"key"`
Category string `json:"category"`
Kind string `json:"kind"`
Title string `json:"title"`
Description string `json:"description"`
Default json.RawMessage `json:"default"`
Value json.RawMessage `json:"value"`
Source string `json:"source"`
Env string `json:"env"`
Apply string `json:"apply"`
Risk string `json:"risk"`
Onboarding bool `json:"onboarding"`
Sensitive bool `json:"sensitive"`
AllowedValues []int `json:"allowed_values,omitempty"`
AllowedStrings []string `json:"allowed_strings,omitempty"`
PendingRestart bool `json:"pending_restart"`
// WeakerThanDefault is true when a weakens_security setting now holds a weaker value than its default.
WeakerThanDefault bool `json:"weaker_than_default"`
UpdatedAt *time.Time `json:"updated_at"`
UpdatedBy string `json:"updated_by"`
}
Setting is the wire shape of one resolved setting.
type SizePreset ¶
type SizePreset struct {
Name string `json:"name"`
CPU float64 `json:"cpu"`
MemoryBytes int64 `json:"memory_bytes"`
}
SizePreset is one named CPU and memory size.
func ParseSizePresets ¶
func ParseSizePresets(v string) ([]SizePreset, error)
ParseSizePresets reads name=cpu:memory pairs; it rejects duplicates, zero sizes and bad units.
type Store ¶
type Store interface {
ListRuntimeSettings(ctx context.Context) ([]store.RuntimeSettingRow, error)
SetRuntimeSetting(ctx context.Context, key, value, actor string, now time.Time) error
DeleteRuntimeSetting(ctx context.Context, key string) error
}
Store persists saved values; *store.DB satisfies it.
type ValidationError ¶
ValidationError is a rejected value, reported against the request's value field.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
type WriteOptions ¶
WriteOptions carries what the caller is allowed to do; the zero value is the strictest.
Source Files
¶
- legacy_keys.go
- registry.go
- registry_abuse.go
- registry_access_log.go
- registry_access_log_search.go
- registry_account.go
- registry_apexwww.go
- registry_api_limits.go
- registry_app_bundle.go
- registry_app_metrics.go
- registry_apps_run.go
- registry_appsleep.go
- registry_audit_anchor.go
- registry_auth_gate.go
- registry_autoscale_gauge.go
- registry_backup_hooks.go
- registry_backup_retention.go
- registry_backup_root.go
- registry_boot.go
- registry_bootstrap_scripts.go
- registry_build_cache.go
- registry_build_cache_budget.go
- registry_build_hooks.go
- registry_build_limits.go
- registry_build_settings.go
- registry_build_stages.go
- registry_builds.go
- registry_certificates.go
- registry_changes_stream.go
- registry_cleanup_alert.go
- registry_cloud_connections.go
- registry_cloud_engine.go
- registry_cloudflare.go
- registry_compose.go
- registry_compose_repo.go
- registry_conditional_get.go
- registry_connections.go
- registry_container_logs.go
- registry_cutover_verify.go
- registry_database_bulk.go
- registry_database_import.go
- registry_db_compact.go
- registry_db_optimize.go
- registry_db_readpool.go
- registry_db_tuning.go
- registry_dbparams.go
- registry_dbviewer.go
- registry_default_site.go
- registry_deploy.go
- registry_deploy_approvers.go
- registry_deploy_orphan.go
- registry_disk_history.go
- registry_dns_egress_report.go
- registry_dns_forward.go
- registry_dns_internal_names.go
- registry_dns_mesh_resolver.go
- registry_dns_query_log.go
- registry_dns_verify.go
- registry_dns_watch.go
- registry_docker_guard.go
- registry_dockerhub.go
- registry_domain_limits.go
- registry_domain_tuning.go
- registry_domains_batch.go
- registry_env_apply.go
- registry_errors.go
- registry_firewall.go
- registry_footprint.go
- registry_git_deployments.go
- registry_git_poll.go
- registry_git_ref_patterns.go
- registry_git_refresh.go
- registry_git_ssh.go
- registry_git_submodules.go
- registry_guards.go
- registry_host_pressure.go
- registry_host_protection.go
- registry_https.go
- registry_iac_compose.go
- registry_images.go
- registry_incident_postmortem.go
- registry_ingress.go
- registry_limits.go
- registry_mesh_apply.go
- registry_mesh_hub.go
- registry_metrics_presence.go
- registry_mirror.go
- registry_net_outbound.go
- registry_nextjs.go
- registry_node_patch.go
- registry_node_thresholds.go
- registry_nodes.go
- registry_oidc_listen.go
- registry_onboarding.go
- registry_onboarding_restore.go
- registry_org_profile.go
- registry_orgs.go
- registry_otlp.go
- registry_parked_retention.go
- registry_password.go
- registry_perf.go
- registry_pooler.go
- registry_project_env.go
- registry_proxy_cert.go
- registry_reachability.go
- registry_reconcile.go
- registry_registry_push.go
- registry_resource_notes.go
- registry_runtime_options.go
- registry_saved_views.go
- registry_scan_default.go
- registry_scheduled_tasks.go
- registry_secret_policy.go
- registry_secret_provider.go
- registry_secret_ref.go
- registry_shell.go
- registry_silence.go
- registry_size_presets.go
- registry_spool.go
- registry_sso.go
- registry_stacks.go
- registry_stacksync.go
- registry_storage.go
- registry_storage_ui.go
- registry_template_capabilities.go
- registry_template_file_input.go
- registry_template_first_boot.go
- registry_templates_import.go
- registry_token_expiry.go
- registry_tokens.go
- registry_tunables.go
- registry_ui.go
- registry_upgrade_verify.go
- registry_vault_client.go
- registry_volume_usage.go
- registry_volumes.go
- retention.go
- service.go
- store_load.go
- value.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package registrymirror rewrites image references through an operator supplied pull-through prefix.
|
Package registrymirror rewrites image references through an operator supplied pull-through prefix. |