2023-03-28 18:39:22 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-11 13:12:13 +00:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-03-28 18:39:22 +00:00
|
|
|
|
2017-09-25 18:40:42 +00:00
|
|
|
package config
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"fmt"
|
2022-06-02 02:37:47 +00:00
|
|
|
"time"
|
2017-09-25 18:40:42 +00:00
|
|
|
|
|
|
|
"github.com/hashicorp/hcl"
|
|
|
|
"github.com/mitchellh/mapstructure"
|
2020-10-05 20:28:13 +00:00
|
|
|
|
|
|
|
"github.com/hashicorp/consul/lib/decode"
|
2017-09-25 18:40:42 +00:00
|
|
|
)
|
|
|
|
|
2020-08-10 16:46:28 +00:00
|
|
|
// Source parses configuration from some source.
|
|
|
|
type Source interface {
|
|
|
|
// Source returns an identifier for the Source that can be used in error message
|
|
|
|
Source() string
|
|
|
|
// Parse a configuration and return the result.
|
2020-12-22 19:19:34 +00:00
|
|
|
Parse() (Config, Metadata, error)
|
2020-08-10 16:46:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ErrNoData indicates to Builder.Build that the source contained no data, and
|
|
|
|
// it can be skipped.
|
|
|
|
var ErrNoData = fmt.Errorf("config source contained no data")
|
|
|
|
|
|
|
|
// FileSource implements Source and parses a config from a file.
|
|
|
|
type FileSource struct {
|
2017-09-25 18:40:42 +00:00
|
|
|
Name string
|
|
|
|
Format string
|
|
|
|
Data string
|
|
|
|
}
|
|
|
|
|
2020-08-10 16:46:28 +00:00
|
|
|
func (f FileSource) Source() string {
|
|
|
|
return f.Name
|
|
|
|
}
|
|
|
|
|
|
|
|
// Parse a config file in either JSON or HCL format.
|
2020-12-22 19:19:34 +00:00
|
|
|
func (f FileSource) Parse() (Config, Metadata, error) {
|
|
|
|
m := Metadata{}
|
2020-08-10 16:46:28 +00:00
|
|
|
if f.Name == "" || f.Data == "" {
|
2020-12-22 19:19:34 +00:00
|
|
|
return Config{}, m, ErrNoData
|
2020-08-10 16:46:28 +00:00
|
|
|
}
|
|
|
|
|
2017-09-25 18:40:42 +00:00
|
|
|
var raw map[string]interface{}
|
2020-08-10 16:46:28 +00:00
|
|
|
var err error
|
|
|
|
var md mapstructure.Metadata
|
|
|
|
switch f.Format {
|
2017-09-25 18:40:42 +00:00
|
|
|
case "json":
|
2020-08-10 16:46:28 +00:00
|
|
|
err = json.Unmarshal([]byte(f.Data), &raw)
|
2017-09-25 18:40:42 +00:00
|
|
|
case "hcl":
|
2020-08-10 16:46:28 +00:00
|
|
|
err = hcl.Decode(&raw, f.Data)
|
2017-09-25 18:40:42 +00:00
|
|
|
default:
|
2020-08-10 16:46:28 +00:00
|
|
|
err = fmt.Errorf("invalid format: %s", f.Format)
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
|
|
|
if err != nil {
|
2020-12-22 19:19:34 +00:00
|
|
|
return Config{}, m, err
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
|
|
|
|
2020-12-22 19:19:34 +00:00
|
|
|
var target decodeTarget
|
2017-09-25 18:40:42 +00:00
|
|
|
d, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{
|
2020-05-27 17:02:22 +00:00
|
|
|
DecodeHook: mapstructure.ComposeDecodeHookFunc(
|
|
|
|
// decode.HookWeakDecodeFromSlice is only necessary when reading from
|
|
|
|
// an HCL config file. In the future we could omit it when reading from
|
|
|
|
// JSON configs. It is left here for now to maintain backwards compat
|
|
|
|
// for the unlikely scenario that someone is using malformed JSON configs
|
|
|
|
// and expecting this behaviour to correct their config.
|
|
|
|
decode.HookWeakDecodeFromSlice,
|
|
|
|
decode.HookTranslateKeys,
|
|
|
|
),
|
|
|
|
Metadata: &md,
|
2020-12-22 19:19:34 +00:00
|
|
|
Result: &target,
|
2017-09-25 18:40:42 +00:00
|
|
|
})
|
|
|
|
if err != nil {
|
2020-12-22 19:19:34 +00:00
|
|
|
return Config{}, m, err
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
2020-05-27 17:02:22 +00:00
|
|
|
if err := d.Decode(raw); err != nil {
|
2020-12-22 19:19:34 +00:00
|
|
|
return Config{}, m, err
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
2019-07-12 17:20:30 +00:00
|
|
|
|
2020-12-22 19:19:34 +00:00
|
|
|
c, warns := applyDeprecatedConfig(&target)
|
|
|
|
m.Unused = md.Unused
|
|
|
|
m.Keys = md.Keys
|
|
|
|
m.Warnings = warns
|
|
|
|
return c, m, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Metadata created by Source.Parse
|
|
|
|
type Metadata struct {
|
|
|
|
// Keys used in the config file.
|
|
|
|
Keys []string
|
|
|
|
// Unused keys that did not match any struct fields.
|
|
|
|
Unused []string
|
|
|
|
// Warnings caused by deprecated fields
|
|
|
|
Warnings []string
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
|
|
|
|
2020-08-10 17:03:33 +00:00
|
|
|
// LiteralSource implements Source and returns an existing Config struct.
|
|
|
|
type LiteralSource struct {
|
|
|
|
Name string
|
|
|
|
Config Config
|
|
|
|
}
|
|
|
|
|
|
|
|
func (l LiteralSource) Source() string {
|
|
|
|
return l.Name
|
|
|
|
}
|
|
|
|
|
2020-12-22 19:19:34 +00:00
|
|
|
func (l LiteralSource) Parse() (Config, Metadata, error) {
|
|
|
|
return l.Config, Metadata{}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type decodeTarget struct {
|
|
|
|
DeprecatedConfig `mapstructure:",squash"`
|
|
|
|
Config `mapstructure:",squash"`
|
2020-08-10 17:03:33 +00:00
|
|
|
}
|
|
|
|
|
2020-10-05 21:31:35 +00:00
|
|
|
// Cache configuration for the agent/cache.
|
2020-07-27 21:11:11 +00:00
|
|
|
type Cache struct {
|
|
|
|
// EntryFetchMaxBurst max burst size of RateLimit for a single cache entry
|
2020-11-20 22:48:39 +00:00
|
|
|
EntryFetchMaxBurst *int `mapstructure:"entry_fetch_max_burst"`
|
2020-07-27 21:11:11 +00:00
|
|
|
// EntryFetchRate represents the max calls/sec for a single cache entry
|
2020-11-20 22:48:39 +00:00
|
|
|
EntryFetchRate *float64 `mapstructure:"entry_fetch_rate"`
|
2020-07-27 21:11:11 +00:00
|
|
|
}
|
|
|
|
|
2017-09-25 18:40:42 +00:00
|
|
|
// Config defines the format of a configuration file in either JSON or
|
|
|
|
// HCL format.
|
|
|
|
//
|
|
|
|
// It must contain only pointer values, slices and maps to support
|
|
|
|
// standardized merging of multiple Config structs into one.
|
|
|
|
//
|
|
|
|
// Since this is the format which users use to specify their
|
|
|
|
// configuration it should be treated as an external API which cannot be
|
|
|
|
// changed and refactored at will since this will break existing setups.
|
|
|
|
type Config struct {
|
2022-11-01 19:03:23 +00:00
|
|
|
ACL ACL `mapstructure:"acl" json:"-"`
|
|
|
|
Addresses Addresses `mapstructure:"addresses" json:"-"`
|
|
|
|
AdvertiseAddrLAN *string `mapstructure:"advertise_addr" json:"advertise_addr,omitempty"`
|
|
|
|
AdvertiseAddrLANIPv4 *string `mapstructure:"advertise_addr_ipv4" json:"advertise_addr_ipv4,omitempty"`
|
|
|
|
AdvertiseAddrLANIPv6 *string `mapstructure:"advertise_addr_ipv6" json:"advertise_addr_ipv6,omitempty"`
|
|
|
|
AdvertiseAddrWAN *string `mapstructure:"advertise_addr_wan" json:"advertise_addr_wan,omitempty"`
|
|
|
|
AdvertiseAddrWANIPv4 *string `mapstructure:"advertise_addr_wan_ipv4" json:"advertise_addr_wan_ipv4,omitempty"`
|
|
|
|
AdvertiseAddrWANIPv6 *string `mapstructure:"advertise_addr_wan_ipv6" json:"advertise_addr_wan_ipv6,omitempty"`
|
|
|
|
AdvertiseReconnectTimeout *string `mapstructure:"advertise_reconnect_timeout" json:"-"`
|
|
|
|
AutoConfig AutoConfigRaw `mapstructure:"auto_config" json:"-"`
|
|
|
|
Autopilot Autopilot `mapstructure:"autopilot" json:"-"`
|
|
|
|
BindAddr *string `mapstructure:"bind_addr" json:"bind_addr,omitempty"`
|
|
|
|
Bootstrap *bool `mapstructure:"bootstrap" json:"bootstrap,omitempty"`
|
|
|
|
BootstrapExpect *int `mapstructure:"bootstrap_expect" json:"bootstrap_expect,omitempty"`
|
|
|
|
Cache Cache `mapstructure:"cache" json:"-"`
|
|
|
|
Check *CheckDefinition `mapstructure:"check" json:"-"` // needs to be a pointer to avoid partial merges
|
|
|
|
CheckOutputMaxSize *int `mapstructure:"check_output_max_size" json:"check_output_max_size,omitempty"`
|
|
|
|
CheckUpdateInterval *string `mapstructure:"check_update_interval" json:"check_update_interval,omitempty"`
|
|
|
|
Checks []CheckDefinition `mapstructure:"checks" json:"-"`
|
|
|
|
ClientAddr *string `mapstructure:"client_addr" json:"client_addr,omitempty"`
|
|
|
|
Cloud *CloudConfigRaw `mapstructure:"cloud" json:"-"`
|
|
|
|
ConfigEntries ConfigEntries `mapstructure:"config_entries" json:"-"`
|
|
|
|
AutoEncrypt AutoEncrypt `mapstructure:"auto_encrypt" json:"auto_encrypt,omitempty"`
|
|
|
|
Connect Connect `mapstructure:"connect" json:"connect,omitempty"`
|
|
|
|
DNS DNS `mapstructure:"dns_config" json:"-"`
|
|
|
|
DNSDomain *string `mapstructure:"domain" json:"domain,omitempty"`
|
|
|
|
DNSAltDomain *string `mapstructure:"alt_domain" json:"alt_domain,omitempty"`
|
|
|
|
DNSRecursors []string `mapstructure:"recursors" json:"recursors,omitempty"`
|
|
|
|
DataDir *string `mapstructure:"data_dir" json:"data_dir,omitempty"`
|
|
|
|
Datacenter *string `mapstructure:"datacenter" json:"datacenter,omitempty"`
|
|
|
|
DefaultQueryTime *string `mapstructure:"default_query_time" json:"default_query_time,omitempty"`
|
|
|
|
DisableAnonymousSignature *bool `mapstructure:"disable_anonymous_signature" json:"disable_anonymous_signature,omitempty"`
|
|
|
|
DisableCoordinates *bool `mapstructure:"disable_coordinates" json:"disable_coordinates,omitempty"`
|
|
|
|
DisableHostNodeID *bool `mapstructure:"disable_host_node_id" json:"disable_host_node_id,omitempty"`
|
|
|
|
DisableHTTPUnprintableCharFilter *bool `mapstructure:"disable_http_unprintable_char_filter" json:"disable_http_unprintable_char_filter,omitempty"`
|
|
|
|
DisableKeyringFile *bool `mapstructure:"disable_keyring_file" json:"disable_keyring_file,omitempty"`
|
|
|
|
DisableRemoteExec *bool `mapstructure:"disable_remote_exec" json:"disable_remote_exec,omitempty"`
|
|
|
|
DisableUpdateCheck *bool `mapstructure:"disable_update_check" json:"disable_update_check,omitempty"`
|
|
|
|
DiscardCheckOutput *bool `mapstructure:"discard_check_output" json:"discard_check_output,omitempty"`
|
|
|
|
DiscoveryMaxStale *string `mapstructure:"discovery_max_stale" json:"discovery_max_stale,omitempty"`
|
|
|
|
EnableAgentTLSForChecks *bool `mapstructure:"enable_agent_tls_for_checks" json:"enable_agent_tls_for_checks,omitempty"`
|
|
|
|
EnableCentralServiceConfig *bool `mapstructure:"enable_central_service_config" json:"enable_central_service_config,omitempty"`
|
|
|
|
EnableDebug *bool `mapstructure:"enable_debug" json:"enable_debug,omitempty"`
|
|
|
|
EnableScriptChecks *bool `mapstructure:"enable_script_checks" json:"enable_script_checks,omitempty"`
|
|
|
|
EnableLocalScriptChecks *bool `mapstructure:"enable_local_script_checks" json:"enable_local_script_checks,omitempty"`
|
|
|
|
EnableSyslog *bool `mapstructure:"enable_syslog" json:"enable_syslog,omitempty"`
|
|
|
|
EncryptKey *string `mapstructure:"encrypt" json:"encrypt,omitempty"`
|
|
|
|
EncryptVerifyIncoming *bool `mapstructure:"encrypt_verify_incoming" json:"encrypt_verify_incoming,omitempty"`
|
|
|
|
EncryptVerifyOutgoing *bool `mapstructure:"encrypt_verify_outgoing" json:"encrypt_verify_outgoing,omitempty"`
|
2023-06-12 15:32:43 +00:00
|
|
|
Experiments []string `mapstructure:"experiments" json:"experiments,omitempty"`
|
2022-11-01 19:03:23 +00:00
|
|
|
GossipLAN GossipLANConfig `mapstructure:"gossip_lan" json:"-"`
|
|
|
|
GossipWAN GossipWANConfig `mapstructure:"gossip_wan" json:"-"`
|
|
|
|
HTTPConfig HTTPConfig `mapstructure:"http_config" json:"-"`
|
|
|
|
LeaveOnTerm *bool `mapstructure:"leave_on_terminate" json:"leave_on_terminate,omitempty"`
|
|
|
|
LicensePath *string `mapstructure:"license_path" json:"license_path,omitempty"`
|
|
|
|
Limits Limits `mapstructure:"limits" json:"-"`
|
2023-03-10 14:36:15 +00:00
|
|
|
Locality *Locality `mapstructure:"locality" json:"-"`
|
2022-11-01 19:03:23 +00:00
|
|
|
LogLevel *string `mapstructure:"log_level" json:"log_level,omitempty"`
|
|
|
|
LogJSON *bool `mapstructure:"log_json" json:"log_json,omitempty"`
|
|
|
|
LogFile *string `mapstructure:"log_file" json:"log_file,omitempty"`
|
|
|
|
LogRotateDuration *string `mapstructure:"log_rotate_duration" json:"log_rotate_duration,omitempty"`
|
|
|
|
LogRotateBytes *int `mapstructure:"log_rotate_bytes" json:"log_rotate_bytes,omitempty"`
|
|
|
|
LogRotateMaxFiles *int `mapstructure:"log_rotate_max_files" json:"log_rotate_max_files,omitempty"`
|
|
|
|
MaxQueryTime *string `mapstructure:"max_query_time" json:"max_query_time,omitempty"`
|
|
|
|
NodeID *string `mapstructure:"node_id" json:"node_id,omitempty"`
|
|
|
|
NodeMeta map[string]string `mapstructure:"node_meta" json:"node_meta,omitempty"`
|
|
|
|
NodeName *string `mapstructure:"node_name" json:"node_name,omitempty"`
|
2022-12-01 15:39:09 +00:00
|
|
|
Peering Peering `mapstructure:"peering" json:"-"`
|
2022-11-01 19:03:23 +00:00
|
|
|
Performance Performance `mapstructure:"performance" json:"-"`
|
|
|
|
PidFile *string `mapstructure:"pid_file" json:"pid_file,omitempty"`
|
|
|
|
Ports Ports `mapstructure:"ports" json:"ports,omitempty"`
|
|
|
|
PrimaryDatacenter *string `mapstructure:"primary_datacenter" json:"primary_datacenter,omitempty"`
|
|
|
|
PrimaryGateways []string `mapstructure:"primary_gateways" json:"primary_gateways,omitempty"`
|
|
|
|
PrimaryGatewaysInterval *string `mapstructure:"primary_gateways_interval" json:"primary_gateways_interval,omitempty"`
|
|
|
|
RPCProtocol *int `mapstructure:"protocol" json:"protocol,omitempty"`
|
|
|
|
RaftProtocol *int `mapstructure:"raft_protocol" json:"raft_protocol,omitempty"`
|
|
|
|
RaftSnapshotThreshold *int `mapstructure:"raft_snapshot_threshold" json:"raft_snapshot_threshold,omitempty"`
|
|
|
|
RaftSnapshotInterval *string `mapstructure:"raft_snapshot_interval" json:"raft_snapshot_interval,omitempty"`
|
|
|
|
RaftTrailingLogs *int `mapstructure:"raft_trailing_logs" json:"raft_trailing_logs,omitempty"`
|
|
|
|
ReconnectTimeoutLAN *string `mapstructure:"reconnect_timeout" json:"reconnect_timeout,omitempty"`
|
|
|
|
ReconnectTimeoutWAN *string `mapstructure:"reconnect_timeout_wan" json:"reconnect_timeout_wan,omitempty"`
|
|
|
|
RejoinAfterLeave *bool `mapstructure:"rejoin_after_leave" json:"rejoin_after_leave,omitempty"`
|
|
|
|
AutoReloadConfig *bool `mapstructure:"auto_reload_config" json:"auto_reload_config,omitempty"`
|
|
|
|
RetryJoinIntervalLAN *string `mapstructure:"retry_interval" json:"retry_interval,omitempty"`
|
|
|
|
RetryJoinIntervalWAN *string `mapstructure:"retry_interval_wan" json:"retry_interval_wan,omitempty"`
|
|
|
|
RetryJoinLAN []string `mapstructure:"retry_join" json:"retry_join,omitempty"`
|
|
|
|
RetryJoinMaxAttemptsLAN *int `mapstructure:"retry_max" json:"retry_max,omitempty"`
|
|
|
|
RetryJoinMaxAttemptsWAN *int `mapstructure:"retry_max_wan" json:"retry_max_wan,omitempty"`
|
|
|
|
RetryJoinWAN []string `mapstructure:"retry_join_wan" json:"retry_join_wan,omitempty"`
|
|
|
|
SerfAllowedCIDRsLAN []string `mapstructure:"serf_lan_allowed_cidrs" json:"serf_lan_allowed_cidrs,omitempty"`
|
|
|
|
SerfAllowedCIDRsWAN []string `mapstructure:"serf_wan_allowed_cidrs" json:"serf_wan_allowed_cidrs,omitempty"`
|
|
|
|
SerfBindAddrLAN *string `mapstructure:"serf_lan" json:"serf_lan,omitempty"`
|
|
|
|
SerfBindAddrWAN *string `mapstructure:"serf_wan" json:"serf_wan,omitempty"`
|
|
|
|
ServerMode *bool `mapstructure:"server" json:"server,omitempty"`
|
|
|
|
ServerName *string `mapstructure:"server_name" json:"server_name,omitempty"`
|
2023-05-15 11:05:47 +00:00
|
|
|
ServerRejoinAgeMax *string `mapstructure:"server_rejoin_age_max" json:"server_rejoin_age_max,omitempty"`
|
2022-11-01 19:03:23 +00:00
|
|
|
Service *ServiceDefinition `mapstructure:"service" json:"-"`
|
|
|
|
Services []ServiceDefinition `mapstructure:"services" json:"-"`
|
|
|
|
SessionTTLMin *string `mapstructure:"session_ttl_min" json:"session_ttl_min,omitempty"`
|
|
|
|
SkipLeaveOnInt *bool `mapstructure:"skip_leave_on_interrupt" json:"skip_leave_on_interrupt,omitempty"`
|
|
|
|
SyslogFacility *string `mapstructure:"syslog_facility" json:"syslog_facility,omitempty"`
|
|
|
|
TLS TLS `mapstructure:"tls" json:"tls,omitempty"`
|
|
|
|
TaggedAddresses map[string]string `mapstructure:"tagged_addresses" json:"tagged_addresses,omitempty"`
|
|
|
|
Telemetry Telemetry `mapstructure:"telemetry" json:"telemetry,omitempty"`
|
|
|
|
TranslateWANAddrs *bool `mapstructure:"translate_wan_addrs" json:"translate_wan_addrs,omitempty"`
|
|
|
|
XDS XDS `mapstructure:"xds" json:"-"`
|
2020-09-10 16:25:56 +00:00
|
|
|
|
|
|
|
// DEPRECATED (ui-config) - moved to the ui_config stanza
|
2022-11-01 19:03:23 +00:00
|
|
|
UI *bool `mapstructure:"ui" json:"-"`
|
2020-09-10 16:25:56 +00:00
|
|
|
// DEPRECATED (ui-config) - moved to the ui_config stanza
|
2022-11-01 19:03:23 +00:00
|
|
|
UIContentPath *string `mapstructure:"ui_content_path" json:"-"`
|
2020-09-10 16:25:56 +00:00
|
|
|
// DEPRECATED (ui-config) - moved to the ui_config stanza
|
2022-11-01 19:03:23 +00:00
|
|
|
UIDir *string `mapstructure:"ui_dir" json:"-"`
|
|
|
|
UIConfig RawUIConfig `mapstructure:"ui_config" json:"-"`
|
2020-09-10 16:25:56 +00:00
|
|
|
|
2022-11-01 19:03:23 +00:00
|
|
|
UnixSocket UnixSocket `mapstructure:"unix_sockets" json:"-"`
|
|
|
|
Watches []map[string]interface{} `mapstructure:"watches" json:"-"`
|
2017-09-25 18:40:42 +00:00
|
|
|
|
2022-11-01 19:03:23 +00:00
|
|
|
RPC RPC `mapstructure:"rpc" json:"-"`
|
2020-10-05 20:28:13 +00:00
|
|
|
|
2023-02-08 16:50:22 +00:00
|
|
|
RaftLogStore RaftLogStoreRaw `mapstructure:"raft_logstore" json:"raft_logstore,omitempty"`
|
2021-11-17 23:15:19 +00:00
|
|
|
|
2020-10-23 21:47:01 +00:00
|
|
|
// UseStreamingBackend instead of blocking queries for service health and
|
|
|
|
// any other endpoints which support streaming.
|
2022-11-01 19:03:23 +00:00
|
|
|
UseStreamingBackend *bool `mapstructure:"use_streaming_backend" json:"-"`
|
2020-10-23 21:47:01 +00:00
|
|
|
|
2017-11-10 21:50:45 +00:00
|
|
|
// This isn't used by Consul but we've documented a feature where users
|
|
|
|
// can deploy their snapshot agent configs alongside their Consul configs
|
|
|
|
// so we have a placeholder here so it can be parsed but this doesn't
|
|
|
|
// manifest itself in any way inside the runtime config.
|
2022-11-01 19:03:23 +00:00
|
|
|
SnapshotAgent map[string]interface{} `mapstructure:"snapshot_agent" json:"-"`
|
2017-11-10 21:50:45 +00:00
|
|
|
|
2017-09-25 18:40:42 +00:00
|
|
|
// non-user configurable values
|
2022-11-01 19:03:23 +00:00
|
|
|
AEInterval *string `mapstructure:"ae_interval" json:"-"`
|
|
|
|
CheckDeregisterIntervalMin *string `mapstructure:"check_deregister_interval_min" json:"-"`
|
|
|
|
CheckReapInterval *string `mapstructure:"check_reap_interval" json:"-"`
|
|
|
|
Consul Consul `mapstructure:"consul" json:"-"`
|
|
|
|
Revision *string `mapstructure:"revision" json:"-"`
|
|
|
|
SegmentLimit *int `mapstructure:"segment_limit" json:"-"`
|
|
|
|
SegmentNameLimit *int `mapstructure:"segment_name_limit" json:"-"`
|
|
|
|
SyncCoordinateIntervalMin *string `mapstructure:"sync_coordinate_interval_min" json:"-"`
|
|
|
|
SyncCoordinateRateTarget *float64 `mapstructure:"sync_coordinate_rate_target" json:"-"`
|
|
|
|
Version *string `mapstructure:"version" json:"-"`
|
|
|
|
VersionPrerelease *string `mapstructure:"version_prerelease" json:"-"`
|
|
|
|
VersionMetadata *string `mapstructure:"version_metadata" json:"-"`
|
|
|
|
BuildDate *time.Time `mapstructure:"build_date" json:"-"`
|
2020-04-17 20:27:39 +00:00
|
|
|
|
2020-05-11 20:27:35 +00:00
|
|
|
// Enterprise Only
|
2022-11-01 19:03:23 +00:00
|
|
|
Audit Audit `mapstructure:"audit" json:"-"`
|
2020-04-28 13:45:33 +00:00
|
|
|
// Enterprise Only
|
2022-11-01 19:03:23 +00:00
|
|
|
ReadReplica *bool `mapstructure:"read_replica" alias:"non_voting_server" json:"-"`
|
2020-04-28 13:45:33 +00:00
|
|
|
// Enterprise Only
|
2022-11-01 19:03:23 +00:00
|
|
|
SegmentName *string `mapstructure:"segment" json:"-"`
|
2020-04-28 13:45:33 +00:00
|
|
|
// Enterprise Only
|
2022-11-01 19:03:23 +00:00
|
|
|
Segments []Segment `mapstructure:"segments" json:"-"`
|
2021-07-08 15:03:38 +00:00
|
|
|
// Enterprise Only
|
2022-11-01 19:03:23 +00:00
|
|
|
Partition *string `mapstructure:"partition" json:"-"`
|
2021-05-20 14:07:23 +00:00
|
|
|
|
|
|
|
// Enterprise Only - not user configurable
|
2022-11-01 19:03:23 +00:00
|
|
|
LicensePollBaseTime *string `mapstructure:"license_poll_base_time" json:"-"`
|
|
|
|
LicensePollMaxTime *string `mapstructure:"license_poll_max_time" json:"-"`
|
|
|
|
LicenseUpdateBaseTime *string `mapstructure:"license_update_base_time" json:"-"`
|
|
|
|
LicenseUpdateMaxTime *string `mapstructure:"license_update_max_time" json:"-"`
|
2023-04-11 19:04:02 +00:00
|
|
|
|
|
|
|
// license reporting
|
|
|
|
Reporting Reporting `mapstructure:"reporting" json:"-"`
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
|
|
|
|
2018-07-26 15:39:49 +00:00
|
|
|
type GossipLANConfig struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
GossipNodes *int `mapstructure:"gossip_nodes"`
|
|
|
|
GossipInterval *string `mapstructure:"gossip_interval"`
|
|
|
|
ProbeInterval *string `mapstructure:"probe_interval"`
|
|
|
|
ProbeTimeout *string `mapstructure:"probe_timeout"`
|
|
|
|
SuspicionMult *int `mapstructure:"suspicion_mult"`
|
|
|
|
RetransmitMult *int `mapstructure:"retransmit_mult"`
|
2018-07-26 15:39:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type GossipWANConfig struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
GossipNodes *int `mapstructure:"gossip_nodes"`
|
|
|
|
GossipInterval *string `mapstructure:"gossip_interval"`
|
|
|
|
ProbeInterval *string `mapstructure:"probe_interval"`
|
|
|
|
ProbeTimeout *string `mapstructure:"probe_timeout"`
|
|
|
|
SuspicionMult *int `mapstructure:"suspicion_mult"`
|
|
|
|
RetransmitMult *int `mapstructure:"retransmit_mult"`
|
2018-07-26 15:39:49 +00:00
|
|
|
}
|
|
|
|
|
2023-03-07 19:05:23 +00:00
|
|
|
// Locality identifies where a given entity is running.
|
|
|
|
type Locality struct {
|
|
|
|
// Region is region the zone belongs to.
|
|
|
|
Region *string `mapstructure:"region"`
|
|
|
|
|
|
|
|
// Zone is the zone the entity is running in.
|
|
|
|
Zone *string `mapstructure:"zone"`
|
|
|
|
}
|
|
|
|
|
2017-09-25 18:40:42 +00:00
|
|
|
type Consul struct {
|
|
|
|
Coordinate struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
UpdateBatchSize *int `mapstructure:"update_batch_size"`
|
|
|
|
UpdateMaxBatches *int `mapstructure:"update_max_batches"`
|
|
|
|
UpdatePeriod *string `mapstructure:"update_period"`
|
|
|
|
} `mapstructure:"coordinate"`
|
2017-09-25 18:40:42 +00:00
|
|
|
|
|
|
|
Raft struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
ElectionTimeout *string `mapstructure:"election_timeout"`
|
|
|
|
HeartbeatTimeout *string `mapstructure:"heartbeat_timeout"`
|
|
|
|
LeaderLeaseTimeout *string `mapstructure:"leader_lease_timeout"`
|
|
|
|
} `mapstructure:"raft"`
|
2017-09-25 18:40:42 +00:00
|
|
|
|
|
|
|
Server struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
HealthInterval *string `mapstructure:"health_interval"`
|
|
|
|
} `mapstructure:"server"`
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Addresses struct {
|
2022-08-19 17:07:22 +00:00
|
|
|
DNS *string `mapstructure:"dns"`
|
|
|
|
HTTP *string `mapstructure:"http"`
|
|
|
|
HTTPS *string `mapstructure:"https"`
|
|
|
|
GRPC *string `mapstructure:"grpc"`
|
|
|
|
GRPCTLS *string `mapstructure:"grpc_tls"`
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type AdvertiseAddrsConfig struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
RPC *string `mapstructure:"rpc"`
|
|
|
|
SerfLAN *string `mapstructure:"serf_lan"`
|
|
|
|
SerfWAN *string `mapstructure:"serf_wan"`
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Autopilot struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
CleanupDeadServers *bool `mapstructure:"cleanup_dead_servers"`
|
|
|
|
LastContactThreshold *string `mapstructure:"last_contact_threshold"`
|
|
|
|
MaxTrailingLogs *int `mapstructure:"max_trailing_logs"`
|
|
|
|
MinQuorum *uint `mapstructure:"min_quorum"`
|
|
|
|
ServerStabilizationTime *string `mapstructure:"server_stabilization_time"`
|
2020-04-28 13:45:33 +00:00
|
|
|
|
|
|
|
// Enterprise Only
|
2020-11-20 22:48:39 +00:00
|
|
|
DisableUpgradeMigration *bool `mapstructure:"disable_upgrade_migration"`
|
2020-04-28 13:45:33 +00:00
|
|
|
// Enterprise Only
|
2020-11-20 22:48:39 +00:00
|
|
|
RedundancyZoneTag *string `mapstructure:"redundancy_zone_tag"`
|
2020-04-28 13:45:33 +00:00
|
|
|
// Enterprise Only
|
2020-11-20 22:48:39 +00:00
|
|
|
UpgradeVersionTag *string `mapstructure:"upgrade_version_tag"`
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
|
|
|
|
2018-09-07 14:30:47 +00:00
|
|
|
// ServiceWeights defines the registration of weights used in DNS for a Service
|
|
|
|
type ServiceWeights struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
Passing *int `mapstructure:"passing"`
|
|
|
|
Warning *int `mapstructure:"warning"`
|
2018-09-07 14:30:47 +00:00
|
|
|
}
|
|
|
|
|
2019-06-17 14:51:50 +00:00
|
|
|
type ServiceAddress struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
Address *string `mapstructure:"address"`
|
|
|
|
Port *int `mapstructure:"port"`
|
2019-06-17 14:51:50 +00:00
|
|
|
}
|
|
|
|
|
2017-09-25 18:40:42 +00:00
|
|
|
type ServiceDefinition struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
Kind *string `mapstructure:"kind"`
|
|
|
|
ID *string `mapstructure:"id"`
|
|
|
|
Name *string `mapstructure:"name"`
|
|
|
|
Tags []string `mapstructure:"tags"`
|
|
|
|
Address *string `mapstructure:"address"`
|
|
|
|
TaggedAddresses map[string]ServiceAddress `mapstructure:"tagged_addresses"`
|
|
|
|
Meta map[string]string `mapstructure:"meta"`
|
|
|
|
Port *int `mapstructure:"port"`
|
2021-05-04 04:43:55 +00:00
|
|
|
SocketPath *string `mapstructure:"socket_path"`
|
2020-11-20 22:48:39 +00:00
|
|
|
Check *CheckDefinition `mapstructure:"check"`
|
|
|
|
Checks []CheckDefinition `mapstructure:"checks"`
|
|
|
|
Token *string `mapstructure:"token"`
|
|
|
|
Weights *ServiceWeights `mapstructure:"weights"`
|
|
|
|
EnableTagOverride *bool `mapstructure:"enable_tag_override"`
|
|
|
|
Proxy *ServiceProxy `mapstructure:"proxy"`
|
|
|
|
Connect *ServiceConnect `mapstructure:"connect"`
|
|
|
|
|
|
|
|
EnterpriseMeta `mapstructure:",squash"`
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type CheckDefinition struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
ID *string `mapstructure:"id"`
|
|
|
|
Name *string `mapstructure:"name"`
|
|
|
|
Notes *string `mapstructure:"notes"`
|
|
|
|
ServiceID *string `mapstructure:"service_id" alias:"serviceid"`
|
|
|
|
Token *string `mapstructure:"token"`
|
|
|
|
Status *string `mapstructure:"status"`
|
|
|
|
ScriptArgs []string `mapstructure:"args" alias:"scriptargs"`
|
|
|
|
HTTP *string `mapstructure:"http"`
|
|
|
|
Header map[string][]string `mapstructure:"header"`
|
|
|
|
Method *string `mapstructure:"method"`
|
|
|
|
Body *string `mapstructure:"body"`
|
2022-04-01 21:31:15 +00:00
|
|
|
DisableRedirects *bool `mapstructure:"disable_redirects"`
|
2020-11-20 22:48:39 +00:00
|
|
|
OutputMaxSize *int `mapstructure:"output_max_size"`
|
|
|
|
TCP *string `mapstructure:"tcp"`
|
2023-09-05 20:34:44 +00:00
|
|
|
TCPUseTLS *bool `mapstructure:"tcp_use_tls"`
|
2022-06-06 19:13:19 +00:00
|
|
|
UDP *string `mapstructure:"udp"`
|
2020-11-20 22:48:39 +00:00
|
|
|
Interval *string `mapstructure:"interval"`
|
|
|
|
DockerContainerID *string `mapstructure:"docker_container_id" alias:"dockercontainerid"`
|
|
|
|
Shell *string `mapstructure:"shell"`
|
|
|
|
GRPC *string `mapstructure:"grpc"`
|
|
|
|
GRPCUseTLS *bool `mapstructure:"grpc_use_tls"`
|
2021-02-25 06:35:34 +00:00
|
|
|
TLSServerName *string `mapstructure:"tls_server_name"`
|
2020-11-20 22:48:39 +00:00
|
|
|
TLSSkipVerify *bool `mapstructure:"tls_skip_verify" alias:"tlsskipverify"`
|
|
|
|
AliasNode *string `mapstructure:"alias_node"`
|
|
|
|
AliasService *string `mapstructure:"alias_service"`
|
|
|
|
Timeout *string `mapstructure:"timeout"`
|
|
|
|
TTL *string `mapstructure:"ttl"`
|
2021-04-09 19:12:10 +00:00
|
|
|
H2PING *string `mapstructure:"h2ping"`
|
2021-10-05 01:36:18 +00:00
|
|
|
H2PingUseTLS *bool `mapstructure:"h2ping_use_tls"`
|
2022-06-07 17:27:14 +00:00
|
|
|
OSService *string `mapstructure:"os_service"`
|
2020-11-20 22:48:39 +00:00
|
|
|
SuccessBeforePassing *int `mapstructure:"success_before_passing"`
|
2021-09-14 16:47:52 +00:00
|
|
|
FailuresBeforeWarning *int `mapstructure:"failures_before_warning"`
|
2020-11-20 22:48:39 +00:00
|
|
|
FailuresBeforeCritical *int `mapstructure:"failures_before_critical"`
|
|
|
|
DeregisterCriticalServiceAfter *string `mapstructure:"deregister_critical_service_after" alias:"deregistercriticalserviceafter"`
|
|
|
|
|
|
|
|
EnterpriseMeta `mapstructure:",squash"`
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
|
|
|
|
2018-04-16 15:00:20 +00:00
|
|
|
// ServiceConnect is the connect block within a service registration
|
|
|
|
type ServiceConnect struct {
|
2018-07-25 18:55:41 +00:00
|
|
|
// Native is true when this service can natively understand Connect.
|
2020-11-20 22:48:39 +00:00
|
|
|
Native *bool `mapstructure:"native"`
|
2018-07-25 18:55:41 +00:00
|
|
|
|
2018-09-27 13:33:12 +00:00
|
|
|
// SidecarService is a nested Service Definition to register at the same time.
|
|
|
|
// It's purely a convenience mechanism to allow specifying a sidecar service
|
|
|
|
// along with the application service definition. It's nested nature allows
|
|
|
|
// all of the fields to be defaulted which can reduce the amount of
|
|
|
|
// boilerplate needed to register a sidecar service separately, but the end
|
|
|
|
// result is identical to just making a second service registration via any
|
|
|
|
// other means.
|
2020-11-20 22:48:39 +00:00
|
|
|
SidecarService *ServiceDefinition `mapstructure:"sidecar_service"`
|
2018-04-16 15:00:20 +00:00
|
|
|
}
|
|
|
|
|
2018-09-12 16:07:47 +00:00
|
|
|
// ServiceProxy is the additional config needed for a Kind = connect-proxy
|
|
|
|
// registration.
|
|
|
|
type ServiceProxy struct {
|
|
|
|
// DestinationServiceName is required and is the name of the service to accept
|
|
|
|
// traffic for.
|
2020-11-20 22:48:39 +00:00
|
|
|
DestinationServiceName *string `mapstructure:"destination_service_name"`
|
2018-09-12 16:07:47 +00:00
|
|
|
|
|
|
|
// DestinationServiceID is optional and should only be specified for
|
|
|
|
// "side-car" style proxies where the proxy is in front of just a single
|
|
|
|
// instance of the service. It should be set to the service ID of the instance
|
|
|
|
// being represented which must be registered to the same agent. It's valid to
|
|
|
|
// provide a service ID that does not yet exist to avoid timing issues when
|
|
|
|
// bootstrapping a service with a proxy.
|
2020-11-20 22:48:39 +00:00
|
|
|
DestinationServiceID *string `mapstructure:"destination_service_id"`
|
2018-09-12 16:07:47 +00:00
|
|
|
|
|
|
|
// LocalServiceAddress is the address of the local service instance. It is
|
|
|
|
// optional and should only be specified for "side-car" style proxies. It will
|
|
|
|
// default to 127.0.0.1 if the proxy is a "side-car" (DestinationServiceID is
|
|
|
|
// set) but otherwise will be ignored.
|
2020-11-20 22:48:39 +00:00
|
|
|
LocalServiceAddress *string `mapstructure:"local_service_address"`
|
2018-09-12 16:07:47 +00:00
|
|
|
|
|
|
|
// LocalServicePort is the port of the local service instance. It is optional
|
|
|
|
// and should only be specified for "side-car" style proxies. It will default
|
|
|
|
// to the registered port for the instance if the proxy is a "side-car"
|
|
|
|
// (DestinationServiceID is set) but otherwise will be ignored.
|
2020-11-20 22:48:39 +00:00
|
|
|
LocalServicePort *int `mapstructure:"local_service_port"`
|
2018-09-12 16:07:47 +00:00
|
|
|
|
2021-05-04 04:43:55 +00:00
|
|
|
// LocalServiceSocketPath is the socket of the local service instance. It is optional
|
|
|
|
// and should only be specified for "side-car" style proxies.
|
|
|
|
LocalServiceSocketPath string `mapstructure:"local_service_socket_path"`
|
|
|
|
|
2021-04-12 15:35:14 +00:00
|
|
|
// TransparentProxy configuration.
|
|
|
|
TransparentProxy *TransparentProxyConfig `mapstructure:"transparent_proxy"`
|
|
|
|
|
|
|
|
// Mode represents how the proxy's inbound and upstream listeners are dialed.
|
|
|
|
Mode *string `mapstructure:"mode"`
|
|
|
|
|
2018-09-12 16:07:47 +00:00
|
|
|
// Config is the arbitrary configuration data provided with the proxy
|
|
|
|
// registration.
|
2020-11-20 22:48:39 +00:00
|
|
|
Config map[string]interface{} `mapstructure:"config"`
|
2018-09-12 16:07:47 +00:00
|
|
|
|
|
|
|
// Upstreams describes any upstream dependencies the proxy instance should
|
|
|
|
// setup.
|
2020-11-20 22:48:39 +00:00
|
|
|
Upstreams []Upstream `mapstructure:"upstreams"`
|
2019-07-24 21:01:42 +00:00
|
|
|
|
|
|
|
// Mesh Gateway Configuration
|
2020-11-20 22:48:39 +00:00
|
|
|
MeshGateway *MeshGatewayConfig `mapstructure:"mesh_gateway"`
|
2019-09-26 02:55:52 +00:00
|
|
|
|
|
|
|
// Expose defines whether checks or paths are exposed through the proxy
|
2020-11-20 22:48:39 +00:00
|
|
|
Expose *ExposeConfig `mapstructure:"expose"`
|
2018-09-12 16:07:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Upstream represents a single upstream dependency for a service or proxy. It
|
|
|
|
// describes the mechanism used to discover instances to communicate with (the
|
|
|
|
// Target) as well as any potential client configuration that may be useful such
|
|
|
|
// as load balancer options, timeouts etc.
|
|
|
|
type Upstream struct {
|
|
|
|
// Destination fields are the required ones for determining what this upstream
|
|
|
|
// points to. Depending on DestinationType some other fields below might
|
|
|
|
// further restrict the set of instances allowable.
|
|
|
|
//
|
|
|
|
// DestinationType would be better as an int constant but even with custom
|
|
|
|
// JSON marshallers it causes havoc with all the mapstructure mangling we do
|
|
|
|
// on service definitions in various places.
|
2020-11-20 22:48:39 +00:00
|
|
|
DestinationType *string `mapstructure:"destination_type"`
|
|
|
|
DestinationNamespace *string `mapstructure:"destination_namespace"`
|
2021-08-20 16:57:45 +00:00
|
|
|
DestinationPartition *string `mapstructure:"destination_partition"`
|
2022-04-29 22:12:51 +00:00
|
|
|
DestinationPeer *string `mapstructure:"destination_peer"`
|
2020-11-20 22:48:39 +00:00
|
|
|
DestinationName *string `mapstructure:"destination_name"`
|
2018-09-12 16:07:47 +00:00
|
|
|
|
|
|
|
// Datacenter that the service discovery request should be run against. Note
|
|
|
|
// for prepared queries, the actual results might be from a different
|
|
|
|
// datacenter.
|
2020-11-20 22:48:39 +00:00
|
|
|
Datacenter *string `mapstructure:"datacenter"`
|
2018-09-12 16:07:47 +00:00
|
|
|
|
2021-03-26 19:43:57 +00:00
|
|
|
// It would be worth thinking about a separate structure for these four items,
|
|
|
|
// unifying under address as something like "unix:/tmp/foo", "tcp:localhost:80" could make sense
|
2018-09-12 16:07:47 +00:00
|
|
|
// LocalBindAddress is the ip address a side-car proxy should listen on for
|
2021-03-26 19:43:57 +00:00
|
|
|
// traffic destined for this upstream service. Default if empty and local bind socket
|
|
|
|
// is not present is 127.0.0.1.
|
2020-11-20 22:48:39 +00:00
|
|
|
LocalBindAddress *string `mapstructure:"local_bind_address"`
|
2018-09-12 16:07:47 +00:00
|
|
|
|
|
|
|
// LocalBindPort is the ip address a side-car proxy should listen on for traffic
|
|
|
|
// destined for this upstream service. Required.
|
2020-11-20 22:48:39 +00:00
|
|
|
LocalBindPort *int `mapstructure:"local_bind_port"`
|
2018-09-12 16:07:47 +00:00
|
|
|
|
2021-05-04 04:43:55 +00:00
|
|
|
// These are exclusive with LocalBindAddress/LocalBindPort. These are created under our control.
|
2021-03-26 19:43:57 +00:00
|
|
|
LocalBindSocketPath *string `mapstructure:"local_bind_socket_path"`
|
2021-03-26 20:00:44 +00:00
|
|
|
LocalBindSocketMode *string `mapstructure:"local_bind_socket_mode"`
|
2021-03-26 19:43:57 +00:00
|
|
|
|
2018-09-12 16:07:47 +00:00
|
|
|
// Config is an opaque config that is specific to the proxy process being run.
|
2019-03-06 17:13:28 +00:00
|
|
|
// It can be used to pass arbitrary configuration for this specific upstream
|
2018-09-12 16:07:47 +00:00
|
|
|
// to the proxy.
|
2020-11-20 22:48:39 +00:00
|
|
|
Config map[string]interface{} `mapstructure:"config"`
|
2019-07-24 21:01:42 +00:00
|
|
|
|
|
|
|
// Mesh Gateway Configuration
|
2020-11-20 22:48:39 +00:00
|
|
|
MeshGateway *MeshGatewayConfig `mapstructure:"mesh_gateway"`
|
2019-07-24 21:01:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type MeshGatewayConfig struct {
|
|
|
|
// Mesh Gateway Mode
|
2020-11-20 22:48:39 +00:00
|
|
|
Mode *string `mapstructure:"mode"`
|
2018-04-16 15:00:20 +00:00
|
|
|
}
|
|
|
|
|
2021-04-12 15:35:14 +00:00
|
|
|
type TransparentProxyConfig struct {
|
2021-06-09 20:34:17 +00:00
|
|
|
// The port of the listener where outbound application traffic is being redirected to.
|
2021-04-12 15:35:14 +00:00
|
|
|
OutboundListenerPort *int `mapstructure:"outbound_listener_port"`
|
2021-06-09 20:34:17 +00:00
|
|
|
|
|
|
|
// DialedDirectly indicates whether transparent proxies can dial this proxy instance directly.
|
|
|
|
// The discovery chain is not considered when dialing a service instance directly.
|
|
|
|
// This setting is useful when addressing stateful services, such as a database cluster with a leader node.
|
|
|
|
DialedDirectly *bool `mapstructure:"dialed_directly"`
|
2021-04-12 15:35:14 +00:00
|
|
|
}
|
|
|
|
|
2019-09-26 02:55:52 +00:00
|
|
|
// ExposeConfig describes HTTP paths to expose through Envoy outside of Connect.
|
|
|
|
// Users can expose individual paths and/or all HTTP/GRPC paths for checks.
|
|
|
|
type ExposeConfig struct {
|
|
|
|
// Checks defines whether paths associated with Consul checks will be exposed.
|
|
|
|
// This flag triggers exposing all HTTP and GRPC check paths registered for the service.
|
2020-11-20 22:48:39 +00:00
|
|
|
Checks *bool `mapstructure:"checks"`
|
2019-09-26 02:55:52 +00:00
|
|
|
|
|
|
|
// Port defines the port of the proxy's listener for exposed paths.
|
2020-11-20 22:48:39 +00:00
|
|
|
Port *int `mapstructure:"port"`
|
2019-09-26 02:55:52 +00:00
|
|
|
|
|
|
|
// Paths is the list of paths exposed through the proxy.
|
2020-11-20 22:48:39 +00:00
|
|
|
Paths []ExposePath `mapstructure:"paths"`
|
2019-09-26 02:55:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ExposePath struct {
|
|
|
|
// ListenerPort defines the port of the proxy's listener for exposed paths.
|
2020-11-20 22:48:39 +00:00
|
|
|
ListenerPort *int `mapstructure:"listener_port"`
|
2019-09-26 02:55:52 +00:00
|
|
|
|
|
|
|
// Path is the path to expose through the proxy, ie. "/metrics."
|
2020-11-20 22:48:39 +00:00
|
|
|
Path *string `mapstructure:"path"`
|
2019-09-26 02:55:52 +00:00
|
|
|
|
|
|
|
// Protocol describes the upstream's service protocol.
|
2020-11-20 22:48:39 +00:00
|
|
|
Protocol *string `mapstructure:"protocol"`
|
2019-09-26 02:55:52 +00:00
|
|
|
|
|
|
|
// LocalPathPort is the port that the service is listening on for the given path.
|
2020-11-20 22:48:39 +00:00
|
|
|
LocalPathPort *int `mapstructure:"local_path_port"`
|
2019-09-26 02:55:52 +00:00
|
|
|
}
|
|
|
|
|
2019-06-27 20:22:07 +00:00
|
|
|
// AutoEncrypt is the agent-global auto_encrypt configuration.
|
|
|
|
type AutoEncrypt struct {
|
|
|
|
// TLS enables receiving certificates for clients from servers
|
2022-11-01 19:03:23 +00:00
|
|
|
TLS *bool `mapstructure:"tls" json:"tls,omitempty"`
|
2019-06-27 20:22:07 +00:00
|
|
|
|
2020-01-17 22:25:26 +00:00
|
|
|
// Additional DNS SAN entries that clients request for their certificates.
|
2022-11-01 19:03:23 +00:00
|
|
|
DNSSAN []string `mapstructure:"dns_san" json:"dns_san,omitempty"`
|
2020-01-17 22:25:26 +00:00
|
|
|
|
|
|
|
// Additional IP SAN entries that clients request for their certificates.
|
2022-11-01 19:03:23 +00:00
|
|
|
IPSAN []string `mapstructure:"ip_san" json:"ip_san,omitempty"`
|
2020-01-17 22:25:26 +00:00
|
|
|
|
2019-06-27 20:22:07 +00:00
|
|
|
// AllowTLS enables the RPC endpoint on the server to answer
|
|
|
|
// AutoEncrypt.Sign requests.
|
2022-11-01 19:03:23 +00:00
|
|
|
AllowTLS *bool `mapstructure:"allow_tls" json:"allow_tls,omitempty"`
|
2019-06-27 20:22:07 +00:00
|
|
|
}
|
|
|
|
|
2018-04-16 15:00:20 +00:00
|
|
|
// Connect is the agent-global connect configuration.
|
|
|
|
type Connect struct {
|
|
|
|
// Enabled opts the agent into connect. It should be set on all clients and
|
2018-06-07 09:17:44 +00:00
|
|
|
// servers in a cluster for correct connect operation.
|
2022-11-01 19:03:23 +00:00
|
|
|
Enabled *bool `mapstructure:"enabled" json:"enabled,omitempty"`
|
|
|
|
CAProvider *string `mapstructure:"ca_provider" json:"ca_provider,omitempty"`
|
|
|
|
CAConfig map[string]interface{} `mapstructure:"ca_config" json:"ca_config,omitempty"`
|
|
|
|
MeshGatewayWANFederationEnabled *bool `mapstructure:"enable_mesh_gateway_wan_federation" json:"enable_mesh_gateway_wan_federation,omitempty"`
|
2020-06-10 20:47:35 +00:00
|
|
|
|
2022-08-09 14:36:47 +00:00
|
|
|
// TestCALeafRootChangeSpread controls how long after a CA roots change before new leaf certs will be generated.
|
2020-06-10 20:47:35 +00:00
|
|
|
// This is only tuned in tests, generally set to 1ns to make tests deterministic with when to expect updated leaf
|
|
|
|
// certs by. This configuration is not exposed to users (not documented, and agent/config/default.go will override it)
|
2022-11-01 19:03:23 +00:00
|
|
|
TestCALeafRootChangeSpread *string `mapstructure:"test_ca_leaf_root_change_spread" json:"test_ca_leaf_root_change_spread,omitempty"`
|
2018-04-16 15:00:20 +00:00
|
|
|
}
|
|
|
|
|
Added SOA configuration for DNS settings. (#4714)
This will allow to fine TUNE SOA settings sent by Consul in DNS responses,
for instance to be able to control negative ttl.
Will fix: https://github.com/hashicorp/consul/issues/4713
# Example
Override all settings:
* min_ttl: 0 => 60s
* retry: 600 (10m) => 300s (5 minutes),
* expire: 86400 (24h) => 43200 (12h)
* refresh: 3600 (1h) => 1800 (30 minutes)
```
consul agent -dev -hcl 'dns_config={soa={min_ttl=60,retry=300,expire=43200,refresh=1800}}'
```
Result:
```
dig +multiline @localhost -p 8600 service.consul
; <<>> DiG 9.12.1 <<>> +multiline @localhost -p 8600 service.consul
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 36557
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;service.consul. IN A
;; AUTHORITY SECTION:
consul. 0 IN SOA ns.consul. hostmaster.consul. (
1537959133 ; serial
1800 ; refresh (30 minutes)
300 ; retry (5 minutes)
43200 ; expire (12 hours)
60 ; minimum (1 minute)
)
;; Query time: 4 msec
;; SERVER: 127.0.0.1#8600(127.0.0.1)
;; WHEN: Wed Sep 26 12:52:13 CEST 2018
;; MSG SIZE rcvd: 93
```
2018-10-10 19:50:56 +00:00
|
|
|
// SOA is the configuration of SOA for DNS
|
|
|
|
type SOA struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
Refresh *uint32 `mapstructure:"refresh"`
|
|
|
|
Retry *uint32 `mapstructure:"retry"`
|
|
|
|
Expire *uint32 `mapstructure:"expire"`
|
|
|
|
Minttl *uint32 `mapstructure:"min_ttl"`
|
Added SOA configuration for DNS settings. (#4714)
This will allow to fine TUNE SOA settings sent by Consul in DNS responses,
for instance to be able to control negative ttl.
Will fix: https://github.com/hashicorp/consul/issues/4713
# Example
Override all settings:
* min_ttl: 0 => 60s
* retry: 600 (10m) => 300s (5 minutes),
* expire: 86400 (24h) => 43200 (12h)
* refresh: 3600 (1h) => 1800 (30 minutes)
```
consul agent -dev -hcl 'dns_config={soa={min_ttl=60,retry=300,expire=43200,refresh=1800}}'
```
Result:
```
dig +multiline @localhost -p 8600 service.consul
; <<>> DiG 9.12.1 <<>> +multiline @localhost -p 8600 service.consul
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 36557
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;service.consul. IN A
;; AUTHORITY SECTION:
consul. 0 IN SOA ns.consul. hostmaster.consul. (
1537959133 ; serial
1800 ; refresh (30 minutes)
300 ; retry (5 minutes)
43200 ; expire (12 hours)
60 ; minimum (1 minute)
)
;; Query time: 4 msec
;; SERVER: 127.0.0.1#8600(127.0.0.1)
;; WHEN: Wed Sep 26 12:52:13 CEST 2018
;; MSG SIZE rcvd: 93
```
2018-10-10 19:50:56 +00:00
|
|
|
}
|
|
|
|
|
2017-09-25 18:40:42 +00:00
|
|
|
type DNS struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
AllowStale *bool `mapstructure:"allow_stale"`
|
|
|
|
ARecordLimit *int `mapstructure:"a_record_limit"`
|
|
|
|
DisableCompression *bool `mapstructure:"disable_compression"`
|
|
|
|
EnableTruncate *bool `mapstructure:"enable_truncate"`
|
|
|
|
MaxStale *string `mapstructure:"max_stale"`
|
|
|
|
NodeTTL *string `mapstructure:"node_ttl"`
|
|
|
|
OnlyPassing *bool `mapstructure:"only_passing"`
|
2021-07-19 22:22:51 +00:00
|
|
|
RecursorStrategy *string `mapstructure:"recursor_strategy"`
|
2020-11-20 22:48:39 +00:00
|
|
|
RecursorTimeout *string `mapstructure:"recursor_timeout"`
|
|
|
|
ServiceTTL map[string]string `mapstructure:"service_ttl"`
|
|
|
|
UDPAnswerLimit *int `mapstructure:"udp_answer_limit"`
|
|
|
|
NodeMetaTXT *bool `mapstructure:"enable_additional_node_meta_txt"`
|
|
|
|
SOA *SOA `mapstructure:"soa"`
|
|
|
|
UseCache *bool `mapstructure:"use_cache"`
|
|
|
|
CacheMaxAge *string `mapstructure:"cache_max_age"`
|
2020-04-28 13:45:33 +00:00
|
|
|
|
|
|
|
// Enterprise Only
|
2020-11-20 22:48:39 +00:00
|
|
|
PreferNamespace *bool `mapstructure:"prefer_namespace"`
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type HTTPConfig struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
BlockEndpoints []string `mapstructure:"block_endpoints"`
|
|
|
|
AllowWriteHTTPFrom []string `mapstructure:"allow_write_http_from"`
|
|
|
|
ResponseHeaders map[string]string `mapstructure:"response_headers"`
|
|
|
|
UseCache *bool `mapstructure:"use_cache"`
|
|
|
|
MaxHeaderBytes *int `mapstructure:"max_header_bytes"`
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Performance struct {
|
2023-10-24 13:51:49 +00:00
|
|
|
LeaveDrainTime *string `mapstructure:"leave_drain_time"`
|
|
|
|
RaftMultiplier *int `mapstructure:"raft_multiplier"` // todo(fs): validate as uint
|
|
|
|
RPCHoldTimeout *string `mapstructure:"rpc_hold_timeout"`
|
|
|
|
GRPCKeepaliveInterval *string `mapstructure:"grpc_keepalive_interval"`
|
|
|
|
GRPCKeepaliveTimeout *string `mapstructure:"grpc_keepalive_timeout"`
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Telemetry struct {
|
2022-11-01 19:03:23 +00:00
|
|
|
CirconusAPIApp *string `mapstructure:"circonus_api_app" json:"circonus_api_app,omitempty"`
|
|
|
|
CirconusAPIToken *string `mapstructure:"circonus_api_token" json:"circonus_api_token,omitempty"`
|
|
|
|
CirconusAPIURL *string `mapstructure:"circonus_api_url" json:"circonus_api_url,omitempty"`
|
|
|
|
CirconusBrokerID *string `mapstructure:"circonus_broker_id" json:"circonus_broker_id,omitempty"`
|
|
|
|
CirconusBrokerSelectTag *string `mapstructure:"circonus_broker_select_tag" json:"circonus_broker_select_tag,omitempty"`
|
|
|
|
CirconusCheckDisplayName *string `mapstructure:"circonus_check_display_name" json:"circonus_check_display_name,omitempty"`
|
|
|
|
CirconusCheckForceMetricActivation *string `mapstructure:"circonus_check_force_metric_activation" json:"circonus_check_force_metric_activation,omitempty"`
|
|
|
|
CirconusCheckID *string `mapstructure:"circonus_check_id" json:"circonus_check_id,omitempty"`
|
|
|
|
CirconusCheckInstanceID *string `mapstructure:"circonus_check_instance_id" json:"circonus_check_instance_id,omitempty"`
|
|
|
|
CirconusCheckSearchTag *string `mapstructure:"circonus_check_search_tag" json:"circonus_check_search_tag,omitempty"`
|
|
|
|
CirconusCheckTags *string `mapstructure:"circonus_check_tags" json:"circonus_check_tags,omitempty"`
|
|
|
|
CirconusSubmissionInterval *string `mapstructure:"circonus_submission_interval" json:"circonus_submission_interval,omitempty"`
|
|
|
|
CirconusSubmissionURL *string `mapstructure:"circonus_submission_url" json:"circonus_submission_url,omitempty"`
|
|
|
|
DisableHostname *bool `mapstructure:"disable_hostname" json:"disable_hostname,omitempty"`
|
2023-05-30 18:43:29 +00:00
|
|
|
EnableHostMetrics *bool `mapstructure:"enable_host_metrics" json:"enable_host_metrics,omitempty"`
|
2022-11-01 19:03:23 +00:00
|
|
|
DogstatsdAddr *string `mapstructure:"dogstatsd_addr" json:"dogstatsd_addr,omitempty"`
|
|
|
|
DogstatsdTags []string `mapstructure:"dogstatsd_tags" json:"dogstatsd_tags,omitempty"`
|
|
|
|
RetryFailedConfiguration *bool `mapstructure:"retry_failed_connection" json:"retry_failed_connection,omitempty"`
|
|
|
|
FilterDefault *bool `mapstructure:"filter_default" json:"filter_default,omitempty"`
|
|
|
|
PrefixFilter []string `mapstructure:"prefix_filter" json:"prefix_filter,omitempty"`
|
|
|
|
MetricsPrefix *string `mapstructure:"metrics_prefix" json:"metrics_prefix,omitempty"`
|
|
|
|
PrometheusRetentionTime *string `mapstructure:"prometheus_retention_time" json:"prometheus_retention_time,omitempty"`
|
|
|
|
StatsdAddr *string `mapstructure:"statsd_address" json:"statsd_address,omitempty"`
|
|
|
|
StatsiteAddr *string `mapstructure:"statsite_address" json:"statsite_address,omitempty"`
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Ports struct {
|
2022-11-01 19:03:23 +00:00
|
|
|
DNS *int `mapstructure:"dns" json:"dns,omitempty"`
|
|
|
|
HTTP *int `mapstructure:"http" json:"http,omitempty"`
|
|
|
|
HTTPS *int `mapstructure:"https" json:"https,omitempty"`
|
|
|
|
SerfLAN *int `mapstructure:"serf_lan" json:"serf_lan,omitempty"`
|
|
|
|
SerfWAN *int `mapstructure:"serf_wan" json:"serf_wan,omitempty"`
|
|
|
|
Server *int `mapstructure:"server" json:"server,omitempty"`
|
|
|
|
GRPC *int `mapstructure:"grpc" json:"grpc,omitempty"`
|
|
|
|
GRPCTLS *int `mapstructure:"grpc_tls" json:"grpc_tls,omitempty"`
|
|
|
|
ProxyMinPort *int `mapstructure:"proxy_min_port" json:"proxy_min_port,omitempty"`
|
|
|
|
ProxyMaxPort *int `mapstructure:"proxy_max_port" json:"proxy_max_port,omitempty"`
|
|
|
|
SidecarMinPort *int `mapstructure:"sidecar_min_port" json:"sidecar_min_port,omitempty"`
|
|
|
|
SidecarMaxPort *int `mapstructure:"sidecar_max_port" json:"sidecar_max_port,omitempty"`
|
|
|
|
ExposeMinPort *int `mapstructure:"expose_min_port" json:"expose_min_port,omitempty" `
|
|
|
|
ExposeMaxPort *int `mapstructure:"expose_max_port" json:"expose_max_port,omitempty"`
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type UnixSocket struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
Group *string `mapstructure:"group"`
|
|
|
|
Mode *string `mapstructure:"mode"`
|
|
|
|
User *string `mapstructure:"user"`
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
|
|
|
|
2022-12-13 20:09:55 +00:00
|
|
|
type RequestLimits struct {
|
|
|
|
Mode *string `mapstructure:"mode"`
|
|
|
|
ReadRate *float64 `mapstructure:"read_rate"`
|
|
|
|
WriteRate *float64 `mapstructure:"write_rate"`
|
|
|
|
}
|
|
|
|
|
2017-09-25 18:40:42 +00:00
|
|
|
type Limits struct {
|
2022-12-13 20:09:55 +00:00
|
|
|
HTTPMaxConnsPerClient *int `mapstructure:"http_max_conns_per_client"`
|
|
|
|
HTTPSHandshakeTimeout *string `mapstructure:"https_handshake_timeout"`
|
|
|
|
RequestLimits RequestLimits `mapstructure:"request_limits"`
|
|
|
|
RPCClientTimeout *string `mapstructure:"rpc_client_timeout"`
|
|
|
|
RPCHandshakeTimeout *string `mapstructure:"rpc_handshake_timeout"`
|
|
|
|
RPCMaxBurst *int `mapstructure:"rpc_max_burst"`
|
|
|
|
RPCMaxConnsPerClient *int `mapstructure:"rpc_max_conns_per_client"`
|
|
|
|
RPCRate *float64 `mapstructure:"rpc_rate"`
|
|
|
|
KVMaxValueSize *uint64 `mapstructure:"kv_max_value_size"`
|
|
|
|
TxnMaxReqLen *uint64 `mapstructure:"txn_max_req_len"`
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Segment struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
Advertise *string `mapstructure:"advertise"`
|
|
|
|
Bind *string `mapstructure:"bind"`
|
|
|
|
Name *string `mapstructure:"name"`
|
|
|
|
Port *int `mapstructure:"port"`
|
|
|
|
RPCListener *bool `mapstructure:"rpc_listener"`
|
2017-09-25 18:40:42 +00:00
|
|
|
}
|
2018-10-19 16:04:07 +00:00
|
|
|
|
|
|
|
type ACL struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
Enabled *bool `mapstructure:"enabled"`
|
|
|
|
TokenReplication *bool `mapstructure:"enable_token_replication"`
|
|
|
|
PolicyTTL *string `mapstructure:"policy_ttl"`
|
|
|
|
RoleTTL *string `mapstructure:"role_ttl"`
|
|
|
|
TokenTTL *string `mapstructure:"token_ttl"`
|
|
|
|
DownPolicy *string `mapstructure:"down_policy"`
|
|
|
|
DefaultPolicy *string `mapstructure:"default_policy"`
|
|
|
|
EnableKeyListPolicy *bool `mapstructure:"enable_key_list_policy"`
|
|
|
|
Tokens Tokens `mapstructure:"tokens"`
|
|
|
|
EnableTokenPersistence *bool `mapstructure:"enable_token_persistence"`
|
2020-04-28 13:45:33 +00:00
|
|
|
|
|
|
|
// Enterprise Only
|
2020-11-20 22:48:39 +00:00
|
|
|
MSPDisableBootstrap *bool `mapstructure:"msp_disable_bootstrap"`
|
2018-10-19 16:04:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Tokens struct {
|
2023-01-10 16:24:02 +00:00
|
|
|
InitialManagement *string `mapstructure:"initial_management"`
|
|
|
|
Replication *string `mapstructure:"replication"`
|
|
|
|
AgentRecovery *string `mapstructure:"agent_recovery"`
|
|
|
|
Default *string `mapstructure:"default"`
|
|
|
|
Agent *string `mapstructure:"agent"`
|
|
|
|
ConfigFileRegistration *string `mapstructure:"config_file_service_registration"`
|
2023-09-20 21:50:06 +00:00
|
|
|
DNS *string `mapstructure:"dns"`
|
2020-04-28 13:45:33 +00:00
|
|
|
|
|
|
|
// Enterprise Only
|
2020-11-20 22:48:39 +00:00
|
|
|
ManagedServiceProvider []ServiceProviderToken `mapstructure:"managed_service_provider"`
|
2021-12-01 21:08:14 +00:00
|
|
|
|
|
|
|
DeprecatedTokens `mapstructure:",squash"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type DeprecatedTokens struct {
|
|
|
|
// DEPRECATED (ACL) - renamed to "initial_management"
|
|
|
|
Master *string `mapstructure:"master"`
|
|
|
|
// DEPRECATED (ACL) - renamed to "agent_recovery"
|
|
|
|
AgentMaster *string `mapstructure:"agent_master"`
|
2020-02-04 20:58:56 +00:00
|
|
|
}
|
|
|
|
|
2020-04-28 13:45:33 +00:00
|
|
|
// ServiceProviderToken groups an accessor and secret for a service provider token. Enterprise Only
|
2020-02-04 20:58:56 +00:00
|
|
|
type ServiceProviderToken struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
AccessorID *string `mapstructure:"accessor_id"`
|
|
|
|
SecretID *string `mapstructure:"secret_id"`
|
2018-10-19 16:04:07 +00:00
|
|
|
}
|
2019-04-26 18:25:03 +00:00
|
|
|
|
|
|
|
type ConfigEntries struct {
|
2019-04-30 14:13:59 +00:00
|
|
|
// Bootstrap is the list of config_entries that should only be persisted to
|
|
|
|
// cluster on initial startup of a new leader if no such config exists
|
|
|
|
// already. The type is map not structs.ConfigEntry for decoding reasons - we
|
|
|
|
// need to figure out the right concrete type before we can decode it
|
|
|
|
// unabiguously.
|
2020-11-20 22:48:39 +00:00
|
|
|
Bootstrap []map[string]interface{} `mapstructure:"bootstrap"`
|
2019-04-26 18:25:03 +00:00
|
|
|
}
|
2020-05-11 20:27:35 +00:00
|
|
|
|
|
|
|
// Audit allows us to enable and define destinations for auditing
|
|
|
|
type Audit struct {
|
2023-06-07 22:35:48 +00:00
|
|
|
Enabled *bool `mapstructure:"enabled"`
|
|
|
|
Sinks map[string]AuditSink `mapstructure:"sink"`
|
|
|
|
RPCEnabled *bool `mapstructure:"rpc_enabled"`
|
2020-05-11 20:27:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// AuditSink can be provided multiple times to define pipelines for auditing
|
|
|
|
type AuditSink struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
Type *string `mapstructure:"type"`
|
|
|
|
Format *string `mapstructure:"format"`
|
|
|
|
Path *string `mapstructure:"path"`
|
|
|
|
DeliveryGuarantee *string `mapstructure:"delivery_guarantee"`
|
2021-07-29 22:44:27 +00:00
|
|
|
Mode *string `mapstructure:"mode"`
|
2020-11-20 22:48:39 +00:00
|
|
|
RotateBytes *int `mapstructure:"rotate_bytes"`
|
|
|
|
RotateDuration *string `mapstructure:"rotate_duration"`
|
|
|
|
RotateMaxFiles *int `mapstructure:"rotate_max_files"`
|
2020-05-11 20:27:35 +00:00
|
|
|
}
|
2020-06-16 19:03:22 +00:00
|
|
|
|
|
|
|
type AutoConfigRaw struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
Enabled *bool `mapstructure:"enabled"`
|
|
|
|
IntroToken *string `mapstructure:"intro_token"`
|
|
|
|
IntroTokenFile *string `mapstructure:"intro_token_file"`
|
|
|
|
ServerAddresses []string `mapstructure:"server_addresses"`
|
|
|
|
DNSSANs []string `mapstructure:"dns_sans"`
|
|
|
|
IPSANs []string `mapstructure:"ip_sans"`
|
|
|
|
Authorization AutoConfigAuthorizationRaw `mapstructure:"authorization"`
|
2020-06-18 15:16:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type AutoConfigAuthorizationRaw struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
Enabled *bool `mapstructure:"enabled"`
|
|
|
|
Static AutoConfigAuthorizerRaw `mapstructure:"static"`
|
2020-06-16 19:03:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type AutoConfigAuthorizerRaw struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
ClaimAssertions []string `mapstructure:"claim_assertions"`
|
|
|
|
AllowReuse *bool `mapstructure:"allow_reuse"`
|
2020-06-16 19:03:22 +00:00
|
|
|
|
|
|
|
// Fields to be shared with the JWT Auth Method
|
2020-11-20 22:48:39 +00:00
|
|
|
JWTSupportedAlgs []string `mapstructure:"jwt_supported_algs"`
|
|
|
|
BoundAudiences []string `mapstructure:"bound_audiences"`
|
|
|
|
ClaimMappings map[string]string `mapstructure:"claim_mappings"`
|
|
|
|
ListClaimMappings map[string]string `mapstructure:"list_claim_mappings"`
|
|
|
|
OIDCDiscoveryURL *string `mapstructure:"oidc_discovery_url"`
|
|
|
|
OIDCDiscoveryCACert *string `mapstructure:"oidc_discovery_ca_cert"`
|
|
|
|
JWKSURL *string `mapstructure:"jwks_url"`
|
|
|
|
JWKSCACert *string `mapstructure:"jwks_ca_cert"`
|
|
|
|
JWTValidationPubKeys []string `mapstructure:"jwt_validation_pub_keys"`
|
|
|
|
BoundIssuer *string `mapstructure:"bound_issuer"`
|
|
|
|
ExpirationLeeway *string `mapstructure:"expiration_leeway"`
|
|
|
|
NotBeforeLeeway *string `mapstructure:"not_before_leeway"`
|
|
|
|
ClockSkewLeeway *string `mapstructure:"clock_skew_leeway"`
|
2020-06-16 19:03:22 +00:00
|
|
|
}
|
2020-09-10 16:25:56 +00:00
|
|
|
|
|
|
|
type RawUIConfig struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
Enabled *bool `mapstructure:"enabled"`
|
|
|
|
Dir *string `mapstructure:"dir"`
|
|
|
|
ContentPath *string `mapstructure:"content_path"`
|
|
|
|
MetricsProvider *string `mapstructure:"metrics_provider"`
|
|
|
|
MetricsProviderFiles []string `mapstructure:"metrics_provider_files"`
|
|
|
|
MetricsProviderOptionsJSON *string `mapstructure:"metrics_provider_options_json"`
|
|
|
|
MetricsProxy RawUIMetricsProxy `mapstructure:"metrics_proxy"`
|
|
|
|
DashboardURLTemplates map[string]string `mapstructure:"dashboard_url_templates"`
|
2020-09-10 16:25:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type RawUIMetricsProxy struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
BaseURL *string `mapstructure:"base_url"`
|
|
|
|
AddHeaders []RawUIMetricsProxyAddHeader `mapstructure:"add_headers"`
|
|
|
|
PathAllowlist []string `mapstructure:"path_allowlist"`
|
2020-09-10 16:25:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type RawUIMetricsProxyAddHeader struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
Name *string `mapstructure:"name"`
|
|
|
|
Value *string `mapstructure:"value"`
|
2020-09-10 16:25:56 +00:00
|
|
|
}
|
2020-10-05 20:28:13 +00:00
|
|
|
|
|
|
|
type RPC struct {
|
2020-11-20 22:48:39 +00:00
|
|
|
EnableStreaming *bool `mapstructure:"enable_streaming"`
|
2020-10-05 20:28:13 +00:00
|
|
|
}
|
2022-03-18 10:46:58 +00:00
|
|
|
|
2022-09-26 18:58:15 +00:00
|
|
|
type CloudConfigRaw struct {
|
|
|
|
ResourceID *string `mapstructure:"resource_id"`
|
|
|
|
ClientID *string `mapstructure:"client_id"`
|
|
|
|
ClientSecret *string `mapstructure:"client_secret"`
|
|
|
|
Hostname *string `mapstructure:"hostname"`
|
|
|
|
AuthURL *string `mapstructure:"auth_url"`
|
2022-10-13 09:31:28 +00:00
|
|
|
ScadaAddress *string `mapstructure:"scada_address"`
|
2022-09-26 18:58:15 +00:00
|
|
|
}
|
|
|
|
|
2022-03-18 10:46:58 +00:00
|
|
|
type TLSProtocolConfig struct {
|
2022-11-01 19:03:23 +00:00
|
|
|
CAFile *string `mapstructure:"ca_file" json:"ca_file,omitempty"`
|
|
|
|
CAPath *string `mapstructure:"ca_path" json:"ca_path,omitempty"`
|
|
|
|
CertFile *string `mapstructure:"cert_file" json:"cert_file,omitempty"`
|
|
|
|
KeyFile *string `mapstructure:"key_file" json:"key_file,omitempty"`
|
|
|
|
TLSMinVersion *string `mapstructure:"tls_min_version" json:"tls_min_version,omitempty"`
|
|
|
|
TLSCipherSuites *string `mapstructure:"tls_cipher_suites" json:"tls_cipher_suites,omitempty"`
|
|
|
|
VerifyIncoming *bool `mapstructure:"verify_incoming" json:"verify_incoming,omitempty"`
|
|
|
|
VerifyOutgoing *bool `mapstructure:"verify_outgoing" json:"verify_outgoing,omitempty"`
|
|
|
|
VerifyServerHostname *bool `mapstructure:"verify_server_hostname" json:"verify_server_hostname,omitempty"`
|
|
|
|
UseAutoCert *bool `mapstructure:"use_auto_cert" json:"use_auto_cert,omitempty"`
|
2022-03-18 10:46:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type TLS struct {
|
2022-11-01 19:03:23 +00:00
|
|
|
Defaults TLSProtocolConfig `mapstructure:"defaults" json:"defaults,omitempty"`
|
|
|
|
InternalRPC TLSProtocolConfig `mapstructure:"internal_rpc" json:"internal_rpc,omitempty"`
|
|
|
|
HTTPS TLSProtocolConfig `mapstructure:"https" json:"https,omitempty"`
|
|
|
|
GRPC TLSProtocolConfig `mapstructure:"grpc" json:"grpc,omitempty"`
|
2022-05-18 15:15:57 +00:00
|
|
|
|
|
|
|
// GRPCModifiedByDeprecatedConfig is a flag used to indicate that GRPC was
|
|
|
|
// modified by the deprecated field mapping (as apposed to a user-provided
|
|
|
|
// a grpc stanza). This prevents us from emitting a warning about an
|
|
|
|
// ineffectual grpc stanza when we modify GRPC to honor the legacy behaviour
|
|
|
|
// that setting `verify_incoming = true` at the top-level *does not* enable
|
|
|
|
// client certificate verification on the gRPC port.
|
|
|
|
//
|
|
|
|
// See: applyDeprecatedTLSConfig.
|
|
|
|
//
|
|
|
|
// Note: we use a *struct{} here because a simple bool isn't supported by our
|
|
|
|
// config merging logic.
|
2022-11-01 19:03:23 +00:00
|
|
|
GRPCModifiedByDeprecatedConfig *struct{} `mapstructure:"-" json:"-"`
|
2022-03-18 10:46:58 +00:00
|
|
|
}
|
2022-07-22 22:20:21 +00:00
|
|
|
|
|
|
|
type Peering struct {
|
2022-11-01 19:03:23 +00:00
|
|
|
Enabled *bool `mapstructure:"enabled" json:"enabled,omitempty"`
|
2022-07-29 21:36:22 +00:00
|
|
|
|
|
|
|
// TestAllowPeerRegistrations controls whether CatalogRegister endpoints allow registrations for objects with `PeerName`
|
|
|
|
// This always gets overridden in NonUserSource()
|
2022-11-01 19:03:23 +00:00
|
|
|
TestAllowPeerRegistrations *bool `mapstructure:"test_allow_peer_registrations" json:"test_allow_peer_registrations,omitempty"`
|
2022-07-22 22:20:21 +00:00
|
|
|
}
|
2022-10-14 14:52:00 +00:00
|
|
|
|
|
|
|
type XDS struct {
|
|
|
|
UpdateMaxPerSecond *float64 `mapstructure:"update_max_per_second"`
|
|
|
|
}
|
2023-02-08 16:50:22 +00:00
|
|
|
|
|
|
|
type RaftLogStoreRaw struct {
|
|
|
|
Backend *string `mapstructure:"backend" json:"backend,omitempty"`
|
|
|
|
DisableLogCache *bool `mapstructure:"disable_log_cache" json:"disable_log_cache,omitempty"`
|
|
|
|
|
|
|
|
Verification RaftLogStoreVerificationRaw `mapstructure:"verification" json:"verification,omitempty"`
|
|
|
|
|
|
|
|
BoltDBConfig RaftBoltDBConfigRaw `mapstructure:"boltdb" json:"boltdb,omitempty"`
|
|
|
|
|
|
|
|
WALConfig RaftWALConfigRaw `mapstructure:"wal" json:"wal,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type RaftLogStoreVerificationRaw struct {
|
|
|
|
Enabled *bool `mapstructure:"enabled" json:"enabled,omitempty"`
|
|
|
|
Interval *string `mapstructure:"interval" json:"interval,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type RaftBoltDBConfigRaw struct {
|
|
|
|
NoFreelistSync *bool `mapstructure:"no_freelist_sync" json:"no_freelist_sync,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type RaftWALConfigRaw struct {
|
|
|
|
SegmentSizeMB *int `mapstructure:"segment_size_mb" json:"segment_size_mb,omitempty"`
|
|
|
|
}
|
2023-04-11 19:04:02 +00:00
|
|
|
|
|
|
|
type License struct {
|
|
|
|
Enabled *bool `mapstructure:"enabled"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Reporting struct {
|
|
|
|
License License `mapstructure:"license"`
|
|
|
|
}
|