Skip to content

Commit

Permalink
feat!: updates for common config (#518)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: configuration file changed to remove common config settings

close #513

Signed-off-by: Leonard Goodell <[email protected]>
  • Loading branch information
Lenny Goodell authored Feb 15, 2023
1 parent 2fb2187 commit 731cbe3
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 730 deletions.
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ module github.com/edgexfoundry/app-service-configurable

go 1.18

require github.com/edgexfoundry/app-functions-sdk-go/v3 v3.0.0-dev.27
require github.com/edgexfoundry/app-functions-sdk-go/v3 v3.0.0-dev.29

require (
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/armon/go-metrics v0.3.10 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/diegoholiveira/jsonlogic/v3 v3.2.6 // indirect
github.com/diegoholiveira/jsonlogic/v3 v3.2.7 // indirect
github.com/eclipse/paho.mqtt.golang v1.4.2 // indirect
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.11 // indirect
github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.2 // indirect
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.9 // indirect
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.22 // indirect
github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.3 // indirect
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.10 // indirect
github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.7 // indirect
github.com/edgexfoundry/go-mod-registry/v3 v3.0.0-dev.3 // indirect
github.com/edgexfoundry/go-mod-secrets/v3 v3.0.0-dev.5 // indirect
github.com/edgexfoundry/go-mod-secrets/v3 v3.0.0-dev.7 // indirect
github.com/fatih/color v1.9.0 // indirect
github.com/fxamacker/cbor/v2 v2.4.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
Expand All @@ -42,10 +42,10 @@ require (
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/consulstructure v0.0.0-20190329231841-56fdc4d2da54 // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/nats-io/nats.go v1.20.0 // indirect
github.com/nats-io/nkeys v0.3.0 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
Expand Down
30 changes: 16 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/diegoholiveira/jsonlogic/v3 v3.2.6 h1:EV607wRY72hT3V90ZOQw+zjXR9KIUV9jnHfT3yS8uks=
github.com/diegoholiveira/jsonlogic/v3 v3.2.6/go.mod h1:9oE8z9G+0OMxOoLHF3fhek3KuqD5CBqM0B6XFL08MSg=
github.com/diegoholiveira/jsonlogic/v3 v3.2.7 h1:awX07pFPnlntZzRNBcO4a2Ivxa77NMt+narq/6xcS0E=
github.com/diegoholiveira/jsonlogic/v3 v3.2.7/go.mod h1:9oE8z9G+0OMxOoLHF3fhek3KuqD5CBqM0B6XFL08MSg=
github.com/eclipse/paho.mqtt.golang v1.4.2 h1:66wOzfUHSSI1zamx7jR6yMEI5EuHnT1G6rNA5PM12m4=
github.com/eclipse/paho.mqtt.golang v1.4.2/go.mod h1:JGt0RsEwEX+Xa/agj90YJ9d9DH2b7upDZMK9HRbFvCA=
github.com/edgexfoundry/app-functions-sdk-go/v3 v3.0.0-dev.27 h1:Cla5PlQ18J6NNoZckDLD5TjGp2818UXnkUsNyC45hMs=
github.com/edgexfoundry/app-functions-sdk-go/v3 v3.0.0-dev.27/go.mod h1:CE/yTyQjjmfkYszfWTUrxvAwXm6mbmegMeUyp+U2XwM=
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.11 h1:PHkcIC9hwOG2XyumsdO4hfavzd96GHs7kJZE8Ih9/cY=
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.11/go.mod h1:UjrW9GZ5UjKZLF1EzEtAjvrgOvgQz3FGyVyAAX+fXW4=
github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.2 h1:xp5MsP+qf/fuJxy8fT7k1N+c4j4C6w04qMCBXm6id7o=
github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.2/go.mod h1:1Vv4uWAo6r7k6jUlqVJW8JOL6YKVBc6sRL8Al3DrMck=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.9 h1:ejafyDHaVCdfKW4IQZeg4n1mBI2JkC1Y1XXelyyj+z8=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.9/go.mod h1:4lpZUM54ZareGU/yuAJvLEw0BoJ43SvCj1LO+gsKm9c=
github.com/edgexfoundry/app-functions-sdk-go/v3 v3.0.0-dev.29 h1:9Qtfvkk5NRPfMpjg1emn98g/JnTjqC9MFrCNasJdmhY=
github.com/edgexfoundry/app-functions-sdk-go/v3 v3.0.0-dev.29/go.mod h1:pYkbsBEQP2JXFo1QXyxUGpXJK+KTaqMNEOmSQaexV0o=
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.22 h1:DrtTbcDU6VMoMmsAn9tQpxQ+MIwgtSBmSwuZLgFuDEQ=
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.22/go.mod h1:rVklwwUju+/MGOij+KJeBJZ+/HIo6YsQwlFv7UmsA+8=
github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.3 h1:0Ew4PzLSFJ+sb7AYtvb9m1mRN45Sh0ELU1HdMCel5t8=
github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.3/go.mod h1:ESOWI4GokQfQ3Bn2hGsdfOVx5idj7QEdCPT/SAQDd9M=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.10 h1:o5yenvmLn8+0AOz0d5GIek011Tt5ZRbvPlgE4VhozEU=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.10/go.mod h1:4lpZUM54ZareGU/yuAJvLEw0BoJ43SvCj1LO+gsKm9c=
github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.7 h1:jgDQA/7SENURXQkIX11pNgA/pX9IK9ZULenj/vF17Vw=
github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.7/go.mod h1:r6Klfz+QBDx1Z5UV0z70MKdK2/cgHwhtqTm2HFXoWug=
github.com/edgexfoundry/go-mod-registry/v3 v3.0.0-dev.3 h1:QgZF9f70Cwpvkjw3tP1aiVGHc+yNFJNzW6hO8pDs3fg=
github.com/edgexfoundry/go-mod-registry/v3 v3.0.0-dev.3/go.mod h1:2w8v0sv+i21nY+DY6JV4PFxsNTuxpGAjlNFlFMTfZkk=
github.com/edgexfoundry/go-mod-secrets/v3 v3.0.0-dev.5 h1:tEo8BVH4OZuJ/q9ii1H4PdtxlXLh/kOKpRuWFTHOcBc=
github.com/edgexfoundry/go-mod-secrets/v3 v3.0.0-dev.5/go.mod h1:wYgPDiVaalEUzBkKoZox3OvcpY52GsMAGJWvX/H+MJg=
github.com/edgexfoundry/go-mod-secrets/v3 v3.0.0-dev.7 h1:9Mn389IHlgoPgGUpwnLzoe/shylkQI+nXI3E/AfnYDA=
github.com/edgexfoundry/go-mod-secrets/v3 v3.0.0-dev.7/go.mod h1:Og18u4NhNuqnTVnoXo0bXKYlR6iU6o8GquT/ziynCis=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
Expand Down Expand Up @@ -169,17 +169,19 @@ github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceT
github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI=
github.com/mitchellh/consulstructure v0.0.0-20190329231841-56fdc4d2da54 h1:DcITQwl3ymmg7i1XfwpZFs/TPv2PuTwxE8bnuKVtKlk=
github.com/mitchellh/consulstructure v0.0.0-20190329231841-56fdc4d2da54/go.mod h1:dIfpPVUR+ZfkzkDcKnn+oPW1jKeXe4WlNWc7rIXOVxM=
github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ=
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY=
github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
Expand Down
83 changes: 0 additions & 83 deletions res/external-mqtt-trigger/configuration.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
[Writable]
LogLevel = "INFO"

[Writable.StoreAndForward]
Enabled = false
RetryInterval = "5m"
MaxRetryCount = 10

[Writable.Pipeline]
ExecutionOrder = "MQTTExport"
TargetType = "raw"
Expand All @@ -27,92 +22,14 @@ LogLevel = "INFO"
AuthMode = "none"
PersistOnError = "false"

# InsecureSecrets are required for Store and Forward DB access and for authenticated MQTT exports with
# new MQTTSecretSend function when not using security services, i.e. Vault
[Writable.InsecureSecrets]
[Writable.InsecureSecrets.DB]
path = "redisdb"
[Writable.InsecureSecrets.DB.Secrets]
username = ""
password = ""
[Writable.InsecureSecrets.mqtt]
path = "mqtt"
[Writable.InsecureSecrets.mqtt.Secrets]
username = ""
password = ""
cacert = ""
clientcert = ""
clientkey = ""

# Reporting metrics requires the "edgex-messagebus" Trigger.
# Since this profile uses "external-mqtt" trigger the metrics can not be reported.
[Writable.Telemetry]
Interval = "0s" # Disables reporting

[Service]
HealthCheckInterval = "10s"
Host = "localhost"
Port = 59706
ServerBindAddr = "" # if blank, uses default Go behavior https://golang.org/pkg/net/#Listen
StartupMsg = "app-external-mqtt-trigger has Started"
MaxResultCount = 0 # Not currently used by App Services.
MaxRequestSize = 0 # Not currently used by App Services.
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 is require when Store and Forward is enabled or when using Redis for the Messagebus
# Note when running in docker from compose file set the following environment variables:
# - Database_Host: edgex-redis
[Database]
Type = "redisdb"
Host = "localhost"
Port = 6379
Timeout = "30s"

# SecretStore is required when Store and Forward is enabled and running with security
# so Database credentials can be pulled from Vault. Also now require when running with secure Consul
# Note when running in docker from compose file set the following environment variables:
# - SecretStore_Host: edgex-vault
[SecretStore]
Type = "vault"
Host = "localhost"
Port = 8200
Path = "app-external-mqtt-trigger/"
Protocol = "http"
RootCaCertPath = ""
ServerName = ""
SecretsFile = ""
DisableScrubSecretsFile = false
TokenFile = "/tmp/edgex/secrets/app-external-mqtt-trigger/secrets-token.json"
[SecretStore.Authentication]
AuthType = "X-Vault-Token"
[SecretStore.RuntimeTokenProvider]
Enabled = false
Protocol = "https"
Host = "localhost"
Port = 59841
TrustDomain = "edgexfoundry.org"
EndpointSocket = "/tmp/edgex/secrets/spiffe/public/api.sock"
RequiredSecrets = "redisdb"

[Clients]
# Used for version check on start-up
[Clients.core-metadata]
Protocol = "http"
Host = "localhost"
Port = 59881

[MessageBus]
Disabled = true
Expand Down
58 changes: 0 additions & 58 deletions res/functional-tests/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,66 +75,8 @@ LogLevel = "INFO"
Interval = "0s" # Disables reporting

[Service]
HealthCheckInterval = "10s"
Host = "localhost"
Port = 59705
ServerBindAddr = "" # if blank, uses default Go behavior https://golang.org/pkg/net/#Listen
StartupMsg = "app-functional-tests Service Started"
MaxResultCount = 0 # Not currently used by App Services.
MaxRequestSize = 0 # Not currently used by App Services.
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]
# Used for version check on start-up
[Clients.core-metadata]
Protocol = "http"
Host = "localhost"
Port = 59881

# Used for Event client which is used by PushToCoreData function
[Clients.core-data]
Protocol = "http"
Host = "localhost"
Port = 59880

# SecretStore is required when Store and Forward is enabled and running with security
# so Database credentials can be pulled from Vault. Also now require when running with secure Consul
# Note when running in docker from compose file set the following environment variables:
# - SecretStore_Host: edgex-vault
[SecretStore]
Type = "vault"
Host = "localhost"
Port = 8200
Path = "app-functional-tests/"
Protocol = "http"
RootCaCertPath = ""
ServerName = ""
SecretsFile = ""
DisableScrubSecretsFile = false
TokenFile = "/tmp/edgex/secrets/app-functional-tests/secrets-token.json"
[SecretStore.Authentication]
AuthType = "X-Vault-Token"
[SecretStore.RuntimeTokenProvider]
Enabled = false
Protocol = "https"
Host = "localhost"
Port = 59841
TrustDomain = "edgexfoundry.org"
EndpointSocket = "/tmp/edgex/secrets/spiffe/public/api.sock"
RequiredSecrets = "redisdb"

[MessageBus]
Disabled = true
Expand Down
Loading

0 comments on commit 731cbe3

Please sign in to comment.