Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Add database.name config option

Girish Ramakrishnan6ee722111792
diff --git a/config/default.yaml b/config/default.yaml
index 050019670b..a3df1bd451 100644
--- a/config/default.yaml
+++ b/config/default.yaml
@@ -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
diff --git a/config/production.yaml.example b/config/production.yaml.example
index 6f658e61a8..a494bdb039 100644
--- a/config/production.yaml.example
+++ b/config/production.yaml.example
@@ -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
diff --git a/server/initializers/config.ts b/server/initializers/config.ts
index 5b402dd743..48e2cbc1a9 100644
--- a/server/initializers/config.ts
+++ b/server/initializers/config.ts
@@ -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'),
diff --git a/support/docker/production/config/production.yaml b/support/docker/production/config/production.yaml
index 58b41a493c..4eeca41106 100644
--- a/support/docker/production/config/production.yaml
+++ b/support/docker/production/config/production.yaml
@@ -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