93a0e2a61c032d63f12850e392b65fc8a44ba6e3
[akkoma] / config / test.exs
1 use Mix.Config
2
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,
6 http: [port: 4001],
7 url: [port: 4001],
8 server: true
9
10 # Disable captha for tests
11 config :pleroma, Pleroma.Captcha,
12 # It should not be enabled for automatic tests
13 enabled: false,
14 # A fake captcha service for tests
15 method: Pleroma.Captcha.Mock
16
17 # Print only warnings and errors during test
18 config :logger, :console,
19 level: :warn,
20 format: "\n[$level] $message\n"
21
22 config :pleroma, :fed_sockets,
23 enabled: false,
24 connection_duration: 5,
25 rejection_duration: 5
26
27 config :pleroma, :auth, oauth_consumer_strategies: []
28
29 config :pleroma, Pleroma.Upload,
30 filters: [],
31 link_name: false,
32 default_description: :filename
33
34 config :pleroma, Pleroma.Uploaders.Local, uploads: "test/uploads"
35
36 config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Test, enabled: true
37
38 config :pleroma, :instance,
39 email: "admin@example.com",
40 notify_email: "noreply@example.com",
41 skip_thread_containment: false,
42 federating: false,
43 external_user_synchronization: false,
44 static_dir: "test/instance_static/"
45
46 config :pleroma, :activitypub, sign_object_fetches: false
47
48 # Configure your database
49 config :pleroma, Pleroma.Repo,
50 adapter: Ecto.Adapters.Postgres,
51 username: "postgres",
52 password: "postgres",
53 database: "pleroma_test",
54 hostname: System.get_env("DB_HOST") || "localhost",
55 pool: Ecto.Adapters.SQL.Sandbox
56
57 # Reduce hash rounds for testing
58 config :pbkdf2_elixir, rounds: 1
59
60 config :tesla, adapter: Tesla.Mock
61
62 config :pleroma, :rich_media,
63 enabled: false,
64 ignore_hosts: [],
65 ignore_tld: ["local", "localdomain", "lan"]
66
67 config :pleroma, :instance,
68 multi_factor_authentication: [
69 totp: [
70 # digits 6 or 8
71 digits: 6,
72 period: 30
73 ],
74 backup_codes: [
75 number: 2,
76 length: 6
77 ]
78 ]
79
80 config :web_push_encryption, :vapid_details,
81 subject: "mailto:administrator@example.com",
82 public_key:
83 "BLH1qVhJItRGCfxgTtONfsOKDc9VRAraXw-3NsmjMngWSh7NxOizN6bkuRA7iLTMPS82PjwJAr3UoK9EC1IFrz4",
84 private_key: "_-XZ0iebPrRfZ_o0-IatTdszYa8VCH1yLN-JauK7HHA"
85
86 config :web_push_encryption, :http_client, Pleroma.Web.WebPushHttpClientMock
87
88 config :pleroma, Oban,
89 queues: false,
90 crontab: false,
91 plugins: false
92
93 config :pleroma, Pleroma.ScheduledActivity,
94 daily_user_limit: 2,
95 total_user_limit: 3,
96 enabled: false
97
98 config :pleroma, :rate_limit, %{}
99
100 config :pleroma, :http_security, report_uri: "https://endpoint.com"
101
102 config :pleroma, :http, send_user_agent: false
103
104 rum_enabled = System.get_env("RUM_ENABLED") == "true"
105 config :pleroma, :database, rum_enabled: rum_enabled
106 IO.puts("RUM enabled: #{rum_enabled}")
107
108 config :joken, default_signer: "yU8uHKq+yyAkZ11Hx//jcdacWc8yQ1bxAAGrplzB0Zwwjkp35v0RK9SO8WTPr6QZ"
109
110 config :pleroma, Pleroma.ReverseProxy.Client, Pleroma.ReverseProxy.ClientMock
111
112 config :pleroma, :modules, runtime_dir: "test/fixtures/modules"
113
114 config :pleroma, Pleroma.Gun, Pleroma.GunMock
115
116 config :pleroma, Pleroma.Emails.NewUsersDigestEmail, enabled: true
117
118 config :pleroma, Pleroma.Plugs.RemoteIp, enabled: false
119
120 config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: true
121
122 config :pleroma, Pleroma.Uploaders.S3,
123 bucket: nil,
124 streaming_enabled: true,
125 public_endpoint: nil
126
127 config :tzdata, :autoupdate, :disabled
128
129 config :pleroma, :mrf, policies: []
130
131 if File.exists?("./config/test.secret.exs") do
132 import_config "test.secret.exs"
133 else
134 IO.puts(
135 "You may want to create test.secret.exs to declare custom database connection parameters."
136 )
137 end