Skip to content

Commit 1bd2bb2

Browse files
Cory Schwartzdennis-tra
authored andcommitted
use sslmode everywhere
1 parent f8dbfd1 commit 1bd2bb2

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

deploy/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services:
1414
NEBULA_DATABASE_NAME: nebula
1515
NEBULA_DATABASE_USER: nebula
1616
NEBULA_DATABASE_PASSWORD: password # TODO: unsafe
17-
NEBULA_DATABASE_SSLMODE: disable
17+
NEBULA_DATABASE_SSL_MODE: disable
1818
NEBULA_PROMETHEUS_PORT: 6667
1919
NEBULA_PPROF_PORT: 6100
2020
depends_on:

pkg/config/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ var DefaultConfig = Config{
4545
DatabaseName: "nebula",
4646
DatabasePassword: "password",
4747
DatabaseUser: "nebula",
48-
DatabaseSSL: "prefer",
48+
DatabaseSSLMode: "prefer",
4949
Protocols: []string{"/ipfs/kad/1.0.0", "/ipfs/kad/2.0.0"},
5050
RefreshRoutingTable: false,
5151
}
@@ -113,7 +113,7 @@ type Config struct {
113113
DatabaseUser string
114114

115115
// Postgres SSL mode (should be one supported in https://www.postgresql.org/docs/current/libpq-ssl.html)
116-
DatabaseSSL string
116+
DatabaseSSLMode string
117117

118118
// The list of protocols that this crawler should look for.
119119
Protocols []string
@@ -277,8 +277,8 @@ func (c *Config) apply(ctx *cli.Context) {
277277
if ctx.IsSet("db-user") {
278278
c.DatabaseUser = ctx.String("db-user")
279279
}
280-
if ctx.IsSet("db-ssl") {
281-
c.DatabaseSSL = ctx.String("db-ssl")
280+
if ctx.IsSet("db-sslmode") {
281+
c.DatabaseSSLMode = ctx.String("db-sslmode")
282282
}
283283
if ctx.IsSet("protocols") {
284284
c.Protocols = ctx.StringSlice("protocols")

pkg/db/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func InitClient(conf *config.Config) (*Client, error) {
5353
conf.DatabaseName,
5454
conf.DatabaseUser,
5555
conf.DatabasePassword,
56-
conf.DatabaseSSL,
56+
conf.DatabaseSSLMode,
5757
)
5858
dbh, err := sql.Open(driverName, srcName)
5959
if err != nil {

0 commit comments

Comments
 (0)