Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskcenter
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Odysseus
taskcenter
Commits
2f80849f
Commit
2f80849f
authored
Nov 05, 2024
by
贾浩@五瓣科技
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update cert conf
parent
e7bdc9fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
dao.go
dao/dao.go
+7
-5
No files found.
dao/dao.go
View file @
2f80849f
...
...
@@ -25,13 +25,15 @@ func New(_c *config.Config) (dao *Dao, err error) {
c
:
_c
,
}
// dsn := fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8mb4&parseTime=True",
// _c.PGSQL.User, _c.PGSQL.Password, _c.PGSQL.Host, _c.PGSQL.Port, _c.PGSQL.Database)
dsn
:=
fmt
.
Sprintf
(
"host=%s user=%s password=%s dbname=%s port=%d sslmode=verify-ca sslrootcert=%s"
,
_c
.
PGSQL
.
Host
,
_c
.
PGSQL
.
User
,
_c
.
PGSQL
.
Password
,
_c
.
PGSQL
.
Database
,
_c
.
PGSQL
.
Port
,
_c
.
PGSQL
.
CertFile
,
// dsn := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d sslmode=verify-ca sslrootcert=%s",
dsn
:=
fmt
.
Sprintf
(
"host=%s user=%s password=%s dbname=%s port=%d"
,
_c
.
PGSQL
.
Host
,
_c
.
PGSQL
.
User
,
_c
.
PGSQL
.
Password
,
_c
.
PGSQL
.
Database
,
_c
.
PGSQL
.
Port
,
)
if
_c
.
PGSQL
.
CertFile
!=
""
{
dsn
=
fmt
.
Sprintf
(
"%s sslmode=require sslrootcert=%s"
,
dsn
,
_c
.
PGSQL
.
CertFile
)
}
lgr
:=
logger
.
Default
if
_c
.
PGSQL
.
EnableLog
{
lgr
=
logger
.
Default
.
LogMode
(
logger
.
Info
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment