mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Add POSTGRES_SSLMODE for gocoder (#760)
This commit is contained in:
parent
9be48de1fd
commit
3182cc8d07
@ -26,6 +26,8 @@ POSTGRES_PASSWORD=
|
||||
POSTGRES_DB=
|
||||
POSTGRES_SERVER=
|
||||
POSTGRES_PORT=5432
|
||||
# can also be "require" ("prefer" is not supported)
|
||||
POSTGRES_SSLMODE="disable"
|
||||
# Default is gocoder, you can specify "disabled" to use the default search_path of the user.
|
||||
# If this is not "disabled", the schema will be created (if it does not exists) and
|
||||
# the search_path of the user will be ignored (only the schema specified will be used).
|
||||
|
@ -24,12 +24,13 @@ type MetadataService struct {
|
||||
|
||||
func NewMetadataService() (*MetadataService, error) {
|
||||
con := fmt.Sprintf(
|
||||
"postgresql://%v:%v@%v:%v/%v?application_name=gocoder&sslmode=disable",
|
||||
"postgresql://%v:%v@%v:%v/%v?application_name=gocoder&sslmode=%s",
|
||||
url.QueryEscape(os.Getenv("POSTGRES_USER")),
|
||||
url.QueryEscape(os.Getenv("POSTGRES_PASSWORD")),
|
||||
url.QueryEscape(os.Getenv("POSTGRES_SERVER")),
|
||||
url.QueryEscape(os.Getenv("POSTGRES_PORT")),
|
||||
url.QueryEscape(os.Getenv("POSTGRES_DB")),
|
||||
url.QueryEscape(GetEnvOr("POSTGRES_SSLMODE", "disable")),
|
||||
)
|
||||
schema := GetEnvOr("POSTGRES_SCHEMA", "gocoder")
|
||||
if schema != "disabled" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user