Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
3.2KB

  1. use Mix.Config
  2. # We don't run a server during test. If one is required,
  3. # you can enable the server option below.
  4. config :pleroma, Pleroma.Web.Endpoint,
  5. http: [port: 4001],
  6. url: [port: 4001],
  7. server: true
  8. # Disable captha for tests
  9. config :pleroma, Pleroma.Captcha,
  10. # It should not be enabled for automatic tests
  11. enabled: false,
  12. # A fake captcha service for tests
  13. method: Pleroma.Captcha.Mock
  14. # Print only warnings and errors during test
  15. config :logger, :console,
  16. level: :warn,
  17. format: "\n[$level] $message\n"
  18. config :pleroma, :auth, oauth_consumer_strategies: []
  19. config :pleroma, Pleroma.Upload, filters: [], link_name: false
  20. config :pleroma, Pleroma.Uploaders.Local, uploads: "test/uploads"
  21. config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Test, enabled: true
  22. config :pleroma, :instance,
  23. email: "admin@example.com",
  24. notify_email: "noreply@example.com",
  25. skip_thread_containment: false,
  26. federating: false,
  27. external_user_synchronization: false,
  28. static_dir: "test/instance_static/"
  29. config :pleroma, :activitypub, sign_object_fetches: false
  30. # Configure your database
  31. config :pleroma, Pleroma.Repo,
  32. adapter: Ecto.Adapters.Postgres,
  33. username: "postgres",
  34. password: "postgres",
  35. database: "pleroma_test",
  36. hostname: System.get_env("DB_HOST") || "localhost",
  37. pool: Ecto.Adapters.SQL.Sandbox
  38. # Reduce hash rounds for testing
  39. config :pbkdf2_elixir, rounds: 1
  40. config :tesla, adapter: Tesla.Mock
  41. config :pleroma, :rich_media,
  42. enabled: false,
  43. ignore_hosts: [],
  44. ignore_tld: ["local", "localdomain", "lan"]
  45. config :pleroma, :instance,
  46. multi_factor_authentication: [
  47. totp: [
  48. # digits 6 or 8
  49. digits: 6,
  50. period: 30
  51. ],
  52. backup_codes: [
  53. number: 2,
  54. length: 6
  55. ]
  56. ]
  57. config :web_push_encryption, :vapid_details,
  58. subject: "mailto:administrator@example.com",
  59. public_key:
  60. "BLH1qVhJItRGCfxgTtONfsOKDc9VRAraXw-3NsmjMngWSh7NxOizN6bkuRA7iLTMPS82PjwJAr3UoK9EC1IFrz4",
  61. private_key: "_-XZ0iebPrRfZ_o0-IatTdszYa8VCH1yLN-JauK7HHA"
  62. config :web_push_encryption, :http_client, Pleroma.Web.WebPushHttpClientMock
  63. config :pleroma, Oban,
  64. queues: false,
  65. prune: :disabled,
  66. crontab: false
  67. config :pleroma, Pleroma.ScheduledActivity,
  68. daily_user_limit: 2,
  69. total_user_limit: 3,
  70. enabled: false
  71. config :pleroma, :rate_limit, %{}
  72. config :pleroma, :http_security, report_uri: "https://endpoint.com"
  73. config :pleroma, :http, send_user_agent: false
  74. rum_enabled = System.get_env("RUM_ENABLED") == "true"
  75. config :pleroma, :database, rum_enabled: rum_enabled
  76. IO.puts("RUM enabled: #{rum_enabled}")
  77. config :joken, default_signer: "yU8uHKq+yyAkZ11Hx//jcdacWc8yQ1bxAAGrplzB0Zwwjkp35v0RK9SO8WTPr6QZ"
  78. config :pleroma, Pleroma.ReverseProxy.Client, Pleroma.ReverseProxy.ClientMock
  79. config :pleroma, :modules, runtime_dir: "test/fixtures/modules"
  80. config :pleroma, Pleroma.Gun, Pleroma.GunMock
  81. config :pleroma, Pleroma.Emails.NewUsersDigestEmail, enabled: true
  82. config :pleroma, Pleroma.Plugs.RemoteIp, enabled: false
  83. config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: true
  84. if File.exists?("./config/test.secret.exs") do
  85. import_config "test.secret.exs"
  86. else
  87. IO.puts(
  88. "You may want to create test.secret.exs to declare custom database connection parameters."
  89. )
  90. end