Skip to content

Commit

Permalink
Add database.name config option
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gramakri authored and Chocobozzz committed Jun 25, 2020
1 parent 5bccbb0 commit 6ee7221
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/production.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion server/initializers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
2 changes: 1 addition & 1 deletion support/docker/production/config/production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6ee7221

Please sign in to comment.