Merge remote-tracking branch 'upstream/develop' into restrict-origin
[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 :pleroma, Oban,
87 queues: false,
88 crontab: false,
89 plugins: false
90
91 config :pleroma, Pleroma.ScheduledActivity,
92 daily_user_limit: 2,
93 total_user_limit: 3,
94 enabled: false
95
96 config :pleroma, :rate_limit, %{}
97
98 config :pleroma, :http_security, report_uri: "https://endpoint.com"
99
100 config :pleroma, :http, send_user_agent: false
101
102 rum_enabled = System.get_env("RUM_ENABLED") == "true"
103 config :pleroma, :database, rum_enabled: rum_enabled
104 IO.puts("RUM enabled: #{rum_enabled}")
105
106 config :joken, default_signer: "yU8uHKq+yyAkZ11Hx//jcdacWc8yQ1bxAAGrplzB0Zwwjkp35v0RK9SO8WTPr6QZ"
107
108 config :pleroma, Pleroma.ReverseProxy.Client, Pleroma.ReverseProxy.ClientMock
109
110 config :pleroma, :modules, runtime_dir: "test/fixtures/modules"
111
112 config :pleroma, Pleroma.Gun, Pleroma.GunMock
113
114 config :pleroma, Pleroma.Emails.NewUsersDigestEmail, enabled: true
115
116 config :pleroma, Pleroma.Plugs.RemoteIp, enabled: false
117
118 config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: true
119
120 config :pleroma, Pleroma.Uploaders.S3,
121 bucket: nil,
122 streaming_enabled: true,
123 public_endpoint: nil
124
125 config :tzdata, :autoupdate, :disabled
126
127 config :pleroma, :mrf, policies: []
128
129 if File.exists?("./config/test.secret.exs") do
130 import_config "test.secret.exs"
131 else
132 IO.puts(
133 "You may want to create test.secret.exs to declare custom database connection parameters."
134 )
135 end