database.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. default: &default
  2. adapter: postgresql
  3. pool: <%= ENV["DB_POOL"] || (if Sidekiq.server? then Sidekiq[:concurrency] else ENV['MAX_THREADS'] end) || 5 %>
  4. timeout: 5000
  5. connect_timeout: 15
  6. encoding: unicode
  7. sslmode: <%= ENV['DB_SSLMODE'] || "prefer" %>
  8. application_name: ''
  9. development:
  10. primary:
  11. <<: *default
  12. database: <%= ENV['DB_NAME'] || 'mastodon_development' %>
  13. username: <%= ENV['DB_USER'] %>
  14. password: <%= (ENV['DB_PASS'] || '').to_json %>
  15. host: <%= ENV['DB_HOST'] %>
  16. port: <%= ENV['DB_PORT'] %>
  17. replica:
  18. <<: *default
  19. database: <%= ENV['DB_NAME'] || 'mastodon_development' %>
  20. username: <%= ENV['DB_USER'] %>
  21. password: <%= (ENV['DB_PASS'] || '').to_json %>
  22. host: <%= ENV['DB_HOST'] %>
  23. port: <%= ENV['DB_PORT'] %>
  24. replica: true
  25. # Warning: The database defined as "test" will be erased and
  26. # re-generated from your development database when you run "rake".
  27. # Do not set this db to the same as development or production.
  28. test:
  29. primary:
  30. <<: *default
  31. database: <%= ENV['DB_NAME'] || 'mastodon' %>_test<%= ENV['TEST_ENV_NUMBER'] %>
  32. username: <%= ENV['DB_USER'] %>
  33. password: <%= (ENV['DB_PASS'] || '').to_json %>
  34. host: <%= ENV['DB_HOST'] %>
  35. port: <%= ENV['DB_PORT'] %>
  36. replica:
  37. <<: *default
  38. database: <%= ENV['DB_NAME'] || 'mastodon' %>_test<%= ENV['TEST_ENV_NUMBER'] %>
  39. username: <%= ENV['DB_USER'] %>
  40. password: <%= (ENV['DB_PASS'] || '').to_json %>
  41. host: <%= ENV['DB_HOST'] %>
  42. port: <%= ENV['DB_PORT'] %>
  43. replica: true
  44. production:
  45. primary:
  46. <<: *default
  47. database: <%= ENV['DB_NAME'] || 'mastodon_production' %>
  48. username: <%= ENV['DB_USER'] || 'mastodon' %>
  49. password: <%= (ENV['DB_PASS'] || '').to_json %>
  50. host: <%= ENV['DB_HOST'] || 'localhost' %>
  51. port: <%= ENV['DB_PORT'] || 5432 %>
  52. prepared_statements: <%= ENV['PREPARED_STATEMENTS'] || 'true' %>
  53. replica:
  54. <<: *default
  55. database: <%= ENV['REPLICA_DB_NAME'] ||ENV['DB_NAME'] || 'mastodon_production' %>
  56. username: <%= ENV['REPLICA_DB_USER'] ||ENV['DB_USER'] || 'mastodon' %>
  57. password: <%= (ENV['REPLICA_DB_PASS'] || ENV['DB_PASS'] || '').to_json %>
  58. host: <%= ENV['REPLICA_DB_HOST'] ||ENV['DB_HOST'] || 'localhost' %>
  59. port: <%= ENV['REPLICA_DB_PORT'] ||ENV['DB_PORT'] || 5432 %>
  60. prepared_statements: <%= ENV['PREPARED_STATEMENTS'] || 'true' %>
  61. replica: true