Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[server] Allow a configurable sslmode

Manav Rathi74decc32de51
diff --git a/server/configurations/local.yaml b/server/configurations/local.yaml
index 2cfdba18b5..bbad3f2784 100644
--- a/server/configurations/local.yaml
+++ b/server/configurations/local.yaml
@@ -76,6 +76,9 @@ db:
host: localhost
port: 5432
name: ente_db
+ # You might want to set this to "require" for production
+ # See https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-PROTECTION
+ sslmode: disable
# These can be specified here, or alternatively provided via the environment
# as ENTE_DB_USER and ENTE_DB_PASSWORD.
user:
@@ -303,4 +306,4 @@ jobs:
# By default, this job is disabled.
enabled: false
# If provided, only objects that begin with this prefix are pruned.
- prefix: ""
\ No newline at end of file
+ prefix: ""
diff --git a/server/pkg/utils/config/config.go b/server/pkg/utils/config/config.go
index ed0bbb6e33..a12381e455 100644
--- a/server/pkg/utils/config/config.go
+++ b/server/pkg/utils/config/config.go
@@ -103,12 +103,13 @@ func doesFileExist(path string) (bool, error) {
func GetPGInfo() string {
return fmt.Sprintf("host=%s port=%d user=%s "+
- "password=%s dbname=%s sslmode=disable",
+ "password=%s dbname=%s sslmode=%s",
viper.GetString("db.host"),
viper.GetInt("db.port"),
viper.GetString("db.user"),
viper.GetString("db.password"),
- viper.GetString("db.name"))
+ viper.GetString("db.name"),
+ viper.GetString("db.sslmode"))
}
func IsLocalEnvironment() bool {