Skip to content
Draft
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
24 changes: 14 additions & 10 deletions cmd/config/app_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ import (
var (
defaultServerTLSConfig = connection.TLSConfig{
Mode: connection.MutualTLSMode,
CertPath: "/server-certs/public-key",
KeyPath: "/server-certs/private-key",
CertPath: "/server-certs/public-key.crt",
KeyPath: "/server-certs/private-key.key",
CACertPaths: []string{
"/server-certs/ca-certificate",
"/server-certs/ca-certificate.crt",
},
}
defaultClientTLSConfig = connection.TLSConfig{
Mode: connection.MutualTLSMode,
CertPath: "/client-certs/public-key",
KeyPath: "/client-certs/private-key",
CertPath: "/client-certs/public-key.crt",
KeyPath: "/client-certs/private-key.key",
CACertPaths: []string{
"/client-certs/ca-certificate",
"/client-certs/ca-certificate.crt",
},
}
)
Expand Down Expand Up @@ -443,10 +443,14 @@ func defaultDBConfig() *vc.DatabaseConfig {

func defaultSampleDBConfig() *vc.DatabaseConfig {
return &vc.DatabaseConfig{
Endpoints: []*connection.Endpoint{newEndpoint("db", 5433)},
Username: "yugabyte",
Password: "yugabyte",
Database: "yugabyte",
Endpoints: []*connection.Endpoint{newEndpoint("db", 5433)},
Username: "yugabyte",
Password: "yugabyte",
Database: "yugabyte",
TLS: connection.DatabaseTLS{
Activate: true,
CACertPath: "/server-certs/ca-certificate.crt",
},
MaxConnections: 10,
MinConnections: 5,
LoadBalance: false,
Expand Down
2 changes: 1 addition & 1 deletion cmd/config/cobra_test_exports.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ func StartDefaultSystem(t *testing.T) SystemConfig {
},
DB: DatabaseConfig{
Name: conn.Database,
LoadBalance: false,
Endpoints: conn.Endpoints,
LoadBalance: false,
},
Policy: &workload.PolicyProfile{
ChannelID: "channel1",
Expand Down
2 changes: 2 additions & 0 deletions cmd/config/create_config_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ type (
// DatabaseConfig represents the used DB.
DatabaseConfig struct {
Name string
Password string
LoadBalance bool
Endpoints []*connection.Endpoint
TLS connection.DatabaseTLS
}
)

Expand Down
12 changes: 6 additions & 6 deletions cmd/config/samples/coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ server:
endpoint: :9001
tls:
mode: mtls
cert-path: /server-certs/public-key
key-path: /server-certs/private-key
cert-path: /server-certs/public-key.crt
key-path: /server-certs/private-key.key
ca-cert-paths:
- /server-certs/ca-certificate
- /server-certs/ca-certificate.crt
monitoring:
server:
endpoint: :2119
Expand All @@ -19,10 +19,10 @@ verifier:
- verifier:5001
tls: &ClientTLS
mode: mtls
cert-path: /client-certs/public-key
key-path: /client-certs/private-key
cert-path: /client-certs/public-key.crt
key-path: /client-certs/private-key.key
ca-cert-paths:
- /client-certs/ca-certificate
- /client-certs/ca-certificate.crt
validator-committer:
endpoints:
- vc:6001
Expand Down
12 changes: 6 additions & 6 deletions cmd/config/samples/loadgen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ server:
endpoint: :8001
tls:
mode: mtls
cert-path: /server-certs/public-key
key-path: /server-certs/private-key
cert-path: /server-certs/public-key.crt
key-path: /server-certs/private-key.key
ca-cert-paths:
- /server-certs/ca-certificate
- /server-certs/ca-certificate.crt
monitoring:
server:
endpoint: :2118
Expand All @@ -26,10 +26,10 @@ orderer-client:
endpoint: sidecar:4001
tls:
mode: mtls
cert-path: /client-certs/public-key
key-path: /client-certs/private-key
cert-path: /client-certs/public-key.crt
key-path: /client-certs/private-key.key
ca-cert-paths:
- /client-certs/ca-certificate
- /client-certs/ca-certificate.crt
orderer:
connection:
endpoints:
Expand Down
10 changes: 6 additions & 4 deletions cmd/config/samples/query.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ server:
endpoint: :7001
tls:
mode: mtls
cert-path: /server-certs/public-key
key-path: /server-certs/private-key
cert-path: /server-certs/public-key.crt
key-path: /server-certs/private-key.key
ca-cert-paths:
- /server-certs/ca-certificate
# Credentials for the server
- /server-certs/ca-certificate.crt
monitoring:
server:
endpoint: :2117
Expand All @@ -24,6 +23,9 @@ database:
# TODO: pass password via environment variable
password: "yugabyte" # The password for the database
database: "yugabyte" # The database name
tls:
activate: true
ca-cert-path: /server-certs/ca-certificate.crt
max-connections: 10 # The maximum size of the connection pool
min-connections: 5 # The minimum size of the connection pool
load-balance: false # Should be enabled for DB cluster
Expand Down
12 changes: 6 additions & 6 deletions cmd/config/samples/sidecar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ server:
endpoint: :4001
tls:
mode: mtls
cert-path: /server-certs/public-key
key-path: /server-certs/private-key
cert-path: /server-certs/public-key.crt
key-path: /server-certs/private-key.key
ca-cert-paths:
- /server-certs/ca-certificate
- /server-certs/ca-certificate.crt
keep-alive:
params:
time: 300s
Expand Down Expand Up @@ -40,10 +40,10 @@ committer:
endpoint: coordinator:9001
tls:
mode: mtls
cert-path: /client-certs/public-key
key-path: /client-certs/private-key
cert-path: /client-certs/public-key.crt
key-path: /client-certs/private-key.key
ca-cert-paths:
- /client-certs/ca-certificate
- /client-certs/ca-certificate.crt
ledger:
path: /root/sc/ledger
notification:
Expand Down
10 changes: 6 additions & 4 deletions cmd/config/samples/vc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ server:
endpoint: :6001
tls:
mode: mtls
cert-path: /server-certs/public-key
key-path: /server-certs/private-key
cert-path: /server-certs/public-key.crt
key-path: /server-certs/private-key.key
ca-cert-paths:
- /server-certs/ca-certificate
# Credentials for the server
- /server-certs/ca-certificate.crt
monitoring:
server:
endpoint: :2116
Expand All @@ -23,6 +22,9 @@ database:
# TODO: pass password via environment variable
password: "yugabyte" # The password for the database
database: "yugabyte" # The database name
tls:
activate: true
ca-cert-path: /server-certs/ca-certificate.crt
max-connections: 10 # The maximum size of the connection pool
min-connections: 5 # The minimum size of the connection pool.
load-balance: false # Should be enabled for DB cluster.
Expand Down
6 changes: 3 additions & 3 deletions cmd/config/samples/verifier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ server:
endpoint: :5001
tls:
mode: mtls
cert-path: /server-certs/public-key
key-path: /server-certs/private-key
cert-path: /server-certs/public-key.crt
key-path: /server-certs/private-key.key
ca-cert-paths:
- /server-certs/ca-certificate
- /server-certs/ca-certificate.crt
monitoring:
server:
endpoint: :2115
Expand Down
5 changes: 4 additions & 1 deletion cmd/config/templates/query.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ database:
{{- end }}
username: "yugabyte"
# TODO: pass password via environment variable
password: "yugabyte"
password: {{ .DB.Password }}
database: {{ .DB.Name }}
load-balance: {{ .DB.LoadBalance }}
tls:
activate: {{ .DB.TLS.Activate }}
ca-cert-path: {{ .DB.TLS.CACertPath }}
max-connections: 10
min-connections: 5
retry:
Expand Down
5 changes: 4 additions & 1 deletion cmd/config/templates/vc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ database:
{{- end }}
username: "yugabyte"
# TODO: pass password via environment variable
password: "yugabyte"
password: {{ .DB.Password }}
database: {{ .DB.Name }}
load-balance: {{ .DB.LoadBalance }}
tls:
activate: {{ .DB.TLS.Activate }}
ca-cert-path: {{ .DB.TLS.CACertPath }}
max-connections: 10
min-connections: 5
retry:
Expand Down
4 changes: 4 additions & 0 deletions docker/images/test_node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ ENV SC_SIDECAR_COMMITTER_TLS_MODE="none"
ENV SC_VC_SERVER_TLS_MODE="none"
ENV SC_VERIFIER_SERVER_TLS_MODE="none"

# Disable TLS usage for db.
ENV SC_VC_DATABASE_TLS_ACTIVATE=false
ENV SC_QUERY_DATABASE_TLS_ACTIVATE=false

COPY ${ARCHBIN_PATH}/${TARGETOS}-${TARGETARCH}/* ${BINS_PATH}/
COPY ./docker/images/test_node/run ${BINS_PATH}/
COPY ./cmd/config/samples $CONFIGS_PATH
Expand Down
2 changes: 1 addition & 1 deletion docker/test/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func getContainerMappedHostPort(
info, err := createDockerClient(t).ContainerInspect(ctx, containerName)
require.NoError(t, err)
require.NotNil(t, info)
portKey := nat.Port(fmt.Sprintf("%s/%s", containerPort, "tcp"))
portKey := nat.Port(fmt.Sprintf("%s/tcp", containerPort))
bindings, ok := info.NetworkSettings.Ports[portKey]
require.True(t, ok)
require.NotEmpty(t, bindings)
Expand Down
Loading