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.

147 lines
4.0KB

  1. import 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,
  20. filters: [],
  21. link_name: false,
  22. default_description: :filename
  23. config :pleroma, Pleroma.Uploaders.Local, uploads: "test/uploads"
  24. config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Test, enabled: true
  25. config :pleroma, :instance,
  26. email: "admin@example.com",
  27. notify_email: "noreply@example.com",
  28. skip_thread_containment: false,
  29. federating: false,
  30. external_user_synchronization: false,
  31. static_dir: "test/instance_static/"
  32. config :pleroma, :activitypub, sign_object_fetches: false, follow_handshake_timeout: 0
  33. # Configure your database
  34. config :pleroma, Pleroma.Repo,
  35. adapter: Ecto.Adapters.Postgres,
  36. username: "postgres",
  37. password: "postgres",
  38. database: "pleroma_test",
  39. hostname: System.get_env("DB_HOST") || "localhost",
  40. pool: Ecto.Adapters.SQL.Sandbox,
  41. pool_size: 50
  42. config :pleroma, :dangerzone, override_repo_pool_size: true
  43. # Reduce hash rounds for testing
  44. config :pleroma, :password, iterations: 1
  45. config :tesla, adapter: Tesla.Mock
  46. config :pleroma, :rich_media,
  47. enabled: false,
  48. ignore_hosts: [],
  49. ignore_tld: ["local", "localdomain", "lan"]
  50. config :pleroma, :instance,
  51. multi_factor_authentication: [
  52. totp: [
  53. # digits 6 or 8
  54. digits: 6,
  55. period: 30
  56. ],
  57. backup_codes: [
  58. number: 2,
  59. length: 6
  60. ]
  61. ]
  62. config :web_push_encryption, :vapid_details,
  63. subject: "mailto:administrator@example.com",
  64. public_key:
  65. "BLH1qVhJItRGCfxgTtONfsOKDc9VRAraXw-3NsmjMngWSh7NxOizN6bkuRA7iLTMPS82PjwJAr3UoK9EC1IFrz4",
  66. private_key: "_-XZ0iebPrRfZ_o0-IatTdszYa8VCH1yLN-JauK7HHA"
  67. config :pleroma, Oban,
  68. queues: false,
  69. crontab: false,
  70. plugins: false
  71. config :pleroma, Pleroma.ScheduledActivity,
  72. daily_user_limit: 2,
  73. total_user_limit: 3,
  74. enabled: false
  75. config :pleroma, :rate_limit, %{}
  76. config :pleroma, :http_security, report_uri: "https://endpoint.com"
  77. config :pleroma, :http, send_user_agent: false
  78. rum_enabled = System.get_env("RUM_ENABLED") == "true"
  79. config :pleroma, :database, rum_enabled: rum_enabled
  80. IO.puts("RUM enabled: #{rum_enabled}")
  81. config :joken, default_signer: "yU8uHKq+yyAkZ11Hx//jcdacWc8yQ1bxAAGrplzB0Zwwjkp35v0RK9SO8WTPr6QZ"
  82. config :pleroma, Pleroma.ReverseProxy.Client, Pleroma.ReverseProxy.ClientMock
  83. config :pleroma, :modules, runtime_dir: "test/fixtures/modules"
  84. config :pleroma, Pleroma.Gun, Pleroma.GunMock
  85. config :pleroma, Pleroma.Emails.NewUsersDigestEmail, enabled: true
  86. config :pleroma, Pleroma.Web.Plugs.RemoteIp, enabled: false
  87. config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: true
  88. config :tzdata, :autoupdate, :disabled
  89. config :pleroma, :mrf, policies: []
  90. config :pleroma, :pipeline,
  91. object_validator: Pleroma.Web.ActivityPub.ObjectValidatorMock,
  92. mrf: Pleroma.Web.ActivityPub.MRFMock,
  93. activity_pub: Pleroma.Web.ActivityPub.ActivityPubMock,
  94. side_effects: Pleroma.Web.ActivityPub.SideEffectsMock,
  95. federator: Pleroma.Web.FederatorMock,
  96. config: Pleroma.ConfigMock
  97. config :pleroma, :cachex, provider: Pleroma.CachexMock
  98. config :pleroma, :side_effects,
  99. ap_streamer: Pleroma.Web.ActivityPub.ActivityPubMock,
  100. logger: Pleroma.LoggerMock
  101. # Reduce recompilation time
  102. # https://dashbit.co/blog/speeding-up-re-compilation-of-elixir-projects
  103. config :phoenix, :plug_init_mode, :runtime
  104. if File.exists?("./config/test.secret.exs") do
  105. import_config "test.secret.exs"
  106. else
  107. IO.puts(
  108. "You may want to create test.secret.exs to declare custom database connection parameters."
  109. )
  110. end