aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-24 11:38:57 +0200
committerChocobozzz <me@florianbigard.com>2020-08-24 11:38:57 +0200
commitb0ce7c39dce4be8d7c2775e8205f8abfe348a0de (patch)
tree7b8d7f03162fb3f15933b27fb5744694672a88dd
parent4f24f16e27d942b063c945dde55b902572b7dee7 (diff)
downloadPeerTube-b0ce7c39dce4be8d7c2775e8205f8abfe348a0de.tar.gz
PeerTube-b0ce7c39dce4be8d7c2775e8205f8abfe348a0de.tar.zst
PeerTube-b0ce7c39dce4be8d7c2775e8205f8abfe348a0de.zip
Add ssl support to postgresql
-rw-r--r--config/default.yaml1
-rw-r--r--config/production.yaml.example1
-rw-r--r--server/initializers/config.ts1
-rw-r--r--server/initializers/database.ts2
-rw-r--r--support/docker/production/config/production.yaml1
5 files changed, 6 insertions, 0 deletions
diff --git a/config/default.yaml b/config/default.yaml
index a3af1b15f..0c2d165be 100644
--- a/config/default.yaml
+++ b/config/default.yaml
@@ -37,6 +37,7 @@ trust_proxy:
37database: 37database:
38 hostname: 'localhost' 38 hostname: 'localhost'
39 port: 5432 39 port: 5432
40 ssl: false
40 suffix: '_dev' 41 suffix: '_dev'
41 username: 'peertube' 42 username: 'peertube'
42 password: 'peertube' 43 password: 'peertube'
diff --git a/config/production.yaml.example b/config/production.yaml.example
index c1e7c6c03..ca9c16739 100644
--- a/config/production.yaml.example
+++ b/config/production.yaml.example
@@ -36,6 +36,7 @@ trust_proxy:
36database: 36database:
37 hostname: 'localhost' 37 hostname: 'localhost'
38 port: 5432 38 port: 5432
39 ssl: false
39 suffix: '_prod' 40 suffix: '_prod'
40 username: 'peertube' 41 username: 'peertube'
41 password: 'peertube' 42 password: 'peertube'
diff --git a/server/initializers/config.ts b/server/initializers/config.ts
index 32bd3bbe2..04ba605b6 100644
--- a/server/initializers/config.ts
+++ b/server/initializers/config.ts
@@ -23,6 +23,7 @@ const CONFIG = {
23 DBNAME: config.has('database.name') ? config.get<string>('database.name') : 'peertube' + config.get<string>('database.suffix'), 23 DBNAME: config.has('database.name') ? config.get<string>('database.name') : 'peertube' + config.get<string>('database.suffix'),
24 HOSTNAME: config.get<string>('database.hostname'), 24 HOSTNAME: config.get<string>('database.hostname'),
25 PORT: config.get<number>('database.port'), 25 PORT: config.get<number>('database.port'),
26 SSL: config.get<boolean>('database.ssl'),
26 USERNAME: config.get<string>('database.username'), 27 USERNAME: config.get<string>('database.username'),
27 PASSWORD: config.get<string>('database.password'), 28 PASSWORD: config.get<string>('database.password'),
28 POOL: { 29 POOL: {
diff --git a/server/initializers/database.ts b/server/initializers/database.ts
index 5cf5765f6..e05e7c335 100644
--- a/server/initializers/database.ts
+++ b/server/initializers/database.ts
@@ -48,6 +48,7 @@ const dbname = CONFIG.DATABASE.DBNAME
48const username = CONFIG.DATABASE.USERNAME 48const username = CONFIG.DATABASE.USERNAME
49const password = CONFIG.DATABASE.PASSWORD 49const password = CONFIG.DATABASE.PASSWORD
50const host = CONFIG.DATABASE.HOSTNAME 50const host = CONFIG.DATABASE.HOSTNAME
51const ssl = CONFIG.DATABASE.SSL
51const port = CONFIG.DATABASE.PORT 52const port = CONFIG.DATABASE.PORT
52const poolMax = CONFIG.DATABASE.POOL.MAX 53const poolMax = CONFIG.DATABASE.POOL.MAX
53 54
@@ -58,6 +59,7 @@ const sequelizeTypescript = new SequelizeTypescript({
58 port, 59 port,
59 username, 60 username,
60 password, 61 password,
62 ssl,
61 pool: { 63 pool: {
62 max: poolMax 64 max: poolMax
63 }, 65 },
diff --git a/support/docker/production/config/production.yaml b/support/docker/production/config/production.yaml
index a32cf1a89..6215b9fdf 100644
--- a/support/docker/production/config/production.yaml
+++ b/support/docker/production/config/production.yaml
@@ -30,6 +30,7 @@ trust_proxy:
30database: 30database:
31 hostname: 'postgres' 31 hostname: 'postgres'
32 port: 5432 32 port: 5432
33 ssl: false
33 suffix: '' 34 suffix: ''
34 username: 'postgres' 35 username: 'postgres'
35 password: 'postgres' 36 password: 'postgres'