Add database.name config option
authorGirish Ramakrishnan <girish@cloudron.io>
Wed, 24 Jun 2020 17:48:04 +0000 (10:48 -0700)
committerChocobozzz <chocobozzz@cpy.re>
Thu, 25 Jun 2020 06:48:44 +0000 (08:48 +0200)
If database.name is set, we use it as the complete database name.
If unset, we use the "peertube"+database.suffix as the complete database
name.

Fixes #1620

config/default.yaml
config/production.yaml.example
server/initializers/config.ts
support/docker/production/config/production.yaml

index 050019670b4918a5b12f0f6fcfcb90964bd20dea..a3df1bd451ad87a3e349e639219257c1b0df7504 100644 (file)
@@ -33,7 +33,7 @@ rates_limit:
 trust_proxy:
   - 'loopback'
 
-# Your database name will be "peertube"+database.suffix
+# Your database name will be database.name OR "peertube"+database.suffix
 database:
   hostname: 'localhost'
   port: 5432
index 6f658e61a8d2c22d09def68d626e016152b0119a..a494bdb039951744fec6eb4a32e6a77415d66799 100644 (file)
@@ -32,7 +32,7 @@ rates_limit:
 trust_proxy:
   - 'loopback'
 
-# Your database name will be "peertube"+database.suffix
+# Your database name will be database.name OR "peertube"+database.suffix
 database:
   hostname: 'localhost'
   port: 5432
index 5b402dd7432651216aedd92737325c10e834f641..48e2cbc1a92910ab9cdf602f2adaa3ec5e0c70b1 100644 (file)
@@ -20,7 +20,7 @@ const CONFIG = {
     HOSTNAME: config.get<string>('listen.hostname')
   },
   DATABASE: {
-    DBNAME: 'peertube' + config.get<string>('database.suffix'),
+    DBNAME: config.has('database.name') ? config.get<string>('database.name') : 'peertube' + config.get<string>('database.suffix'),
     HOSTNAME: config.get<string>('database.hostname'),
     PORT: config.get<number>('database.port'),
     USERNAME: config.get<string>('database.username'),
index 58b41a493cf714f42524204e59541bb29249b785..4eeca41106133cc70d1b24c95fa9103788cbfcd0 100644 (file)
@@ -26,7 +26,7 @@ trust_proxy:
   - 'linklocal'
   - 'uniquelocal'
 
-# Your database name will be "peertube"+database.suffix
+# Your database name will be database.name or "peertube"+database.suffix
 database:
   hostname: 'postgres'
   port: 5432