3 # We don't run a server during test. If one is required,
4 # you can enable the server option below.
5 config :pleroma, Pleroma.Web.Endpoint,
10 # Disable captha for tests
11 config :pleroma, Pleroma.Captcha,
12 # It should not be enabled for automatic tests
14 # A fake captcha service for tests
15 method: Pleroma.Captcha.Mock
17 # Print only warnings and errors during test
18 config :logger, :console,
20 format: "\n[$level] $message\n"
22 config :pleroma, :auth, oauth_consumer_strategies: []
24 config :pleroma, Pleroma.Upload,
27 default_description: :filename
29 config :pleroma, Pleroma.Uploaders.Local, uploads: "test/uploads"
31 config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Test, enabled: true
33 config :pleroma, :instance,
34 email: "admin@example.com",
35 notify_email: "noreply@example.com",
36 skip_thread_containment: false,
38 external_user_synchronization: false,
39 static_dir: "test/instance_static/"
41 config :pleroma, :activitypub, sign_object_fetches: false, follow_handshake_timeout: 0
43 # Configure your database
44 config :pleroma, Pleroma.Repo,
45 adapter: Ecto.Adapters.Postgres,
48 database: "pleroma_test",
49 hostname: System.get_env("DB_HOST") || "localhost",
50 port: System.get_env("DB_PORT") || "5432",
51 pool: Ecto.Adapters.SQL.Sandbox,
52 pool_size: System.schedulers_online() * 2
54 config :pleroma, :dangerzone, override_repo_pool_size: true
56 # Reduce hash rounds for testing
57 config :pleroma, :password, iterations: 1
59 config :tesla, adapter: Tesla.Mock
61 config :pleroma, :rich_media,
64 ignore_tld: ["local", "localdomain", "lan"],
67 config :pleroma, :instance,
68 multi_factor_authentication: [
80 config :web_push_encryption, :vapid_details,
81 subject: "mailto:administrator@example.com",
83 "BLH1qVhJItRGCfxgTtONfsOKDc9VRAraXw-3NsmjMngWSh7NxOizN6bkuRA7iLTMPS82PjwJAr3UoK9EC1IFrz4",
84 private_key: "_-XZ0iebPrRfZ_o0-IatTdszYa8VCH1yLN-JauK7HHA"
86 config :pleroma, Oban, testing: :manual
88 config :pleroma, Pleroma.ScheduledActivity,
93 config :pleroma, :rate_limit, %{}
95 config :pleroma, :http_security, report_uri: "https://endpoint.com"
97 config :pleroma, :http, send_user_agent: false
99 rum_enabled = System.get_env("RUM_ENABLED") == "true"
100 config :pleroma, :database, rum_enabled: rum_enabled
101 IO.puts("RUM enabled: #{rum_enabled}")
103 config :joken, default_signer: "yU8uHKq+yyAkZ11Hx//jcdacWc8yQ1bxAAGrplzB0Zwwjkp35v0RK9SO8WTPr6QZ"
105 config :pleroma, Pleroma.ReverseProxy.Client, Pleroma.ReverseProxy.ClientMock
107 config :pleroma, :modules, runtime_dir: "test/fixtures/modules"
109 config :pleroma, Pleroma.Gun, Pleroma.GunMock
111 config :pleroma, Pleroma.Emails.NewUsersDigestEmail, enabled: true
113 config :pleroma, Pleroma.Web.Plugs.RemoteIp, enabled: false
115 config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: true
117 config :tzdata, :autoupdate, :disabled
119 config :pleroma, :mrf, policies: []
121 config :pleroma, :pipeline,
122 object_validator: Pleroma.Web.ActivityPub.ObjectValidatorMock,
123 mrf: Pleroma.Web.ActivityPub.MRFMock,
124 activity_pub: Pleroma.Web.ActivityPub.ActivityPubMock,
125 side_effects: Pleroma.Web.ActivityPub.SideEffectsMock,
126 federator: Pleroma.Web.FederatorMock,
127 config: Pleroma.ConfigMock
129 config :pleroma, :cachex, provider: Pleroma.CachexMock
131 config :pleroma, Pleroma.Web.WebFinger, update_nickname_on_user_fetch: false
133 config :pleroma, :side_effects,
134 ap_streamer: Pleroma.Web.ActivityPub.ActivityPubMock,
135 logger: Pleroma.LoggerMock
137 config :pleroma, Pleroma.Search, module: Pleroma.Search.DatabaseSearch
139 config :pleroma, Pleroma.Search.Meilisearch, url: "http://127.0.0.1:7700/", private_key: nil
141 # Reduce recompilation time
142 # https://dashbit.co/blog/speeding-up-re-compilation-of-elixir-projects
143 config :phoenix, :plug_init_mode, :runtime
145 config :pleroma, :config_impl, Pleroma.UnstubbedConfigMock
147 config :pleroma, Pleroma.PromEx, disabled: true
149 # Mox definitions. Only read during compile time.
150 config :pleroma, Pleroma.User.Backup, config_impl: Pleroma.UnstubbedConfigMock
151 config :pleroma, Pleroma.Uploaders.S3, ex_aws_impl: Pleroma.Uploaders.S3.ExAwsMock
152 config :pleroma, Pleroma.Uploaders.S3, config_impl: Pleroma.UnstubbedConfigMock
153 config :pleroma, Pleroma.Upload, config_impl: Pleroma.UnstubbedConfigMock
154 config :pleroma, Pleroma.ScheduledActivity, config_impl: Pleroma.UnstubbedConfigMock
155 config :pleroma, Pleroma.Web.RichMedia.Helpers, config_impl: Pleroma.StaticStubbedConfigMock
158 if String.to_integer(System.otp_release()) >= 25 do
164 config :pleroma, Pleroma.Cluster, peer_module: peer_module
166 config :pleroma, Pleroma.Application,
167 background_migrators: false,
168 internal_fetch: false,
169 load_custom_modules: false,
171 streamer_registry: false,
172 test_http_pools: true
174 config :pleroma, Pleroma.Uploaders.Uploader, timeout: 1_000
176 config :pleroma, Pleroma.Emoji.Loader, test_emoji: true
178 config :pleroma, Pleroma.Web.RichMedia.Backfill, provider: Pleroma.Web.RichMedia.Backfill
180 if File.exists?("./config/test.secret.exs") do
181 import_config "test.secret.exs"
184 "You may want to create test.secret.exs to declare custom database connection parameters."