Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: consume common config #4335

Merged
merged 2 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 2 additions & 57 deletions cmd/core-command/res/configuration.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
[Writable]
LogLevel = "INFO"
ejlee3 marked this conversation as resolved.
Show resolved Hide resolved
LogLevel = "INFO"
[Writable.InsecureSecrets]
[Writable.InsecureSecrets.DB]
path = "redisdb"
[Writable.InsecureSecrets.DB.Secrets]
username = ""
password = ""
[Writable.InsecureSecrets.mqtt]
ejlee3 marked this conversation as resolved.
Show resolved Hide resolved
path = "mqtt"
[Writable.InsecureSecrets.mqtt.Secrets]
Expand All @@ -14,40 +9,11 @@ LogLevel = "INFO"
cacert = ""
clientcert = ""
clientkey = ""
[Writable.Telemetry]
Interval = "30s"
PublishTopicPrefix = "edgex/telemetry" # /<service-name>/<metric-name> will be added to this Publish Topic prefix
[Writable.Telemetry.Metrics] # All service's metric names must be present in this list.
# Common Security Service Metrics
SecuritySecretsRequested = false
SecuritySecretsStored = false
SecurityConsulTokensRequested = false
SecurityConsulTokenDuration = false
[Writable.Telemetry.Tags] # Contains the service level tags to be attached to all the service's metrics
# Gateway="my-iot-gateway" # Tag must be added here or via Consul Env Override can only chnage existing value, not added new ones.

[Service]
HealthCheckInterval = "10s"
Host = "localhost"
Port = 59882
ServerBindAddr = "" # Leave blank so default to Host value unless different value is needed.
StartupMsg = "This is the Core Command Microservice"
MaxResultCount = 1024
MaxRequestSize = 0 # Not curently used. Defines the maximum size of http request body in bytes
RequestTimeout = "45s"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cloudxxx8 , Wow, we need to confirm that this override should be here.

[Service.CORSConfiguration]
EnableCORS = false
CORSAllowCredentials = false
CORSAllowedOrigin = "https://localhost"
CORSAllowedMethods = "GET, POST, PUT, PATCH, DELETE"
CORSAllowedHeaders = "Authorization, Accept, Accept-Language, Content-Language, Content-Type, X-Correlation-ID"
CORSExposeHeaders = "Cache-Control, Content-Language, Content-Length, Content-Type, Expires, Last-Modified, Pragma, X-Correlation-ID"
CORSMaxAge = 3600

[Registry]
Host = "localhost"
Port = 8500
Type = "consul"

[Clients]
[Clients.core-metadata]
Expand All @@ -56,35 +22,14 @@ Type = "consul"
Port = 59881

[MessageBus]
Type = "redis"
Protocol = "redis"
Host = "localhost"
Port = 6379
AuthMode = "usernamepassword" # required for redis messagebus (secure or insecure).
SecretName = "redisdb"
[MessageBus.Topics]
DeviceCommandRequestTopicPrefix = "edgex/device/command/request" # for publishing requests to the device service; <device-service>/<device-name>/<command-name>/<method> will be added to this publish topic prefix
CommandRequestTopic = "edgex/core/command/request/#" # for subscribing to internal command requests
CommandQueryRequestTopic = "edgex/core/commandquery/request/#" # for subscribing to internal command query requests
ResponseTopicPrefix="edgex/response" # for subscribing/publishing internal responses (used by MessageBus Request API)
[MessageBus.Optional]
# Default MQTT Specific options that need to be here to enable evnironment variable overrides of them
# Default MQTT Specific options that need to be here to enable environment variable overrides of them
ClientId ="core-command"
Qos = "0" # Quality of Sevice values are 0 (At most once), 1 (At least once) or 2 (Exactly once)
KeepAlive = "10" # Seconds (must be 2 or greater)
Retained = "false"
AutoReconnect = "true"
ConnectTimeout = "5" # Seconds
SkipCertVerify = "false"
# Additional Default NATS Specific options that need to be here to enable evnironment variable overrides of them
Format = "nats"
RetryOnFailedConnect = "true"
QueueGroup = ""
Durable = ""
AutoProvision = "true"
Deliver = "new"
DefaultPubRetryAttempts = "2"
Subject = "edgex/#" # Required for NATS Jetstram only for stream autoprovsioning

[ExternalMQTT]
Enabled = false
Expand Down
7 changes: 1 addition & 6 deletions cmd/core-common-config-bootstrapper/res/configuration.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
all-services:
Writable:
LogLevel: "INFO"

InsecureSecrets:
DB:
path: "redisdb"
Expand Down Expand Up @@ -42,7 +40,7 @@ all-services:
Port: 8500
Type: "consul"

Databases:
Database:
Host: "localhost"
Port: 6379
Timeout: 5000
ejlee3 marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -55,9 +53,6 @@ all-services:
Type: "redis"
AuthMode: "usernamepassword" # required for redis MessageBus (secure or insecure).
SecretName: "redisdb"
Topics:
PublishTopicPrefix: "edgex/events/core" # /<device-profile-name>/<device-name> will be added to this Publish Topic prefix
SubscribeTopic: "edgex/events/device/#" # required for subscribing to Events from MessageBus
Optional:
# Default MQTT Specific options that need to be here to enable environment variable overrides of them
Qos: "0" # Quality of Service values are 0 (At most once), 1 (At least once) or 2 (Exactly once)
Expand Down
76 changes: 8 additions & 68 deletions cmd/core-data/res/configuration.toml
Original file line number Diff line number Diff line change
@@ -1,85 +1,25 @@
MaxEventSize = 25000 # Defines the maximum event size in kilobytes

[Writable]
PersistData = true
LogLevel = "INFO"
[Writable.InsecureSecrets]
[Writable.InsecureSecrets.DB]
path = "redisdb"
[Writable.InsecureSecrets.DB.Secrets]
username = ""
password = ""
[Writable.Telemetry]
Interval = "30s"
PublishTopicPrefix = "edgex/telemetry" # /<service-name>/<metric-name> will be added to this Publish Topic prefix
PersistData = true
[Writable.Telemetry.Metrics] # All service's metric names must be present in this list.
# Core Data Service Metrics
EventsPersisted = false
ReadingsPersisted = false
# Common Security Service Metrics
SecuritySecretsRequested = false
SecuritySecretsStored = false
SecurityConsulTokensRequested = false
SecurityConsulTokenDuration = false
[Writable.Telemetry.Tags] # Contains the service level tags to be attached to all the service's metrics
# Gateway="my-iot-gateway" # Tag must be added here or via Consul Env Override can only chnage existing value, not added new ones.
# Gateway="my-iot-gateway" # Tag must be added here or via Consul Env Override can only change existing value, not added new ones.

[Service]
HealthCheckInterval = "10s"
Host = "localhost"
Port = 59880
ServerBindAddr = "" # Leave blank so default to Host value unless different value is needed.
StartupMsg = "This is the Core Data Microservice"
MaxResultCount = 1024
MaxRequestSize = 0 # Not curently used. Defines the maximum size of http request body in bytes
RequestTimeout = "5s"
[Service.CORSConfiguration]
EnableCORS = false
CORSAllowCredentials = false
CORSAllowedOrigin = "https://localhost"
CORSAllowedMethods = "GET, POST, PUT, PATCH, DELETE"
CORSAllowedHeaders = "Authorization, Accept, Accept-Language, Content-Language, Content-Type, X-Correlation-ID"
CORSExposeHeaders = "Cache-Control, Content-Language, Content-Length, Content-Type, Expires, Last-Modified, Pragma, X-Correlation-ID"
CORSMaxAge = 3600

[Registry]
Host = "localhost"
Port = 8500
Type = "consul"

[Clients] # Core data no longer dependent on "Client" services

[Database]
Host = "localhost"
Name = "coredata"
Port = 6379
Timeout = 5000
Type = "redisdb"

[MessageBus]
Protocol = "redis"
Host = "localhost"
Port = 6379
Type = "redis"
AuthMode = "usernamepassword" # required for redis messagebus (secure or insecure).
SecretName = "redisdb"
[MessageBus.Topics]
PublishTopicPrefix = "edgex/events/core" # /<device-profile-name>/<device-name> will be added to this Publish Topic prefix
SubscribeTopic = "edgex/events/device/#" # required for subscribing to Events from MessageBus
ejlee3 marked this conversation as resolved.
Show resolved Hide resolved
[MessageBus.Optional]
# Default MQTT Specific options that need to be here to enable evnironment variable overrides of them
ClientId ="core-data"
ejlee3 marked this conversation as resolved.
Show resolved Hide resolved
Qos = "0" # Quality of Sevice values are 0 (At most once), 1 (At least once) or 2 (Exactly once)
KeepAlive = "10" # Seconds (must be 2 or greater)
Retained = "false"
AutoReconnect = "true"
ConnectTimeout = "5" # Seconds
SkipCertVerify = "false"
# Additional Default NATS Specific options that need to be here to enable evnironment variable overrides of them
Format = "nats"
RetryOnFailedConnect = "true"
QueueGroup = ""
Durable = ""
AutoProvision = "true"
Deliver = "new"
DefaultPubRetryAttempts = "2"
Subject = "edgex/#" # Required for NATS Jetstram only for stream autoprovsioning
[MessageBus.Topics]
PublishTopicPrefix = "edgex/events/core" # /<device-profile-name>/<device-name> will be added to this Publish Topic prefix
SubscribeTopic = "edgex/events/device/#" # required for subscribing to Events from MessageBus
[MessageBus.Optional]
ClientId = "core-data"
61 changes: 0 additions & 61 deletions cmd/core-metadata/res/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,81 +5,20 @@ LogLevel = "INFO"
StrictDeviceProfileDeletes = false
[Writable.UoM]
Validation = false
[Writable.InsecureSecrets]
[Writable.InsecureSecrets.DB]
path = "redisdb"
[Writable.InsecureSecrets.DB.Secrets]
username = ""
password = ""
[Writable.Telemetry]
Interval = "30s"
PublishTopicPrefix = "edgex/telemetry" # /<service-name>/<metric-name> will be added to this Publish Topic prefix
[Writable.Telemetry.Metrics] # All service's metric names must be present in this list.
# Common Security Service Metrics
SecuritySecretsRequested = false
SecuritySecretsStored = false
SecurityConsulTokensRequested = false
SecurityConsulTokenDuration = false
[Writable.Telemetry.Tags] # Contains the service level tags to be attached to all the service's metrics
# Gateway="my-iot-gateway" # Tag must be added here or via Consul Env Override can only chnage existing value, not added new ones.

[Service]
HealthCheckInterval = "10s"
Host = "localhost"
Port = 59881
ServerBindAddr = "" # Leave blank so default to Host value unless different value is needed.
StartupMsg = "This is the EdgeX Core Metadata Microservice"
MaxResultCount = 1024
MaxRequestSize = 0 # Not curently used. Defines the maximum size of http request body in bytes
RequestTimeout = "5s"
[Service.CORSConfiguration]
EnableCORS = false
CORSAllowCredentials = false
CORSAllowedOrigin = "https://localhost"
CORSAllowedMethods = "GET, POST, PUT, PATCH, DELETE"
CORSAllowedHeaders = "Authorization, Accept, Accept-Language, Content-Language, Content-Type, X-Correlation-ID"
CORSExposeHeaders = "Cache-Control, Content-Language, Content-Length, Content-Type, Expires, Last-Modified, Pragma, X-Correlation-ID"
CORSMaxAge = 3600

[UoM]
UoMFile = "./res/uom.toml"

[Registry]
Host = "localhost"
Port = 8500
Type = "consul"

[Database]
Host = "localhost"
Name = "metadata"
Port = 6379
Timeout = 5000
Type = "redisdb"

[MessageBus]
Protocol = "redis"
Host = "localhost"
Port = 6379
Type = "redis"
AuthMode = "usernamepassword" # required for redis messagebus (secure or insecure).
SecretName = "redisdb"
[MessageBus.Topics]
PublishTopicPrefix = "edgex/system-events" # /<source>/<type>/<action>/<owner>/<profile> will be added to this Publish Topic prefix
[MessageBus.Optional]
# Default MQTT Specific options that need to be here to enable evnironment variable overrides of them
ClientId ="core-metadata"
Qos = "0" # Quality of Sevice values are 0 (At most once), 1 (At least once) or 2 (Exactly once)
KeepAlive = "10" # Seconds (must be 2 or greater)
Retained = "false"
AutoReconnect = "true"
ConnectTimeout = "5" # Seconds
SkipCertVerify = "false"
# Additional Default NATS Specific options that need to be here to enable evnironment variable overrides of them
Format = "nats"
RetryOnFailedConnect = "true"
QueueGroup = ""
Durable = ""
AutoProvision = "true"
Deliver = "new"
DefaultPubRetryAttempts = "2"
Subject = "edgex/#" # Required for NATS Jetstram only for stream autoprovsioning
62 changes: 1 addition & 61 deletions cmd/support-notifications/res/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,18 @@ LogLevel = "INFO"
ResendLimit = 2
ResendInterval = "5s"
[Writable.InsecureSecrets]
[Writable.InsecureSecrets.DB]
path = "redisdb"
[Writable.InsecureSecrets.DB.Secrets]
username = ""
password = ""
[Writable.InsecureSecrets.SMTP]
path = "smtp"
[Writable.InsecureSecrets.SMTP.Secrets]
username = "username@mail.example.com"
password = ""
[Writable.Telemetry]
Interval = "30s"
PublishTopicPrefix = "edgex/telemetry" # /<service-name>/<metric-name> will be added to this Publish Topic prefix
[Writable.Telemetry.Metrics] # All service's metric names must be present in this list.
# Common Security Service Metrics
SecuritySecretsRequested = false
SecuritySecretsStored = false
SecurityConsulTokensRequested = false
SecurityConsulTokenDuration = false
[Writable.Telemetry.Tags] # Contains the service level tags to be attached to all the service's metrics
# Gateway="my-iot-gateway" # Tag must be added here or via Consul Env Override can only chnage existing value, not added new ones.

[Service]
HealthCheckInterval = "10s"
Host = "localhost"
Port = 59860
ServerBindAddr = "" # Leave blank so default to Host value unless different value is needed.
StartupMsg = "This is the Support Notifications Microservice"
MaxResultCount = 1024
MaxRequestSize = 0 # Not curently used. Defines the maximum size of http request body in bytes
RequestTimeout = "5s"
[Service.CORSConfiguration]
EnableCORS = false
CORSAllowCredentials = false
CORSAllowedOrigin = "https://localhost"
CORSAllowedMethods = "GET, POST, PUT, PATCH, DELETE"
CORSAllowedHeaders = "Authorization, Accept, Accept-Language, Content-Language, Content-Type, X-Correlation-ID"
CORSExposeHeaders = "Cache-Control, Content-Language, Content-Length, Content-Type, Expires, Last-Modified, Pragma, X-Correlation-ID"
CORSMaxAge = 3600

[Registry]
Host = "localhost"
Port = 8500
Type = "consul"

[Database]
Host = "localhost"
Name = "notifications"
Port = 6379
Timeout = 5000
Type = "redisdb"

[Smtp]
Host = "smtp.gmail.com"
Expand All @@ -68,29 +29,8 @@ Type = "redisdb"
AuthMode = "usernamepassword"

[MessageBus]
Protocol = "redis"
Host = "localhost"
Port = 6379
Type = "redis"
AuthMode = "usernamepassword" # required for redis messagebus (secure or insecure).
SecretName = "redisdb"
[MessageBus.Topics]
# No topic yet. Metrics topic is handled in [Writable.Telemetry] above
[MessageBus.Optional]
# Default MQTT Specific options that need to be here to enable evnironment variable overrides of them
ClientId ="support-notifications"
Qos = "0" # Quality of Sevice values are 0 (At most once), 1 (At least once) or 2 (Exactly once)
KeepAlive = "10" # Seconds (must be 2 or greater)
Retained = "false"
AutoReconnect = "true"
ConnectTimeout = "5" # Seconds
SkipCertVerify = "false"
# Additional Default NATS Specific options that need to be here to enable evnironment variable overrides of them
Format = "nats"
RetryOnFailedConnect = "true"
QueueGroup = ""
Durable = ""
AutoProvision = "true"
Deliver = "new"
DefaultPubRetryAttempts = "2"
Subject = "edgex/#" # Required for NATS Jetstram only for stream autoprovsioning
ClientId ="support-notifications"
Loading