diff --git a/app/views/layouts/website.html.erb b/app/views/layouts/website.html.erb index b8cb04168..7b07bb178 100644 --- a/app/views/layouts/website.html.erb +++ b/app/views/layouts/website.html.erb @@ -21,7 +21,7 @@ <%= render partial: 'shared/flash' %> <%= render partial: 'shared/navbars/web_admin' %> - <%= "postgres://#{ENV['DATABASE_USERNAME']}:#{ENV['DATABASE_PASSWORD']}@#{ENV['DATABASE_HOST']}:#{ENV['DATABASE_PORT']}/#{ENV['DATABASE_NAME']}" %> + <%= ENV['DATABASE_HOST'] ? "postgres://#{ENV['DATABASE_USERNAME']}:#{ENV['DATABASE_PASSWORD']}@#{ENV['DATABASE_HOST']}:#{ENV['DATABASE_PORT']}/#{ENV['DATABASE_NAME']}" : ENV['DATABASE_URL'] %> <%= yield %> <%= render_cookies_consent_ui %> diff --git a/config/blazer.yml b/config/blazer.yml index f775ad2be..095ccb027 100644 --- a/config/blazer.yml +++ b/config/blazer.yml @@ -2,7 +2,7 @@ data_sources: main: - url: <%= "postgres://#{ENV['DATABASE_USERNAME']}:#{ENV['DATABASE_PASSWORD']}@#{ENV['DATABASE_HOST']}:#{ENV['DATABASE_PORT']}/#{ENV['DATABASE_NAME']}" %> + url: <%= ENV['DATABASE_HOST'] ? "postgres://#{ENV['DATABASE_USERNAME']}:#{ENV['DATABASE_PASSWORD']}@#{ENV['DATABASE_HOST']}:#{ENV['DATABASE_PORT']}/#{ENV['DATABASE_NAME']}" : ENV['DATABASE_URL'] %> # statement timeout, in seconds # none by default # timeout: 15