mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
improve config so you can use it with a socket optionally
This commit is contained in:
parent
786f488186
commit
14d21ec865
1 changed files with 2 additions and 2 deletions
|
@ -42,8 +42,8 @@ production:
|
||||||
adapter: postgresql
|
adapter: postgresql
|
||||||
uri: <%= uri = URI.parse(ENV['POSTGRES_URL'] ? ENV['POSTGRES_URL'] : "pg://localhost") %>
|
uri: <%= uri = URI.parse(ENV['POSTGRES_URL'] ? ENV['POSTGRES_URL'] : "pg://localhost") %>
|
||||||
socket: <%= ENV['POSTGRES_SOCKET'] %>
|
socket: <%= ENV['POSTGRES_SOCKET'] %>
|
||||||
host: <%= uri.host %>
|
host: <%= ENV['POSTGRES_SOCKET'].present? ? nil : uri.host %>
|
||||||
port: <%= uri.port || (ENV['POSTGRES_SOCKET'] ? nil : 5432) %>
|
port: <%= uri.port || (ENV['POSTGRES_SOCKET'].present? ? nil : 5432) %>
|
||||||
database: <%= ENV['POSTGRES_DB'] || "discourse" %>
|
database: <%= ENV['POSTGRES_DB'] || "discourse" %>
|
||||||
username: <%= uri.user %>
|
username: <%= uri.user %>
|
||||||
password: <%= uri.password %>
|
password: <%= uri.password %>
|
||||||
|
|
Loading…
Reference in a new issue