diff options
author | Chocobozzz <me@florianbigard.com> | 2021-04-20 15:01:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-04-20 15:01:54 +0200 |
commit | 4024c44f9027a32809931de0692d40d001df721c (patch) | |
tree | 4403f1149143a0c0e7176c30d7077bb648ae4911 /server/initializers | |
parent | 46460547caf558d50040acc75b25373ea07fc83c (diff) | |
parent | 1c82e4eee3b6ce0edca18157b11aff8d5bf3dacd (diff) | |
download | PeerTube-4024c44f9027a32809931de0692d40d001df721c.tar.gz PeerTube-4024c44f9027a32809931de0692d40d001df721c.tar.zst PeerTube-4024c44f9027a32809931de0692d40d001df721c.zip |
Merge branch 'release/3.1.0' into develop
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/database.ts | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/server/initializers/database.ts b/server/initializers/database.ts index 4c9d7c610..edf12bc41 100644 --- a/server/initializers/database.ts +++ b/server/initializers/database.ts | |||
@@ -51,18 +51,27 @@ const dbname = CONFIG.DATABASE.DBNAME | |||
51 | const username = CONFIG.DATABASE.USERNAME | 51 | const username = CONFIG.DATABASE.USERNAME |
52 | const password = CONFIG.DATABASE.PASSWORD | 52 | const password = CONFIG.DATABASE.PASSWORD |
53 | const host = CONFIG.DATABASE.HOSTNAME | 53 | const host = CONFIG.DATABASE.HOSTNAME |
54 | const ssl = CONFIG.DATABASE.SSL | ||
55 | const port = CONFIG.DATABASE.PORT | 54 | const port = CONFIG.DATABASE.PORT |
56 | const poolMax = CONFIG.DATABASE.POOL.MAX | 55 | const poolMax = CONFIG.DATABASE.POOL.MAX |
57 | 56 | ||
57 | let dialectOptions: any = {} | ||
58 | |||
59 | if (CONFIG.DATABASE.SSL) { | ||
60 | dialectOptions = { | ||
61 | ssl: { | ||
62 | rejectUnauthorized: false | ||
63 | } | ||
64 | } | ||
65 | } | ||
66 | |||
58 | const sequelizeTypescript = new SequelizeTypescript({ | 67 | const sequelizeTypescript = new SequelizeTypescript({ |
59 | database: dbname, | 68 | database: dbname, |
60 | dialect: 'postgres', | 69 | dialect: 'postgres', |
70 | dialectOptions, | ||
61 | host, | 71 | host, |
62 | port, | 72 | port, |
63 | username, | 73 | username, |
64 | password, | 74 | password, |
65 | ssl, | ||
66 | pool: { | 75 | pool: { |
67 | max: poolMax | 76 | max: poolMax |
68 | }, | 77 | }, |