Local copy of Pleroma, an ActivityPub server software. Contains modifications running live on fedi.underscore.world
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.

test.exs 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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, level: :warn
  16. config :pleroma, :auth, oauth_consumer_strategies: []
  17. config :pleroma, Pleroma.Upload, filters: [], link_name: false
  18. config :pleroma, Pleroma.Uploaders.Local, uploads: "test/uploads"
  19. config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Test, enabled: true
  20. config :pleroma, :instance,
  21. email: "admin@example.com",
  22. notify_email: "noreply@example.com",
  23. skip_thread_containment: false,
  24. federating: false,
  25. external_user_synchronization: false
  26. config :pleroma, :activitypub, sign_object_fetches: false
  27. # Configure your database
  28. config :pleroma, Pleroma.Repo,
  29. adapter: Ecto.Adapters.Postgres,
  30. username: "postgres",
  31. password: "postgres",
  32. database: "pleroma_test",
  33. hostname: System.get_env("DB_HOST") || "localhost",
  34. pool: Ecto.Adapters.SQL.Sandbox
  35. # Reduce hash rounds for testing
  36. config :pbkdf2_elixir, rounds: 1
  37. config :tesla, adapter: Tesla.Mock
  38. config :pleroma, :rich_media,
  39. enabled: false,
  40. ignore_hosts: [],
  41. ignore_tld: ["local", "localdomain", "lan"]
  42. config :web_push_encryption, :vapid_details,
  43. subject: "mailto:administrator@example.com",
  44. public_key:
  45. "BLH1qVhJItRGCfxgTtONfsOKDc9VRAraXw-3NsmjMngWSh7NxOizN6bkuRA7iLTMPS82PjwJAr3UoK9EC1IFrz4",
  46. private_key: "_-XZ0iebPrRfZ_o0-IatTdszYa8VCH1yLN-JauK7HHA"
  47. config :web_push_encryption, :http_client, Pleroma.Web.WebPushHttpClientMock
  48. config :pleroma_job_queue, disabled: true
  49. config :pleroma, Pleroma.ScheduledActivity,
  50. daily_user_limit: 2,
  51. total_user_limit: 3,
  52. enabled: false
  53. config :pleroma, :rate_limit,
  54. search: [{1000, 30}, {1000, 30}],
  55. app_account_creation: {10_000, 5},
  56. password_reset: {1000, 30}
  57. config :pleroma, :http_security, report_uri: "https://endpoint.com"
  58. config :pleroma, :http, send_user_agent: false
  59. rum_enabled = System.get_env("RUM_ENABLED") == "true"
  60. config :pleroma, :database, rum_enabled: rum_enabled
  61. IO.puts("RUM enabled: #{rum_enabled}")
  62. config :joken, default_signer: "yU8uHKq+yyAkZ11Hx//jcdacWc8yQ1bxAAGrplzB0Zwwjkp35v0RK9SO8WTPr6QZ"
  63. config :pleroma, Pleroma.ReverseProxy.Client, Pleroma.ReverseProxy.ClientMock
  64. try do
  65. import_config "test.secret.exs"
  66. rescue
  67. _ ->
  68. IO.puts(
  69. "You may want to create test.secret.exs to declare custom database connection parameters."
  70. )
  71. end