mobilizon/config/test.exs

107 lines
3.5 KiB
Elixir
Raw Normal View History

import Config
config :mobilizon, :instance,
name: "Test instance",
2024-04-10 14:36:21 +02:00
registrations_open: true,
duration_of_long_event: 0
# We don't run a server during test. If one is required,
# you can enable the server option below.
2020-01-26 21:36:50 +01:00
config :mobilizon, Mobilizon.Web.Endpoint,
http: [
port: 80
],
url: [
host: "mobilizon.test",
scheme: "http"
],
debug_errors: true,
secret_key_base: "some secret",
server: false
# Print only warnings and errors during test
config :logger,
backends: [:console],
compile_time_purge_matching: [
[level_lower_than: :debug]
],
level: :info
# Configure your database
2019-09-08 01:49:56 +02:00
config :mobilizon, Mobilizon.Storage.Repo,
types: Mobilizon.Storage.PostgresTypes,
username: System.get_env("MOBILIZON_DATABASE_USERNAME") || "mobilizon_test",
2020-01-23 21:59:50 +01:00
password: System.get_env("MOBILIZON_DATABASE_PASSWORD") || "mobilizon",
database: System.get_env("MOBILIZON_DATABASE_DBNAME") || "mobilizon_test",
hostname: System.get_env("MOBILIZON_DATABASE_HOST") || "localhost",
port: System.get_env("MOBILIZON_DATABASE_PORT") || "5432",
2019-09-08 01:49:56 +02:00
pool: Ecto.Adapters.SQL.Sandbox
config :mobilizon, :ldap,
enabled: System.get_env("LDAP_ENABLED") == "true",
host: System.get_env("LDAP_HOST") || "localhost",
port: String.to_integer(System.get_env("LDAP_PORT") || "389"),
ssl: System.get_env("LDAP_SSL") == "true",
sslopts: [],
tls: System.get_env("LDAP_TLS") == "true",
tlsopts: [],
base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
uid: System.get_env("LDAP_UID") || "cn",
require_bind_for_search: !(System.get_env("LDAP_REQUIRE_BIND_FOR_SEARCH") == "false"),
# The full CN to filter by `memberOf`, or `false` if disabled
group: false,
# Either the admin UID matching the field in `uid`,
# Either a tuple with the fully qualified DN: {:full, uid=admin,dc=example.com,dc=local}
bind_uid: System.get_env("LDAP_BIND_UID"),
bind_password: System.get_env("LDAP_BIND_PASSWORD")
# Faster runs in test environment
config :argon2_elixir,
t_cost: 1,
m_cost: 8
config :mobilizon, Mobilizon.Web.Email.Mailer, adapter: Swoosh.Adapters.Test
2020-01-26 21:36:50 +01:00
config :mobilizon, Mobilizon.Web.Upload, filters: [], link_name: false
2020-01-26 21:36:50 +01:00
config :mobilizon, Mobilizon.Web.Upload.Uploader.Local, uploads: "test/uploads"
config :mobilizon, :exports, path: "test/uploads/exports"
config :mobilizon, Mobilizon.Service.SiteMap,
path: System.get_env("MOBILIZON_SITEMAP_PATH", "test/sitemap")
config :tz_world, data_dir: "_build/test/lib/tz_world/priv"
config :tesla, Mobilizon.Service.HTTP.ActivityPub,
adapter: Mobilizon.Service.HTTP.ActivityPub.Mock
config :tesla, Mobilizon.Service.HTTP.WebfingerClient,
adapter: Mobilizon.Service.HTTP.WebfingerClient.Mock
config :tesla, Mobilizon.Service.HTTP.GeospatialClient,
adapter: Mobilizon.Service.HTTP.GeospatialClient.Mock
config :tesla, Mobilizon.Service.HTTP.HostMetaClient,
adapter: Mobilizon.Service.HTTP.HostMetaClient.Mock
config :mobilizon, Mobilizon.Service.Geospatial, service: Mobilizon.Service.Geospatial.Mock
config :mobilizon, Oban, testing: :manual
config :mobilizon, Mobilizon.Web.Auth.Guardian, secret_key: "some secret"
config :mobilizon, :activitypub, sign_object_fetches: false
config :mobilizon, Mobilizon.Web.Gettext, allowed_locales: ["fr", "en", "es", "ru"]
config :junit_formatter, report_dir: "."
config :mobilizon, :http_security, report_uri: "https://endpoint.com"
config :mobilizon, Mobilizon.Service.AntiSpam, service: Mobilizon.Service.AntiSpam.Mock
if System.get_env("DOCKER", "false") == "false" && File.exists?("./config/test.secret.exs") do
import_config "test.secret.exs"
end